Echobase-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
March 2012
- 2 participants
- 129 discussions
r463 - in trunk/echobase-ui/src/main: java/fr/ifremer/echobase/ui/actions/importData resources/fr/ifremer/echobase/ui/actions/importData webapp/WEB-INF/jsp/importData
by tchemit@users.forge.codelutin.com 30 Mar '12
by tchemit@users.forge.codelutin.com 30 Mar '12
30 Mar '12
Author: tchemit
Date: 2012-03-30 22:13:39 +0200 (Fri, 30 Mar 2012)
New Revision: 463
Url: http://forge.codelutin.com/repositories/revision/echobase/463
Log:
fixes #1057: Probl?\195?\168me lors de l'affichage d'un import acoustique
Added:
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAcousticImport.java
Removed:
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java
Modified:
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport-validation.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java 2012-03-30 19:36:46 UTC (rev 462)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java 2012-03-30 20:13:39 UTC (rev 463)
@@ -1,43 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.ui.actions.importData;
-
-import fr.ifremer.echobase.services.importdata.AcousticImportConfiguration;
-import fr.ifremer.echobase.services.importdata.AcousticImportService;
-
-/**
- * Configure a accoustic data import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class LaunchAccousticImport extends AbstractLaunchImport<AcousticImportConfiguration, AcousticImportService> {
-
- private static final long serialVersionUID = 1L;
-
- public LaunchAccousticImport() {
- super(AcousticImportConfiguration.class, AcousticImportService.class);
- }
-
-}
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAcousticImport.java (from rev 460, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAcousticImport.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAcousticImport.java 2012-03-30 20:13:39 UTC (rev 463)
@@ -0,0 +1,43 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.ui.actions.importData;
+
+import fr.ifremer.echobase.services.importdata.AcousticImportConfiguration;
+import fr.ifremer.echobase.services.importdata.AcousticImportService;
+
+/**
+ * Configure a accoustic data import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class LaunchAcousticImport extends AbstractLaunchImport<AcousticImportConfiguration, AcousticImportService> {
+
+ private static final long serialVersionUID = 1L;
+
+ public LaunchAcousticImport() {
+ super(AcousticImportConfiguration.class, AcousticImportService.class);
+ }
+
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAcousticImport.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport-validation.xml 2012-03-30 19:36:46 UTC (rev 462)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport-validation.xml 2012-03-30 20:13:39 UTC (rev 463)
@@ -31,12 +31,6 @@
</field-validator>
</field>
- <field name="model.transitId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transit.required"/>
- </field-validator>
- </field>
-
<field name="model.vesselId">
<field-validator type="nrequiredstring">
<message key="echobase.error.import.vessel.required"/>
@@ -70,12 +64,6 @@
</field-validator>
</field>
- <field name="model.echosounderSoundSpeed">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.echosounderSoundSpeed.required"/>
- </field-validator>
- </field>
-
<field name="model.loggedDataFormat">
<field-validator type="nrequiredstring">
<message key="echobase.error.import.loggedDataFormat.required"/>
@@ -126,13 +114,6 @@
</field-validator>
</field>
- <field name="model.digitThreshold">
- <field-validator type="nrequiredstring">
- <message
- key="echobase.error.import.digitThreshold.required"/>
- </field-validator>
- </field>
-
<field name="model.acousticDensityUnit">
<field-validator type="nrequiredstring">
<message
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp 2012-03-30 19:36:46 UTC (rev 462)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp 2012-03-30 20:13:39 UTC (rev 463)
@@ -25,7 +25,7 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<s:url id="url" action="importAccoustic" namespace="/importData"/>
+<s:url id="url" action="importAcoustic" namespace="/importData"/>
<meta http-equiv="refresh" content="1;url=${url}"/>
<title>
1
0
30 Mar '12
Author: tchemit
Date: 2012-03-30 21:36:46 +0200 (Fri, 30 Mar 2012)
New Revision: 462
Url: http://forge.codelutin.com/repositories/revision/echobase/462
Log:
remove unused code
Modified:
trunk/echobase-ui/src/main/resources/config/struts-importData.xml
Modified: trunk/echobase-ui/src/main/resources/config/struts-importData.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/config/struts-importData.xml 2012-03-30 19:36:14 UTC (rev 461)
+++ trunk/echobase-ui/src/main/resources/config/struts-importData.xml 2012-03-30 19:36:46 UTC (rev 462)
@@ -22,8 +22,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
#L%
-->
-
-
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
@@ -45,17 +43,6 @@
</action>
<!-- Configure import -->
- <!--action name="Configure*-*" method="{2}"
- class="fr.ifremer.echobase.ui.actions.importData.Configure{1}">
- <interceptor-ref name="prepareParamsStackLoggued"/>
- <result name="input">/WEB-INF/jsp/importData/configure{1}Import.jsp</result>
- <result type="redirectAction">
- <param name="namespace">/importData</param>
- <param name="actionName">import{1}</param>
- </result>
- </action-->
-
- <!-- Configure import -->
<action name="configure*-*" method="{2}"
class="fr.ifremer.echobase.ui.actions.importData.Configure{1}Import">
<interceptor-ref name="paramsPrepareParamsStackLoggued"/>
1
0
30 Mar '12
Author: tchemit
Date: 2012-03-30 21:36:14 +0200 (Fri, 30 Mar 2012)
New Revision: 461
Url: http://forge.codelutin.com/repositories/revision/echobase/461
Log:
fixes #1055: Ajouter le champs dataQuality pour les imports de data et resultats
Removed:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportRow.java
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/EchobaseCsvUtil.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportRow.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportRow.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportRow.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportRow.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportRow.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportRow.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportRow.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportRow.java
trunk/echobase-services/src/test/resources/import-data/acoustic/movies.csv.gz
trunk/echobase-services/src/test/resources/import-data/result/esdu/byEchotype.csv.gz
trunk/echobase-services/src/test/resources/import-data/result/esdu/byEchotypeAndSpeciesCategory.csv.gz
trunk/echobase-services/src/test/resources/import-data/result/esdu/bySpeciesAndAgeCategory.csv.gz
trunk/echobase-services/src/test/resources/import-data/result/esdu/bySpeciesAndSizeCategory.csv.gz
trunk/echobase-services/src/test/resources/import-data/result/map/maps.csv.gz
trunk/echobase-services/src/test/resources/import-data/result/region/regionResults.csv.gz
trunk/echobase-services/src/test/resources/import-data/result/region/regions.csv.gz
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -320,6 +320,13 @@
}
};
+ public static final Function<DataQuality, String> DATA_QUALITY_NAME = new Function<DataQuality, String>() {
+ @Override
+ public String apply(DataQuality input) {
+ return String.valueOf(input.getQualityDataFlagValues());
+ }
+ };
+
public static String getSpeciesCategoryKey(Species species, SizeCategory sizeCategory, SexCategory sexCategory) {
String key = species.getBaracoudaCode();
if (sizeCategory != null) {
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/EchobaseCsvUtil.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/EchobaseCsvUtil.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/EchobaseCsvUtil.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -28,6 +28,7 @@
import fr.ifremer.echobase.entities.data.Result;
import fr.ifremer.echobase.entities.data.Voyage;
import fr.ifremer.echobase.entities.references.DataMetadata;
+import fr.ifremer.echobase.entities.references.DataQuality;
import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.util.csv.Common;
import org.nuiton.util.csv.ValueFormatter;
@@ -138,9 +139,15 @@
}
public static interface ResultAble {
+
void addResult(Result value);
List<Result> getResult();
+
+ DataQuality getDataQuality();
+
+ void setDataQuality(DataQuality dataQuality);
+
}
public static <B extends ResultAble> ValueSetter<B, Result> newResultValueSetter() {
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -44,6 +44,7 @@
import fr.ifremer.echobase.entities.data.ResultDAO;
import fr.ifremer.echobase.entities.references.AgeCategory;
import fr.ifremer.echobase.entities.references.DataMetadata;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.SexCategory;
import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.Species;
@@ -411,12 +412,14 @@
Cell cell,
DataMetadata dataMetaData,
String dataValue,
+ DataQuality dataQuality,
CsvFileImportResult importResult) {
Data data = create(dao,
Data.PROPERTY_DATA_METADATA, dataMetaData,
Data.PROPERTY_DATA_VALUE, dataValue);
cell.addData(data);
+ cell.setDataQuality(dataQuality);
importResult.incrementsNumberCreated(EchoBaseEntityEnum.Data);
}
@@ -431,6 +434,7 @@
for (Result result : results) {
+ result.setDataQuality(row.getDataQuality());
result.setCategory(category);
result.setResultLabel(resultLabel);
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportService.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportService.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -47,6 +47,7 @@
import fr.ifremer.echobase.entities.references.AcousticInstrument;
import fr.ifremer.echobase.entities.references.CellType;
import fr.ifremer.echobase.entities.references.DataMetadata;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.Vessel;
import fr.ifremer.echobase.services.ImportException;
import fr.ifremer.echobase.services.importdata.csv.AcousticImportModel;
@@ -116,12 +117,10 @@
private final DateFormat cellDateFormat = new SimpleDateFormat(
EchobaseCsvUtil.CELLULE_DATE_FORMAT);
-
private DataAcquisition getDataAcquisition(Transect transect,
AcousticInstrument instrument,
boolean addDataAcquisition) throws ImportException {
-
DataAcquisition result = null;
if (!addDataAcquisition &&
!transect.isDataAcquisitionEmpty()) {
@@ -165,8 +164,11 @@
Map<String, DataMetadata> dataMetadatasByName = getEntitiesMap(
DataMetadata.class, EchoBaseFunctions.DATA_METADATA_NAME);
+ Map<String, DataQuality> dataQualityMap = getEntitiesMap(
+ DataQuality.class, EchoBaseFunctions.DATA_QUALITY_NAME);
+
AcousticImportModel csvModel = new AcousticImportModel(
- getCsvSeparator(), instrumentsById);
+ getCsvSeparator(), instrumentsById, dataQualityMap);
DataAcquisitionDAO dataAcquisitionDAO =
getDAO(DataAcquisition.class, DataAcquisitionDAO.class);
@@ -198,13 +200,7 @@
for (AcousticImportRow row : importer) {
configuration.incrementsProgression();
- rowNumber++;
- if (rowNumber % 100 == 0) {
- if (log.isInfoEnabled()) {
- log.info("Doing line " + rowNumber);
- }
- }
if (dataProcessingId == null) {
// compute once for all the common dataprocessing id used
@@ -249,7 +245,9 @@
// need to use another data acquisition
if (log.isDebugEnabled()) {
- log.debug("[row " + rowNumber + "] New instrument to use (" + instrument.getId() + ")");
+ log.debug("[row " + rowNumber +
+ "] New instrument to use (" +
+ instrument.getId() + ")");
}
if (CollectionUtils.isNotEmpty(elementaryCells)) {
@@ -293,7 +291,8 @@
transect.addDataAcquisition(dataAcquisition);
// count creation in result
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.DataAcquisition);
+ importResult.incrementsNumberCreated(
+ EchoBaseEntityEnum.DataAcquisition);
if (log.isDebugEnabled()) {
log.debug("[row " + rowNumber +
@@ -329,8 +328,8 @@
if (!row.isCellToAdd()) {
// dead cell not to be imported
- if (log.isWarnEnabled()) {
- log.warn("Will not import cell of row " + rowNumber);
+ if (log.isDebugEnabled()) {
+ log.debug("Will not import cell of row " + rowNumber);
}
continue;
}
@@ -339,6 +338,8 @@
String esduCellId = cellDateFormat.format(startDate);
+ DataQuality dataQuality = row.getDataQuality();
+
if (cellType == 4) {
if (log.isDebugEnabled()) {
@@ -354,6 +355,8 @@
Cell.PROPERTY_NAME, esduCellId
);
+ esduCell.setDataQuality(dataQuality);
+
// add all found elementary cells
esduCell.addAllChilds(elementaryCells);
@@ -370,6 +373,7 @@
esduCell,
dataMetadatasByName,
row,
+ dataQuality,
dataDAO,
importResult);
} else {
@@ -392,6 +396,7 @@
Cell.PROPERTY_CELL_TYPE, elementaryCellType,
Cell.PROPERTY_NAME, elementaryCellId
);
+ elementaryCell.setDataQuality(dataQuality);
// keep (to attach them to esdu cell)
elementaryCells.add(elementaryCell);
@@ -404,6 +409,7 @@
dataMetadatasByName,
surface,
row,
+ dataQuality,
dataDAO,
importResult);
}
@@ -421,6 +427,7 @@
Cell cell,
Map<String, DataMetadata> dataMetadatas,
AcousticImportRow row,
+ DataQuality dataQuality,
DataDAO dao,
CsvFileImportResult importResult) {
@@ -429,57 +436,58 @@
// create Latitude data
dataValue = String.valueOf(row.getCellLatitude());
createCellData(dao, cell, dataMetadatas, "Latitude" + suffix,
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
// create Longitude data
dataValue = String.valueOf(row.getCellLongitude());
createCellData(dao, cell, dataMetadatas, "Longitude" + suffix,
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
// create Depth data
dataValue = row.getEsduCellDataDepth();
createCellData(dao, cell, dataMetadatas, "DepthRefSurface" + suffix,
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
// create Time Start data
dataValue = cellDateFormat.format(row.getCellDateStart());
createCellData(dao, cell, dataMetadatas, "TimeStart",
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
// create Time end data
dataValue = cellDateFormat.format(row.getCellDateEnd());
createCellData(dao, cell, dataMetadatas, "TimeEnd",
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
// create NASC data
if (row.getCellNasc() != null) {
dataValue = String.valueOf(row.getCellNasc());
createCellData(dao, cell, dataMetadatas, "NASC",
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
}
// create Volume data
if (row.getCellVolume() != null) {
dataValue = String.valueOf(row.getCellVolume());
createCellData(dao, cell, dataMetadatas, "Volume ",
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
}
+
// create Surface data
dataValue = String.valueOf(row.getCellSurface());
createCellData(dao, cell, dataMetadatas, "Surface",
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
// create NumberOfSamplesRecorded data
if (row.getCellNumberOfSamplesRecorded() != null) {
dataValue = String.valueOf(row.getCellNumberOfSamplesRecorded());
createCellData(dao, cell, dataMetadatas, "NumberOfSamplesRecorded",
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
}
// create NumberOfSamplesEchoIntegrated data
if (row.getCellNumberOfSamplesEchoIntegrated() != null) {
dataValue = String.valueOf(row.getCellNumberOfSamplesEchoIntegrated());
createCellData(dao, cell, dataMetadatas, "NumberOfSamplesEchoIntegrated",
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
}
}
@@ -488,6 +496,7 @@
Map<String, DataMetadata> dataMetadatas,
boolean surface,
AcousticImportRow row,
+ DataQuality dataQuality,
DataDAO dao,
CsvFileImportResult importResult) {
@@ -513,59 +522,62 @@
// create Latitude data
dataValue = String.valueOf(row.getCellLatitude());
createCellData(dao, cell, dataMetadatas, "Latitude" + suffix,
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
// create Longitude data
dataValue = String.valueOf(row.getCellLongitude());
createCellData(dao, cell, dataMetadatas, "Longitude" + suffix,
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
// create depth start data
dataValue = String.valueOf(row.getCellDepthStart());
- createCellData(dao, cell, dataMetadatas, startMeta, dataValue, importResult);
+ createCellData(dao, cell, dataMetadatas, startMeta, dataValue,
+ dataQuality, importResult);
// create depth end data
dataValue = String.valueOf(row.getCellDepthEnd());
- createCellData(dao, cell, dataMetadatas, endMeta, dataValue, importResult);
+ createCellData(dao, cell, dataMetadatas, endMeta, dataValue,
+ dataQuality, importResult);
// create Time Start data
dataValue = cellDateFormat.format(row.getCellDateStart());
createCellData(dao, cell, dataMetadatas, "TimeStart",
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
// create Time end data
dataValue = cellDateFormat.format(row.getCellDateEnd());
createCellData(dao, cell, dataMetadatas, "TimeEnd",
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
// create acoustic density data
if (row.getCellNasc() != null) {
dataValue = String.valueOf(row.getCellNasc());
- createCellData(dao, cell, dataMetadatas, "NASC", dataValue, importResult);
+ createCellData(dao, cell, dataMetadatas, "NASC", dataValue,
+ dataQuality, importResult);
}
// create Volume data
if (row.getCellVolume() != null) {
dataValue = String.valueOf(row.getCellVolume());
createCellData(dao, cell, dataMetadatas, "Volume ",
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
}
// create Surface data
dataValue = String.valueOf(row.getCellSurface());
createCellData(dao, cell, dataMetadatas, "Surface",
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
// create NumberOfSamplesRecorded data
if (row.getCellNumberOfSamplesRecorded() != null) {
dataValue = String.valueOf(row.getCellNumberOfSamplesRecorded());
createCellData(dao, cell, dataMetadatas, "NumberOfSamplesRecorded",
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
}
// create NumberOfSamplesEchoIntegrated data
if (row.getCellNumberOfSamplesEchoIntegrated() != null) {
dataValue = String.valueOf(row.getCellNumberOfSamplesEchoIntegrated());
createCellData(dao, cell, dataMetadatas, "NumberOfSamplesEchoIntegrated",
- dataValue, importResult);
+ dataValue, dataQuality, importResult);
}
}
@@ -696,12 +708,14 @@
Map<String, DataMetadata> dataMetadatasByName,
String metadataName,
String dataValue,
+ DataQuality dataQuality,
CsvFileImportResult importResult) {
createCellData(
dao,
cell,
dataMetadatasByName.get(metadataName),
dataValue,
+ dataQuality,
importResult
);
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -41,6 +41,7 @@
import fr.ifremer.echobase.entities.references.AgeCategory;
import fr.ifremer.echobase.entities.references.AgeCategoryDAO;
import fr.ifremer.echobase.entities.references.DataMetadata;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.SizeCategoryDAO;
import fr.ifremer.echobase.entities.references.Species;
@@ -102,13 +103,18 @@
Map<String, DataMetadata> dataMetadataMap = getEntitiesMap(
DataMetadata.class, EchoBaseFunctions.DATA_METADATA_NAME);
+ Map<String, DataQuality> dataQualityMap = getEntitiesMap(
+ DataQuality.class, EchoBaseFunctions.DATA_QUALITY_NAME);
+
+
// get selected voyage
Voyage voyage = getEntityById(Voyage.class,
configuration.getVoyageId());
// get selected dataProcessing
- DataProcessing dataProcessing = getEntityById(DataProcessing.class,
- configuration.getDataProcessingId());
+ DataProcessing dataProcessing = getEntityById(
+ DataProcessing.class,
+ configuration.getDataProcessingId());
// get esdu cells usables
Map<String, Cell> esduCellMap = Maps.uniqueIndex(
@@ -130,8 +136,8 @@
voyage,
echotypeMap,
dataMetadataMap,
- esduCellMap
- );
+ esduCellMap,
+ dataQualityMap);
configuration.addResult(importResult);
}
@@ -145,8 +151,8 @@
dataMetadataMap,
speciesMap,
sizeCategoryMap,
- esduCellMap
- );
+ esduCellMap,
+ dataQualityMap);
configuration.addResult(importResult);
}
@@ -159,8 +165,8 @@
dataMetadataMap,
speciesMap,
sizeCategoryMap,
- esduCellMap
- );
+ esduCellMap,
+ dataQualityMap);
configuration.addResult(importResult);
}
@@ -174,8 +180,8 @@
dataMetadataMap,
speciesMap,
ageCategoryMap,
- esduCellMap
- );
+ esduCellMap,
+ dataQualityMap);
configuration.addResult(importResult);
}
}
@@ -186,7 +192,8 @@
Voyage voyage,
Map<String, Echotype> echotypeMap,
Map<String, DataMetadata> dataMetadataMap,
- Map<String, Cell> esduCellMap) throws ImportException {
+ Map<String, Cell> esduCellMap,
+ Map<String, DataQuality> dataQualityMap) throws ImportException {
if (log.isInfoEnabled()) {
log.info("Starts import of esdu result by echotype from file " +
@@ -210,7 +217,8 @@
echotypeMap,
voyage,
esduCellMap,
- metas);
+ metas,
+ dataQualityMap);
CategoryDAO categoryDAO = (CategoryDAO) getDAO(Category.class);
ResultDAO dao = getDAO(Result.class, ResultDAO.class);
@@ -236,7 +244,6 @@
addResults(row, cell, category, resultLabel, dao, importResult);
}
-
return importResult;
} catch (ImportRuntimeException e) {
throw new ImportException(getLocale(), inputFile, e);
@@ -253,7 +260,8 @@
Map<String, DataMetadata> dataMetadataMap,
Map<String, Species> speciesMap,
Map<String, SizeCategory> sizeCategoryMap,
- Map<String, Cell> esduCellMap) throws ImportException {
+ Map<String, Cell> esduCellMap,
+ Map<String, DataQuality> dataQualityMap) throws ImportException {
if (log.isInfoEnabled()) {
log.info("Starts import of acoustic result by echotype " +
@@ -288,7 +296,8 @@
sizeCategoryMap,
voyage,
esduCellMap,
- metas);
+ metas,
+ dataQualityMap);
String resultLabel = configuration.getResultLabel();
@@ -329,7 +338,8 @@
Map<String, DataMetadata> dataMetadataMap,
Map<String, Species> speciesMap,
Map<String, SizeCategory> sizeCategoryMap,
- Map<String, Cell> esduCellMap) throws ImportException {
+ Map<String, Cell> esduCellMap,
+ Map<String, DataQuality> dataQualityMap) throws ImportException {
if (log.isInfoEnabled()) {
log.info("Starts import of acoustic result by speices and size category from file " +
@@ -363,7 +373,8 @@
speciesMap,
voyage,
esduCellMap,
- metas);
+ metas,
+ dataQualityMap);
CategoryDAO categoryDAO = (CategoryDAO) getDAO(Category.class);
@@ -428,7 +439,8 @@
Map<String, DataMetadata> dataMetadataMap,
Map<String, Species> speciesMap,
Map<String, AgeCategory> ageCategoryMap,
- Map<String, Cell> esduCellMap) throws ImportException {
+ Map<String, Cell> esduCellMap,
+ Map<String, DataQuality> dataQualityMap) throws ImportException {
if (log.isInfoEnabled()) {
log.info("Starts import of acoustic result by species and age category from file " +
@@ -462,7 +474,8 @@
speciesMap,
voyage,
esduCellMap,
- metas);
+ metas,
+ dataQualityMap);
String resultLabel = configuration.getResultLabel();
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -43,6 +43,7 @@
import fr.ifremer.echobase.entities.references.AgeCategory;
import fr.ifremer.echobase.entities.references.CellType;
import fr.ifremer.echobase.entities.references.DataMetadata;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.Species;
import fr.ifremer.echobase.entities.references.SpeciesCategory;
@@ -151,6 +152,9 @@
Map<String, DataMetadata> dataMetadataMap = getEntitiesMap(
DataMetadata.class, EchoBaseFunctions.DATA_METADATA_NAME);
+ Map<String, DataQuality> dataQualityMap = getEntitiesMap(
+ DataQuality.class, EchoBaseFunctions.DATA_QUALITY_NAME);
+
// first get header of file to detect which results to import
String[] header = EchoBaseImport.getHeader(inputFile.getFile(),
getCsvSeparator());
@@ -167,7 +171,8 @@
speciesMap,
sizeCategoryMap,
ageCategoryMap,
- metas);
+ metas,
+ dataQualityMap);
CsvFileImportResult importResult = new CsvFileImportResult(
inputFile.getFileName());
@@ -194,11 +199,14 @@
voyage.addPostCell(cell);
importResult.incrementsNumberCreated(EchoBaseEntityEnum.Cell);
+ DataQuality dataQuality = row.getDataQuality();
+
// add gridCellLongitude data
createCellData(dataDao,
cell,
dataLongitudeMeta,
String.valueOf(row.getGridCellLongitude()),
+ dataQuality,
importResult
);
@@ -207,6 +215,7 @@
cell,
dataLatitudeMeta,
String.valueOf(row.getGridCellLatitude()),
+ dataQuality,
importResult
);
@@ -215,6 +224,7 @@
cell,
dataDepthMeta,
String.valueOf(row.getGridCellDepth()),
+ dataQuality,
importResult
);
@@ -223,6 +233,7 @@
cell,
dataLongitudeLagMeta,
String.valueOf(row.getGridLongitudeLag()),
+ dataQuality,
importResult
);
@@ -231,6 +242,7 @@
cell,
dataLatitudeLagMeta,
String.valueOf(row.getGridLatitudeLag()),
+ dataQuality,
importResult
);
@@ -239,6 +251,7 @@
cell,
dataDepthLagMeta,
String.valueOf(row.getGridDepthLag()),
+ dataQuality,
importResult
);
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -43,6 +43,7 @@
import fr.ifremer.echobase.entities.data.Voyage;
import fr.ifremer.echobase.entities.references.CellType;
import fr.ifremer.echobase.entities.references.DataMetadata;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.Species;
import fr.ifremer.echobase.entities.references.SpeciesCategory;
@@ -91,21 +92,25 @@
Voyage voyage = getEntityById(Voyage.class,
configuration.getVoyageId());
+ Map<String, DataQuality> dataQualityMap = getEntitiesMap(
+ DataQuality.class, EchoBaseFunctions.DATA_QUALITY_NAME);
+
CsvFileImportResult importResult;
- importResult = importRegionFile(configuration, voyage);
+ importResult = importRegionFile(configuration, voyage, dataQualityMap);
configuration.addResult(importResult);
importResult = importRegionAssociationFile(configuration, voyage);
configuration.addResult(importResult);
- importResult = importRegionResultFile(configuration, voyage);
+ importResult = importRegionResultFile(configuration, voyage, dataQualityMap);
configuration.addResult(importResult);
}
protected CsvFileImportResult importRegionFile(
ResultsImportConfiguration configuration,
- Voyage voyage) throws ImportException {
+ Voyage voyage,
+ Map<String, DataQuality> dataQualityMap) throws ImportException {
InputFile inputFile = configuration.getRegionsFile();
@@ -138,7 +143,8 @@
RegionCellImportModel csvModel = new RegionCellImportModel(
serviceContext.getConfiguration().getCsvSeparator(),
voyageMap,
- cellTypeMap
+ cellTypeMap,
+ dataQualityMap
);
if (log.isInfoEnabled()) {
@@ -177,6 +183,7 @@
cell,
dataSurfaceMeta,
String.valueOf(row.getDataSurface()),
+ row.getDataQuality(),
importResult
);
}
@@ -186,6 +193,7 @@
cell,
dataCoordinateMeta,
row.getDataCoordinate(),
+ row.getDataQuality(),
importResult
);
}
@@ -252,7 +260,8 @@
protected CsvFileImportResult importRegionResultFile(
ResultsImportConfiguration configuration,
- Voyage voyage) throws ImportException {
+ Voyage voyage,
+ Map<String, DataQuality> dataQualityMap) throws ImportException {
InputFile inputFile = configuration.getRegionResultFile();
@@ -300,7 +309,8 @@
echotypeMap,
speciesMap,
sizeCategoryMap,
- metas);
+ metas,
+ dataQualityMap);
String resultLabel = configuration.getResultLabel();
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportModel.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportModel.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -30,6 +30,7 @@
import fr.ifremer.echobase.entities.data.DataAcquisition;
import fr.ifremer.echobase.entities.data.DataProcessing;
import fr.ifremer.echobase.entities.references.AcousticInstrument;
+import fr.ifremer.echobase.entities.references.DataQuality;
import java.util.Map;
@@ -43,7 +44,8 @@
public class AcousticImportModel extends AbstractImportModel<AcousticImportRow> {
public AcousticImportModel(char separator,
- Map<String, AcousticInstrument> instrumentsById) {
+ Map<String, AcousticInstrument> instrumentsById,
+ Map<String, DataQuality> dataQualityMap) {
super(separator);
newMandatoryColumn("MOVIES_EILayer", AcousticImportRow.PROPERTY_EI_LAYER);//A
@@ -123,6 +125,11 @@
newIgnoredColumn("MOVIES_EILayer\\boterr\\sa");//BT
newIgnoredColumn("MOVIES_EILayer\\boterr\\ni");//BU
newMandatoryColumn("MOVIES_EILayer\\sndset\\soundcelerity", AcousticImportRow.PROPERTY_SOUND_CELERITY);//BV
+
+ newForeignKeyColumn(AcousticImportRow.PROPERTY_DATA_QUALITY,
+ DataQuality.class,
+ DataQuality.PROPERTY_QUALITY_DATA_FLAG_VALUES,
+ dataQualityMap); //E
}
@Override
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportRow.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportRow.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -24,6 +24,7 @@
package fr.ifremer.echobase.services.importdata.csv;
import fr.ifremer.echobase.entities.references.AcousticInstrument;
+import fr.ifremer.echobase.entities.references.DataQuality;
import java.util.Date;
@@ -89,6 +90,8 @@
public static final String PROPERTY_CELL_LONGITUDE = "cellLongitude";
+ public static final String PROPERTY_DATA_QUALITY = "dataQuality";
+
protected String eiLayer;
protected String esduCellDataDepth;
@@ -141,6 +144,8 @@
protected String soundCelerity;
+ protected DataQuality dataQuality;
+
protected AcousticInstrument acousticInstrument;
public boolean isCellToAdd() {
@@ -362,4 +367,12 @@
public void setSoundCelerity(String soundCelerity) {
this.soundCelerity = soundCelerity;
}
+
+ public DataQuality getDataQuality() {
+ return dataQuality;
+ }
+
+ public void setDataQuality(DataQuality dataQuality) {
+ this.dataQuality = dataQuality;
+ }
}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportModel.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportModel.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -30,6 +30,7 @@
import fr.ifremer.echobase.entities.data.Result;
import fr.ifremer.echobase.entities.data.Voyage;
import fr.ifremer.echobase.entities.references.DataMetadata;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.Species;
@@ -48,7 +49,8 @@
"name",
"baracoudaCode",
"sizeCategory",
- EsduResultByEchotypeImportRow.PROPERTY_ECHOTYPE
+ EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_ECHOTYPE,
+ EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_DATA_QUALITY
};
public EsduResultByEchotypeAndSpeciesCategoryImportModel(
@@ -58,13 +60,15 @@
Map<String, SizeCategory> sizeCategoryMap,
Voyage voyage,
Map<String, Cell> esduCellMap,
- List<DataMetadata> dataMetadatas) {
+ List<DataMetadata> dataMetadatas,
+ Map<String, DataQuality> dataQualityMap) {
super(separator);
newForeignKeyColumn(EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_ECHOTYPE, Echotype.class, Echotype.PROPERTY_NAME, echotypeMap);
newForeignKeyColumn("baracoudaCode", EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap);
newForeignKeyColumn(EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_SIZE_CATEGORY, SizeCategory.class, SizeCategory.PROPERTY_NAME, sizeCategoryMap);
newMandatoryColumn("name", EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, esduCellMap));
+ newForeignKeyColumn(EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_DATA_QUALITY, DataQuality.class, DataQuality.PROPERTY_QUALITY_DATA_FLAG_VALUES, dataQualityMap);
for (DataMetadata metadata : dataMetadatas) {
String name = metadata.getName();
@@ -73,6 +77,7 @@
EchobaseCsvUtil.newResultValueParser(metadata, false),
EchobaseCsvUtil.<EsduResultByEchotypeAndSpeciesCategoryImportRow>newResultValueSetter());
}
+
}
@Override
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportRow.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportRow.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -28,6 +28,7 @@
import fr.ifremer.echobase.entities.data.Cell;
import fr.ifremer.echobase.entities.data.Echotype;
import fr.ifremer.echobase.entities.data.Result;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.Species;
@@ -50,6 +51,8 @@
public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory";
+ public static final String PROPERTY_DATA_QUALITY = "dataQuality";
+
protected Echotype echotype;
protected Cell cell;
@@ -60,6 +63,9 @@
private SizeCategory sizeCategory;
+ protected DataQuality dataQuality;
+
+
public Echotype getEchotype() {
return echotype;
}
@@ -101,4 +107,11 @@
this.sizeCategory = sizeCategory;
}
+ public DataQuality getDataQuality() {
+ return dataQuality;
+ }
+
+ public void setDataQuality(DataQuality dataQuality) {
+ this.dataQuality = dataQuality;
+ }
}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportModel.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportModel.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -30,6 +30,7 @@
import fr.ifremer.echobase.entities.data.Result;
import fr.ifremer.echobase.entities.data.Voyage;
import fr.ifremer.echobase.entities.references.DataMetadata;
+import fr.ifremer.echobase.entities.references.DataQuality;
import java.util.List;
import java.util.Map;
@@ -44,7 +45,8 @@
public static final String[] COLUMN_NAMES_TO_EXCLUDE = {
"name",
- EsduResultByEchotypeImportRow.PROPERTY_ECHOTYPE
+ EsduResultByEchotypeImportRow.PROPERTY_ECHOTYPE,
+ EsduResultByEchotypeImportRow.PROPERTY_DATA_QUALITY
};
public EsduResultByEchotypeImportModel(
@@ -52,11 +54,13 @@
Map<String, Echotype> echotypeMap,
Voyage voyage,
Map<String, Cell> esduCellMap,
- List<DataMetadata> dataMetadatas) {
+ List<DataMetadata> dataMetadatas,
+ Map<String, DataQuality> dataQualityMap) {
super(separator);
newForeignKeyColumn(EsduResultByEchotypeImportRow.PROPERTY_ECHOTYPE, Echotype.class, Echotype.PROPERTY_NAME, echotypeMap);
newMandatoryColumn("name", EsduResultByEchotypeImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, esduCellMap));
+ newForeignKeyColumn(EsduResultByEchotypeImportRow.PROPERTY_DATA_QUALITY, DataQuality.class, DataQuality.PROPERTY_QUALITY_DATA_FLAG_VALUES, dataQualityMap);
for (DataMetadata metadata : dataMetadatas) {
String name = metadata.getName();
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportRow.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportRow.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -28,6 +28,7 @@
import fr.ifremer.echobase.entities.data.Cell;
import fr.ifremer.echobase.entities.data.Echotype;
import fr.ifremer.echobase.entities.data.Result;
+import fr.ifremer.echobase.entities.references.DataQuality;
import java.util.List;
@@ -43,12 +44,16 @@
public static final String PROPERTY_CELL = "cell";
+ public static final String PROPERTY_DATA_QUALITY = "dataQuality";
+
protected Echotype echotype;
protected Cell cell;
protected List<Result> result = Lists.newArrayList();
+ protected DataQuality dataQuality;
+
public Echotype getEchotype() {
return echotype;
}
@@ -73,4 +78,12 @@
public void addResult(Result result) {
this.result.add(result);
}
+
+ public DataQuality getDataQuality() {
+ return dataQuality;
+ }
+
+ public void setDataQuality(DataQuality dataQuality) {
+ this.dataQuality = dataQuality;
+ }
}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportModel.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportModel.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -29,6 +29,7 @@
import fr.ifremer.echobase.entities.data.Result;
import fr.ifremer.echobase.entities.data.Voyage;
import fr.ifremer.echobase.entities.references.DataMetadata;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.Species;
import java.util.List;
@@ -47,6 +48,7 @@
"baracoudaCode",
EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_AGE_CATEGORY,
EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_AGE_CATEGORY_MEANING,
+ EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_DATA_QUALITY
};
public EsduResultBySpeciesAndAgeCategoryImportModel(
@@ -54,13 +56,15 @@
Map<String, Species> speciesMap,
Voyage voyage,
Map<String, Cell> esduCellMap,
- List<DataMetadata> dataMetadatas) {
+ List<DataMetadata> dataMetadatas,
+ Map<String, DataQuality> dataQualityMap) {
super(separator);
newMandatoryColumn("name", EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, esduCellMap));
newMandatoryColumn(EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_AGE_CATEGORY);
newMandatoryColumn(EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_AGE_CATEGORY_MEANING);
newForeignKeyColumn("baracoudaCode", EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap);
+ newForeignKeyColumn(EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_DATA_QUALITY, DataQuality.class, DataQuality.PROPERTY_QUALITY_DATA_FLAG_VALUES, dataQualityMap);
for (DataMetadata metadata : dataMetadatas) {
String name = metadata.getName();
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportRow.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportRow.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -27,6 +27,7 @@
import fr.ifremer.echobase.csv.EchobaseCsvUtil;
import fr.ifremer.echobase.entities.data.Cell;
import fr.ifremer.echobase.entities.data.Result;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.Species;
import java.util.List;
@@ -48,6 +49,8 @@
public static final String PROPERTY_AGE_CATEGORY_MEANING = "ageCategoryMeaning";
+ public static final String PROPERTY_DATA_QUALITY = "dataQuality";
+
protected Cell cell;
protected List<Result> result = Lists.newArrayList();
@@ -58,6 +61,8 @@
private String ageCategoryMeaning;
+ protected DataQuality dataQuality;
+
public Species getSpecies() {
return species;
}
@@ -98,4 +103,12 @@
public void addResult(Result result) {
this.result.add(result);
}
+
+ public DataQuality getDataQuality() {
+ return dataQuality;
+ }
+
+ public void setDataQuality(DataQuality dataQuality) {
+ this.dataQuality = dataQuality;
+ }
}
\ No newline at end of file
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportModel.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportModel.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -29,6 +29,7 @@
import fr.ifremer.echobase.entities.data.Result;
import fr.ifremer.echobase.entities.data.Voyage;
import fr.ifremer.echobase.entities.references.DataMetadata;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.Species;
import java.util.List;
@@ -46,7 +47,8 @@
"name",
"baracoudaCode",
EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SIZE_CATEGORY,
- EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SIZE_CATEGORY_MEANING
+ EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SIZE_CATEGORY_MEANING,
+ EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_DATA_QUALITY
};
public EsduResultBySpeciesAndSizeCategoryImportModel(
@@ -54,13 +56,15 @@
Map<String, Species> speciesMap,
Voyage voyage,
Map<String, Cell> esduCellMap,
- List<DataMetadata> dataMetadatas) {
+ List<DataMetadata> dataMetadatas,
+ Map<String, DataQuality> dataQualityMap) {
super(separator);
newMandatoryColumn("name", EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, esduCellMap));
newMandatoryColumn(EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SIZE_CATEGORY);
newMandatoryColumn(EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SIZE_CATEGORY_MEANING);
newForeignKeyColumn("baracoudaCode", EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap);
+ newForeignKeyColumn(EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_DATA_QUALITY, DataQuality.class, DataQuality.PROPERTY_QUALITY_DATA_FLAG_VALUES, dataQualityMap);
for (DataMetadata metadata : dataMetadatas) {
String name = metadata.getName();
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportRow.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportRow.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -27,6 +27,7 @@
import fr.ifremer.echobase.csv.EchobaseCsvUtil;
import fr.ifremer.echobase.entities.data.Cell;
import fr.ifremer.echobase.entities.data.Result;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.Species;
import java.util.List;
@@ -48,6 +49,8 @@
public static final String PROPERTY_SIZE_CATEGORY_MEANING = "sizeCategoryMeaning";
+ public static final String PROPERTY_DATA_QUALITY = "dataQuality";
+
protected Cell cell;
protected List<Result> result = Lists.newArrayList();
@@ -58,6 +61,8 @@
private String sizeCategoryMeaning;
+ protected DataQuality dataQuality;
+
public Species getSpecies() {
return species;
}
@@ -98,4 +103,12 @@
public void addResult(Result result) {
this.result.add(result);
}
+
+ public DataQuality getDataQuality() {
+ return dataQuality;
+ }
+
+ public void setDataQuality(DataQuality dataQuality) {
+ this.dataQuality = dataQuality;
+ }
}
\ No newline at end of file
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportModel.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportModel.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -29,6 +29,7 @@
import fr.ifremer.echobase.entities.references.AgeCategory;
import fr.ifremer.echobase.entities.references.CellType;
import fr.ifremer.echobase.entities.references.DataMetadata;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.Species;
@@ -54,7 +55,8 @@
MapCellImportRow.PROPERTY_DATA_GRID_DEPTH_LAG,
MapCellImportRow.PROPERTY_VOYAGE,
MapCellImportRow.PROPERTY_SIZE_CATEGORY,
- MapCellImportRow.PROPERTY_AGE_CATEGORY
+ MapCellImportRow.PROPERTY_AGE_CATEGORY,
+ MapCellImportRow.PROPERTY_DATA_QUALITY
};
protected final CellType cellType;
@@ -65,7 +67,8 @@
Map<String, Species> speciesMap,
Map<String, SizeCategory> sizeCategoryMap,
Map<String, AgeCategory> ageCategoryMap,
- List<DataMetadata> dataMetadatas) {
+ List<DataMetadata> dataMetadatas,
+ Map<String, DataQuality> dataQualityMap) {
super(separator);
this.cellType = cellType;
@@ -74,6 +77,7 @@
newForeignKeyColumn("baracoudaCode", MapCellImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap);
newForeignKeyColumn(MapCellImportRow.PROPERTY_SIZE_CATEGORY, SizeCategory.class, SizeCategory.PROPERTY_NAME, sizeCategoryMap);
newForeignKeyColumn(MapCellImportRow.PROPERTY_AGE_CATEGORY, AgeCategory.class, SizeCategory.PROPERTY_NAME, ageCategoryMap);
+ newForeignKeyColumn(MapCellImportRow.PROPERTY_DATA_QUALITY, DataQuality.class, DataQuality.PROPERTY_QUALITY_DATA_FLAG_VALUES, dataQualityMap);
newMandatoryColumn(MapCellImportRow.PROPERTY_DATA_GRID_CELL_LONGITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);
newMandatoryColumn(MapCellImportRow.PROPERTY_DATA_GRID_CELL_LATITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportRow.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportRow.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -31,6 +31,7 @@
import fr.ifremer.echobase.entities.data.Voyage;
import fr.ifremer.echobase.entities.references.AgeCategory;
import fr.ifremer.echobase.entities.references.CellType;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.Species;
@@ -68,6 +69,8 @@
public static final String PROPERTY_DATA_GRID_DEPTH_LAG = "gridDepthLag";
+ public static final String PROPERTY_DATA_QUALITY = "dataQuality";
+
protected Voyage voyage;
protected final Cell cell;
@@ -80,6 +83,8 @@
protected AgeCategory ageCategory;
+ protected DataQuality dataQuality;
+
protected float gridCellLongitude;
protected float gridCellLatitude;
@@ -193,4 +198,12 @@
public void addResult(Result result) {
this.result.add(result);
}
+
+ public DataQuality getDataQuality() {
+ return dataQuality;
+ }
+
+ public void setDataQuality(DataQuality dataQuality) {
+ this.dataQuality = dataQuality;
+ }
}
\ No newline at end of file
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportModel.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportModel.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -1,44 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata.csv;
-
-import fr.ifremer.echobase.csv.AbstractImportModel;
-
-/**
- * Model to import results of cell of type 'Map'.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class MapCellResultImportModel extends AbstractImportModel<MapCellResultImportRow> {
-
- public MapCellResultImportModel(char separator) {
- super(separator);
- }
-
- @Override
- public MapCellResultImportRow newEmptyInstance() {
- return new MapCellResultImportRow();
- }
-}
\ No newline at end of file
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportRow.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportRow.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -1,33 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata.csv;
-
-/**
- * Bean used as a row for import of {@link MapCellResultImportModel}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class MapCellResultImportRow {
-}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportModel.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportModel.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -27,6 +27,7 @@
import fr.ifremer.echobase.csv.EchobaseCsvUtil;
import fr.ifremer.echobase.entities.data.Voyage;
import fr.ifremer.echobase.entities.references.CellType;
+import fr.ifremer.echobase.entities.references.DataQuality;
import java.util.Map;
@@ -40,11 +41,13 @@
public RegionCellImportModel(char separator,
Map<String, Voyage> voyageMap,
- Map<String, CellType> cellTypeMap) {
+ Map<String, CellType> cellTypeMap,
+ Map<String, DataQuality> dataQualityMap) {
super(separator);
newForeignKeyColumn(RegionCellImportRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, voyageMap);
newForeignKeyColumn(RegionCellImportRow.PROPERTY_CELL_TYPE, CellType.class, CellType.PROPERTY_ID, cellTypeMap);
+ newForeignKeyColumn(RegionCellImportRow.PROPERTY_DATA_QUALITY, DataQuality.class, DataQuality.PROPERTY_QUALITY_DATA_FLAG_VALUES, dataQualityMap);
newMandatoryColumn(RegionCellImportRow.PROPERTY_NAME);
newMandatoryColumn("regionEnvCoordinates", RegionCellImportRow.PROPERTY_DATA_COORDINATE);
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportRow.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportRow.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -25,6 +25,7 @@
import fr.ifremer.echobase.entities.data.Voyage;
import fr.ifremer.echobase.entities.references.CellType;
+import fr.ifremer.echobase.entities.references.DataQuality;
/**
* Bean used as a row for import of {@link RegionCellImportModel}.
@@ -44,10 +45,14 @@
public static final String PROPERTY_DATA_SURFACE = "dataSurface";
+ public static final String PROPERTY_DATA_QUALITY = "dataQuality";
+
protected Voyage voyage;
protected CellType cellType;
+ protected DataQuality dataQuality;
+
protected String name;
protected String dataCoordinate;
@@ -96,4 +101,12 @@
public void setDataSurface(float dataSurface) {
this.dataSurface = dataSurface;
}
+
+ public DataQuality getDataQuality() {
+ return dataQuality;
+ }
+
+ public void setDataQuality(DataQuality dataQuality) {
+ this.dataQuality = dataQuality;
+ }
}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportModel.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportModel.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -29,6 +29,7 @@
import fr.ifremer.echobase.entities.data.Echotype;
import fr.ifremer.echobase.entities.data.Voyage;
import fr.ifremer.echobase.entities.references.DataMetadata;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.Species;
@@ -48,7 +49,8 @@
"baracoudaCode",
RegionCellResultImportRow.PROPERTY_VOYAGE,
RegionCellResultImportRow.PROPERTY_SIZE_CATEGORY,
- RegionCellResultImportRow.PROPERTY_ECHOTYPE
+ RegionCellResultImportRow.PROPERTY_ECHOTYPE,
+ RegionCellResultImportRow.PROPERTY_DATA_QUALITY
};
public RegionCellResultImportModel(
@@ -58,7 +60,8 @@
Map<String, Echotype> echotypeMap,
Map<String, Species> speciesMap,
Map<String, SizeCategory> sizeCategoryMap,
- List<DataMetadata> dataMetadatas) {
+ List<DataMetadata> dataMetadatas,
+ Map<String, DataQuality> dataQualityMap) {
super(separator);
newForeignKeyColumn(RegionCellResultImportRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, voyageMap);
@@ -66,6 +69,7 @@
newForeignKeyColumn(RegionCellResultImportRow.PROPERTY_ECHOTYPE, Echotype.class, Echotype.PROPERTY_NAME, echotypeMap);
newForeignKeyColumn("baracoudaCode", RegionCellResultImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap);
newForeignKeyColumn(RegionCellResultImportRow.PROPERTY_SIZE_CATEGORY, SizeCategory.class, SizeCategory.PROPERTY_NAME, sizeCategoryMap);
+ newForeignKeyColumn(RegionCellResultImportRow.PROPERTY_DATA_QUALITY, DataQuality.class, DataQuality.PROPERTY_QUALITY_DATA_FLAG_VALUES, dataQualityMap);
for (DataMetadata metadata : dataMetadatas) {
newMandatoryColumn(
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportRow.java 2012-03-30 16:46:14 UTC (rev 460)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportRow.java 2012-03-30 19:36:14 UTC (rev 461)
@@ -29,6 +29,7 @@
import fr.ifremer.echobase.entities.data.Echotype;
import fr.ifremer.echobase.entities.data.Result;
import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.DataQuality;
import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.Species;
@@ -54,6 +55,8 @@
public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory";
+ public static final String PROPERTY_DATA_QUALITY = "dataQuality";
+
protected Voyage voyage;
protected Echotype echotype;
@@ -66,6 +69,8 @@
protected SizeCategory sizeCategory;
+ protected DataQuality dataQuality;
+
public Echotype getEchotype() {
return echotype;
}
@@ -114,4 +119,12 @@
public void setVoyage(Voyage voyage) {
this.voyage = voyage;
}
+
+ public DataQuality getDataQuality() {
+ return dataQuality;
+ }
+
+ public void setDataQuality(DataQuality dataQuality) {
+ this.dataQuality = dataQuality;
+ }
}
Modified: trunk/echobase-services/src/test/resources/import-data/acoustic/movies.csv.gz
===================================================================
(Binary files differ)
Modified: trunk/echobase-services/src/test/resources/import-data/result/esdu/byEchotype.csv.gz
===================================================================
(Binary files differ)
Modified: trunk/echobase-services/src/test/resources/import-data/result/esdu/byEchotypeAndSpeciesCategory.csv.gz
===================================================================
(Binary files differ)
Modified: trunk/echobase-services/src/test/resources/import-data/result/esdu/bySpeciesAndAgeCategory.csv.gz
===================================================================
(Binary files differ)
Modified: trunk/echobase-services/src/test/resources/import-data/result/esdu/bySpeciesAndSizeCategory.csv.gz
===================================================================
(Binary files differ)
Modified: trunk/echobase-services/src/test/resources/import-data/result/map/maps.csv.gz
===================================================================
(Binary files differ)
Modified: trunk/echobase-services/src/test/resources/import-data/result/region/regionResults.csv.gz
===================================================================
(Binary files differ)
Modified: trunk/echobase-services/src/test/resources/import-data/result/region/regions.csv.gz
===================================================================
(Binary files differ)
1
0
30 Mar '12
Author: tchemit
Date: 2012-03-30 18:46:14 +0200 (Fri, 30 Mar 2012)
New Revision: 460
Url: http://forge.codelutin.com/repositories/revision/echobase/460
Log:
fixes #1054: Mettre un champs de description de l'import et l'inclure dans le journal des modifications + uniformisation des noms d'imports + refs #1016 (css)
Added:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportMode.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportMode.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportRow.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticImportServiceIT.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesImportServiceIT.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/Common2ImportServiceIT.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonImportServiceIT.java
trunk/echobase-services/src/test/resources/import-data/acoustic/
trunk/echobase-services/src/test/resources/import-data/catches/
trunk/echobase-services/src/test/resources/import-data/common/
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesImport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonImport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperationImport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResultsImport.java
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeAll-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeTransect-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeEsdu-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeMap-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeRegion-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeVoyage-validation.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperationImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResultsImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAcousticImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperationImport.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResultsImport.jsp
Removed:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportDataMode.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportRow.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticDataImportServiceIT.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesDataImportServiceIT.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonData2ImportServiceIT.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonDataImportServiceIT.java
trunk/echobase-services/src/test/resources/import-data/acousticData/
trunk/echobase-services/src/test/resources/import-data/catchesData/
trunk/echobase-services/src/test/resources/import-data/commonData/
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsdu-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeMap-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeRegion-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp
Modified:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsVoyageImportService.java
trunk/echobase-services/src/main/resources/i18n/echobase-services_en_GB.properties
trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java
trunk/echobase-services/src/test/resources/log4j.properties
trunk/echobase-services/update-import-data-db.sh
trunk/echobase-ui/pom.xml
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/CreateMission.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectImportType.java
trunk/echobase-ui/src/main/resources/config/struts-importData.xml
trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
trunk/echobase-ui/src/main/resources/struts.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/includes/importDataResults.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/selectImportType.jsp
trunk/echobase-ui/src/main/webapp/css/screen.css
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportConfiguration.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -23,11 +23,16 @@
*/
package fr.ifremer.echobase.services.importdata;
+import com.google.common.collect.Lists;
import fr.ifremer.echobase.EchoBaseIOUtil;
import fr.ifremer.echobase.InputFile;
+import fr.ifremer.echobase.csv.CsvFileImportResult;
+import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
import fr.ifremer.echobase.services.AbstractEchobaseActionConfiguration;
import java.io.File;
+import java.util.List;
+import java.util.Set;
/**
* Common import data configuration.
@@ -39,8 +44,16 @@
private static final long serialVersionUID = 1L;
+ /** Directory where to store temporary files. */
protected File workingDirectory;
+ /** Notes about this import to add in log book. */
+ protected String importNotes;
+
+ /** Result stats for each file imported. (mainly kept for testing purpose). */
+ protected final List<CsvFileImportResult> importResults =
+ Lists.newArrayList();
+
public File getWorkingDirectory() {
return workingDirectory;
}
@@ -49,8 +62,22 @@
this.workingDirectory = workingDirectory;
}
+ public String getImportNotes() {
+ return importNotes;
+ }
+
+ public void setImportNotes(String importNotes) {
+ this.importNotes = importNotes;
+ }
+
+ public List<CsvFileImportResult> getImportResults() {
+ return importResults;
+ }
+
+ /** @return all the input files defined for the import (some can be empty). */
public abstract InputFile[] getInputFiles();
+ /** @return the number of lines to imports from all the import files. */
public long computeNbSteps() {
long result = 0;
for (InputFile inputFile : getInputFiles()) {
@@ -64,4 +91,11 @@
setNbSteps(result);
return result;
}
+
+ public void addResult(CsvFileImportResult fileResult) {
+ Set<EchoBaseEntityEnum> entityTypes = fileResult.getEntityTypes();
+ if (!entityTypes.isEmpty()) {
+ importResults.add(fileResult);
+ }
+ }
}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -51,11 +51,13 @@
import fr.ifremer.echobase.entities.references.SpeciesCategoryDAO;
import fr.ifremer.echobase.services.EchoBaseServiceSupport;
import fr.ifremer.echobase.services.ImportException;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.persistence.TopiaDAO;
import org.nuiton.topia.persistence.TopiaEntity;
+import org.nuiton.util.StringUtil;
import org.nuiton.util.TimeLog;
import org.nuiton.util.csv.ImportRuntimeException;
@@ -68,7 +70,6 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -93,8 +94,8 @@
new TimeLog(AbstractImportDataService.class);
- public final List<CsvFileImportResult> doImport(M configuration,
- EchoBaseUser user) throws ImportException {
+ public final String doImport(M configuration,
+ EchoBaseUser user) throws ImportException {
long s0 = TimeLog.getTime();
@@ -107,67 +108,79 @@
TIME_LOG.log(s0, "computeNbSteps");
try {
- List<CsvFileImportResult> result = startImport(configuration, user);
+ startImport(configuration, user);
+ // add result in log book and compute resume to show in result
+ String result = computeResultAndLogBookEntry(configuration,
+ user,
+ TimeLog.getTime() - s0);
+
// do commit
commitTransaction("Could not execute import " + getImportLabel());
return result;
} catch (ImportException e) {
throw e;
- } catch (Exception e) {
- throw new ImportException(
- "Could not do import " + e.getMessage(), e);
+ } catch (EchoBaseTechnicalException e) {
+ throw new ImportException(e.getMessage(), e);
}
}
- protected abstract String getImportLabel();
+ protected String computeResultAndLogBookEntry(M configuration,
+ EchoBaseUser user,
+ long time) {
- protected abstract List<CsvFileImportResult> startImport(M configuration,
- EchoBaseUser user) throws ImportException;
+ String importType = getImportLabel();
- protected void addResultAndLog(List<CsvFileImportResult> result,
- InputFile inputFile,
- CsvFileImportResult importResult,
- EchoBaseUser user) {
+ StringBuilder buffer = new StringBuilder();
- Set<EchoBaseEntityEnum> entityTypes = importResult.getEntityTypes();
- if (!entityTypes.isEmpty()) {
+ buffer.append(importType);
+ if (StringUtils.isNotEmpty(configuration.getImportNotes())) {
+ buffer.append("\nNotes :").append(configuration.getImportNotes());
+ }
+ buffer.append('\n');
+ buffer.append("Import réalisé en ");
+ buffer.append(StringUtil.convertTime(time));
- result.add(importResult);
+ for (CsvFileImportResult importResult : configuration.getImportResults()) {
- String importType = getImportLabel();
-
StringBuilder description = new StringBuilder();
- description.append("Depuis Fichier ").append(inputFile.getFileName());
- TopiaDAO<EntityModificationLog> dao =
- getDAO(EntityModificationLog.class);
+ description.append("Depuis Fichier ").append(importResult.getImportFileName());
- for (EchoBaseEntityEnum entityType : entityTypes) {
+ for (EchoBaseEntityEnum entityType : importResult.getEntityTypes()) {
int numberCreated = importResult.getNumberCreated(entityType);
int numberUpdated = importResult.getNumberUpdated(entityType);
+ description.append("\n\tEntité ").append(entityType);
if (numberCreated > 0) {
- description.append(" [ nombre de création : ");
+ description.append(" [nombre de création : ");
description.append(numberCreated);
description.append("]");
}
if (numberUpdated > 0) {
- description.append(" [ nombre de mises à jour : ");
+ description.append(" [nombre de mises à jour : ");
description.append(numberUpdated);
description.append("]");
}
-
- create(dao,
- EntityModificationLog.PROPERTY_ENTITY_TYPE, entityType.name(),
- EntityModificationLog.PROPERTY_ENTITY_ID, importType,
- EntityModificationLog.PROPERTY_MODIFICATION_USER, user.getEmail(),
- EntityModificationLog.PROPERTY_MODIFICATION_DATE, newDate(),
- EntityModificationLog.PROPERTY_MODIFICATION_TEXT, description.toString()
- );
}
+ buffer.append('\n').append(description.toString());
+ }
- }
+ String result = buffer.toString();
+
+ create(getDAO(EntityModificationLog.class),
+ EntityModificationLog.PROPERTY_ENTITY_TYPE, "Import",
+ EntityModificationLog.PROPERTY_ENTITY_ID, importType,
+ EntityModificationLog.PROPERTY_MODIFICATION_USER, user.getEmail(),
+ EntityModificationLog.PROPERTY_MODIFICATION_DATE, newDate(),
+ EntityModificationLog.PROPERTY_MODIFICATION_TEXT, result
+ );
+ return result;
}
+ protected abstract String getImportLabel();
+
+ protected abstract void startImport(M configuration,
+ EchoBaseUser user) throws ImportException;
+
protected Reader getInputFileReader(InputFile inputFile) throws EchoBaseTechnicalException {
try {
Reader reader = new BufferedReader(new InputStreamReader(
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,267 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata;
-
-import fr.ifremer.echobase.InputFile;
-
-import java.util.Locale;
-
-import static org.nuiton.i18n.I18n.l_;
-
-/**
- * Configuration of a "accoustic datas" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class AcousticDataImportConfiguration extends AbstractImportConfiguration {
-
- private static final long serialVersionUID = 1L;
-
- /** Selected voyage id where to import datas. */
- protected String voyageId;
-
- /** Selected vessel id to find out transect where to import datas. */
- protected String vesselId;
-
- /** Flag to always add new dataAcquisition when a new instrument is found in movies file. */
- protected boolean addDataAcquisition = true;
-
- /** Manual transceiverAcquisitionAbsorptionDescription. */
- protected String transceiverAcquisitionAbsorptionDescription = "(i) Equation: Francois and garrison 1982,(ii) CTD, (iii) nominal value for entire data set";
-
- /** Manual acquisitionSoftwareVersion (ER60 instrument). */
- protected String acquisitionSoftwareVersionER60;
-
- /** Manual acquisitionSoftwareVersion (ME70 instrument). */
- protected String acquisitionSoftwareVersionME70;
-
- /** Manual loggedDataFormat. */
- protected String loggedDataFormat = ".hac and .raw formats";
-
- /** Manual loggedDataDatatype. */
- protected String loggedDataDatatype = "‘raw’ digitisation samples";
-
- /** Manual pingDutyCycle. */
- protected String pingDutyCycle = "Ifremer's standard ping duty cycle";
-
-// /** Manual echosounderSoundSpeed. */
-// protected String echosounderSoundSpeed = "Variable";
-
- /** Manual soundSpeedCalculations (ER60 instrument). */
- protected String soundSpeedCalculationsER60 = "(i) Equation: Mackenzie (1980), (ii) CTD, (iii) nominal value for entire data set";
-
- /** Manual soundSpeedCalculations (ME70 instrument). */
- protected String soundSpeedCalculationsME70 = "(i) Equation: Mackenzie (1980), (ii) Hull-mounted thermosalinometer, (iii) surface absorption value recomputed every 30s and applied to the entire data set";
-
- /** Manual sounderConstant. */
- protected String sounderConstant = "NA";
-
- /** Manual processingTemplate. */
- protected String processingTemplate;
-
- /** Manual processingDescription. */
- protected String processingDescription;
-
- /** Manual digitThreshold. */
- protected float digitThreshold = -100f;
-
- /** Manual acousticDensityUnit. */
- protected String acousticDensityUnit = "sA";
-
- /** Manual notes. */
- protected String notes;
-
- /** Cell position reference for esdu cell datas. */
- protected CellPositionReference cellPositionReference;
-
- /** Movies file to import. */
- protected final InputFile moviesFile;
-
-
- public AcousticDataImportConfiguration(Locale locale) {
- moviesFile = InputFile.newFile(l_(locale, "echobase.common.moviesFile"));
- }
-
- public String getVoyageId() {
- return voyageId;
- }
-
- public void setVoyageId(String voyageId) {
- this.voyageId = voyageId;
- }
-
- public String getVesselId() {
- return vesselId;
- }
-
- public void setVesselId(String vesselId) {
- this.vesselId = vesselId;
- }
-
- public boolean isAddDataAcquisition() {
- return addDataAcquisition;
- }
-
- public void setAddDataAcquisition(boolean addDataAcquisition) {
- this.addDataAcquisition = addDataAcquisition;
- }
-
- public String getTransceiverAcquisitionAbsorptionDescription() {
- return transceiverAcquisitionAbsorptionDescription;
- }
-
- public void setTransceiverAcquisitionAbsorptionDescription(String transceiverAcquisitionAbsorptionDescription) {
- this.transceiverAcquisitionAbsorptionDescription = transceiverAcquisitionAbsorptionDescription;
- }
-
- public String getAcquisitionSoftwareVersionER60() {
- return acquisitionSoftwareVersionER60;
- }
-
- public void setAcquisitionSoftwareVersionER60(String acquisitionSoftwareVersionER60) {
- this.acquisitionSoftwareVersionER60 = acquisitionSoftwareVersionER60;
- }
-
- public String getAcquisitionSoftwareVersionME70() {
- return acquisitionSoftwareVersionME70;
- }
-
- public void setAcquisitionSoftwareVersionME70(String acquisitionSoftwareVersionME70) {
- this.acquisitionSoftwareVersionME70 = acquisitionSoftwareVersionME70;
- }
-
- public String getLoggedDataFormat() {
- return loggedDataFormat;
- }
-
- public void setLoggedDataFormat(String loggedDataFormat) {
- this.loggedDataFormat = loggedDataFormat;
- }
-
- public String getLoggedDataDatatype() {
- return loggedDataDatatype;
- }
-
- public void setLoggedDataDatatype(String loggedDataDatatype) {
- this.loggedDataDatatype = loggedDataDatatype;
- }
-
- public String getPingDutyCycle() {
- return pingDutyCycle;
- }
-
- public void setPingDutyCycle(String pingDutyCycle) {
- this.pingDutyCycle = pingDutyCycle;
- }
-
-// public String getEchosounderSoundSpeed() {
-// return echosounderSoundSpeed;
-// }
-//
-// public void setEchosounderSoundSpeed(String echosounderSoundSpeed) {
-// this.echosounderSoundSpeed = echosounderSoundSpeed;
-// }
-
- public String getSoundSpeedCalculationsER60() {
- return soundSpeedCalculationsER60;
- }
-
- public void setSoundSpeedCalculationsER60(String soundSpeedCalculationsER60) {
- this.soundSpeedCalculationsER60 = soundSpeedCalculationsER60;
- }
-
- public String getSoundSpeedCalculationsME70() {
- return soundSpeedCalculationsME70;
- }
-
- public void setSoundSpeedCalculationsME70(String soundSpeedCalculationsME70) {
- this.soundSpeedCalculationsME70 = soundSpeedCalculationsME70;
- }
-
- public String getSounderConstant() {
- return sounderConstant;
- }
-
- public void setSounderConstant(String sounderConstant) {
- this.sounderConstant = sounderConstant;
- }
-
- public float getDigitThreshold() {
- return digitThreshold;
- }
-
- public void setDigitThreshold(float digitThreshold) {
- this.digitThreshold = digitThreshold;
- }
-
- public String getAcousticDensityUnit() {
- return acousticDensityUnit;
- }
-
- public void setAcousticDensityUnit(String acousticDensityUnit) {
- this.acousticDensityUnit = acousticDensityUnit;
- }
-
- public String getNotes() {
- return notes;
- }
-
- public void setNotes(String notes) {
- this.notes = notes;
- }
-
- public InputFile getMoviesFile() {
- return moviesFile;
- }
-
- public String getProcessingTemplate() {
- return processingTemplate;
- }
-
- public void setProcessingTemplate(String processingTemplate) {
- this.processingTemplate = processingTemplate;
- }
-
- public String getProcessingDescription() {
- return processingDescription;
- }
-
- public void setProcessingDescription(String processingDescription) {
- this.processingDescription = processingDescription;
- }
-
- public CellPositionReference getCellPositionReference() {
- return cellPositionReference;
- }
-
- public void setCellPositionReference(CellPositionReference cellPositionReference) {
- this.cellPositionReference = cellPositionReference;
- }
-
- @Override
- public InputFile[] getInputFiles() {
- return new InputFile[]{moviesFile};
- }
-}
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportService.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportService.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,743 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-import fr.ifremer.echobase.EchoBaseFunctions;
-import fr.ifremer.echobase.EchoBasePredicates;
-import fr.ifremer.echobase.InputFile;
-import fr.ifremer.echobase.csv.CsvFileImportResult;
-import fr.ifremer.echobase.csv.EchoBaseImport;
-import fr.ifremer.echobase.csv.EchobaseCsvUtil;
-import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
-import fr.ifremer.echobase.entities.EchoBaseUser;
-import fr.ifremer.echobase.entities.data.Cell;
-import fr.ifremer.echobase.entities.data.CellDAO;
-import fr.ifremer.echobase.entities.data.Data;
-import fr.ifremer.echobase.entities.data.DataAcquisition;
-import fr.ifremer.echobase.entities.data.DataAcquisitionDAO;
-import fr.ifremer.echobase.entities.data.DataDAO;
-import fr.ifremer.echobase.entities.data.DataProcessing;
-import fr.ifremer.echobase.entities.data.DataProcessingDAO;
-import fr.ifremer.echobase.entities.data.Transect;
-import fr.ifremer.echobase.entities.data.Transit;
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.entities.references.AcousticInstrument;
-import fr.ifremer.echobase.entities.references.CellType;
-import fr.ifremer.echobase.entities.references.DataMetadata;
-import fr.ifremer.echobase.entities.references.Vessel;
-import fr.ifremer.echobase.services.ImportException;
-import fr.ifremer.echobase.services.importdata.csv.AcousticDataImportModel;
-import fr.ifremer.echobase.services.importdata.csv.AcousticDataImportRow;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.util.csv.Import;
-import org.nuiton.util.csv.ImportRuntimeException;
-
-import java.io.Reader;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import static org.nuiton.i18n.I18n.l_;
-
-/**
- * Service to launch a "acoustic data" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class AcousticDataImportService extends AbstractImportDataService<AcousticDataImportConfiguration> {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(AcousticDataImportService.class);
-
- @Override
- protected String getImportLabel() {
- return l_(getLocale(), ImportDataMode.AccousticData.getI18nKey());
- }
-
- @Override
- protected List<CsvFileImportResult> startImport(
- AcousticDataImportConfiguration configuration,
- EchoBaseUser user) throws ImportException {
-
- List<CsvFileImportResult> result = Lists.newLinkedList();
-
- // get selected voyage
- Voyage voyage = getEntityById(Voyage.class,
- configuration.getVoyageId());
-
- // get selected vessel
- Vessel vessel = getEntityById(Vessel.class,
- configuration.getVesselId());
-
- CellType esduCellType = getEntityByProperty(
- CellType.class, CellType.PROPERTY_ID, "Esdu");
- Preconditions.checkNotNull(esduCellType);
-
- CellType elementaryCellType = getEntityByProperty(
- CellType.class, CellType.PROPERTY_ID, "Elementary");
- Preconditions.checkNotNull(elementaryCellType);
-
- InputFile inputFile = configuration.getMoviesFile();
-
- CsvFileImportResult importResult = importMoviesFile(configuration,
- voyage,
- vessel,
- esduCellType,
- elementaryCellType,
- inputFile);
-
- addResultAndLog(result, inputFile, importResult, user);
- return result;
- }
-
- private final DateFormat cellDateFormat = new SimpleDateFormat(
- EchobaseCsvUtil.CELLULE_DATE_FORMAT);
-
-
- private DataAcquisition getDataAcquisition(Transect transect,
- AcousticInstrument instrument,
- boolean addDataAcquisition) throws ImportException {
-
-
- DataAcquisition result = null;
- if (!addDataAcquisition &&
- !transect.isDataAcquisitionEmpty()) {
-
- // try to obtain an existing data acquisiton
-
- for (DataAcquisition acquisition : transect.getDataAcquisition()) {
-
- if (instrument.equals(acquisition.getAcousticInstrument())) {
-
- // found a matching dataAcquisition from his acoustic instrument
- result = acquisition;
- break;
- }
- }
- }
- return result;
- }
-
- private CsvFileImportResult importMoviesFile(AcousticDataImportConfiguration configuration,
- Voyage voyage,
- Vessel vessel,
- CellType esduCellType,
- CellType elementaryCellType,
- InputFile inputFile
- ) throws ImportException {
-
- CsvFileImportResult importResult = new CsvFileImportResult(
- inputFile.getFileName());
-
- Map<String, AcousticInstrument> instrumentsById =
- getEntitiesMap(AcousticInstrument.class,
- EchoBaseFunctions.ACOUSTIC_INSTRUMENT_ID);
-
- Map<String, DataMetadata> dataMetadatasByName = getEntitiesMap(
- DataMetadata.class, EchoBaseFunctions.DATA_METADATA_NAME);
-
- AcousticDataImportModel csvModel = new AcousticDataImportModel(
- getCsvSeparator(), instrumentsById);
-
- DataAcquisitionDAO dataAcquisitionDAO =
- getDAO(DataAcquisition.class, DataAcquisitionDAO.class);
- DataProcessingDAO dataProcessingDAO =
- getDAO(DataProcessing.class, DataProcessingDAO.class);
- CellDAO cellDAO = getDAO(Cell.class, CellDAO.class);
- DataDAO dataDAO = getDAO(Data.class, DataDAO.class);
-
- boolean addDataAcquisition = configuration.isAddDataAcquisition();
-
- String suffix =
- configuration.getCellPositionReference().getMetadataNameSuffix();
-
- List<Cell> elementaryCells = Lists.newArrayList();
-
- Reader reader = getInputFileReader(inputFile);
- Locale locale = getLocale();
- String dataProcessingId = null;
- try {
- Import<AcousticDataImportRow> importer =
- EchoBaseImport.newImport(csvModel, reader);
- DataAcquisition dataAcquisition = null;
- DataProcessing dataProcessing = null;
-
- Cell elementaryCell;
- int rowNumber = 0;
-
- configuration.incrementsProgression();
- for (AcousticDataImportRow row : importer) {
-
- configuration.incrementsProgression();
- rowNumber++;
-
- if (rowNumber % 100 == 0) {
- if (log.isInfoEnabled()) {
- log.info("Doing line " + rowNumber);
- }
- }
- if (dataProcessingId == null) {
-
- // compute once for all the common dataprocessing id used
- // for hole the movies file
- dataProcessingId = row.getEiLayer() +
- configuration.getProcessingTemplate();
- }
-
- Date startDate = row.getCellDateStart();
-
- // get transect to use
- Transit transit = voyage.getTransit(startDate);
- if (transit == null) {
-
- // can not find correct transit
- throw new ImportException(
- l_(locale, "echobase.importError.transit.notfound",
- voyage.getName(),
- startDate,
- rowNumber));
- }
-
- Transect transect = transit.getTransect(vessel);
- if (transect == null) {
-
- // can not find correct transect
- throw new ImportException(
- l_(locale, "echobase.importError.transect.notfound",
- voyage.getName(),
- startDate,
- vessel.getName(),
- rowNumber));
- }
-
- AcousticInstrument instrument = row.getAcousticInstrument();
- boolean isME70 =
- EchoBasePredicates.IS_ACOUSTIC_INSTRUMENT_ME70.apply(instrument);
-
- if (dataAcquisition == null ||
- !instrument.equals(dataAcquisition.getAcousticInstrument())) {
-
- // need to use another data acquisition
-
- if (log.isDebugEnabled()) {
- log.debug("[row " + rowNumber + "] New instrument to use (" + instrument.getId() + ")");
- }
-
- if (CollectionUtils.isNotEmpty(elementaryCells)) {
-
- // means miss a esdu cell
- // can not find correct transect
- throw new ImportException(
- l_(locale, "echobase.importError.esduCell.notfound",
- voyage.getName(),
- vessel.getName(),
- instrument.getId(),
- rowNumber));
- }
-
- String softwareVersion =
- getSoftwareVersion(configuration, isME70);
-
- String soundSpeedCalculations =
- getSoundSpeedCalculations(configuration, isME70);
-
- // try to get existing data acquisition
- dataAcquisition = getDataAcquisition(
- transect,
- instrument,
- addDataAcquisition
- );
-
- if (dataAcquisition == null) {
-
- // need to create the data acquisition
- dataAcquisition = createDataAcquisition(
- configuration,
- instrument,
- softwareVersion,
- soundSpeedCalculations,
- row,
- dataAcquisitionDAO
- );
-
- // add dataAcquisition to transect
- transect.addDataAcquisition(dataAcquisition);
-
- // count creation in result
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.DataAcquisition);
-
- if (log.isDebugEnabled()) {
- log.debug("[row " + rowNumber +
- "] New dataAquisition to use (number: " +
- importResult.getNumberCreated(
- EchoBaseEntityEnum.DataAcquisition) + ")");
- }
-
- // create data processing
- dataProcessing = createDataProcessing(
- configuration,
- dataProcessingId,
- softwareVersion,
- soundSpeedCalculations,
- row,
- dataProcessingDAO
- );
-
- if (log.isDebugEnabled()) {
- log.debug("[row " + rowNumber +
- "] New dataProcessing to use (" +
- dataProcessing.getId() + ")");
- }
-
- importResult.incrementsNumberCreated(
- EchoBaseEntityEnum.DataProcessing);
-
- // add it to data acquisition
- dataAcquisition.addDataProcessing(dataProcessing);
- }
- }
-
- if (!row.isCellToAdd()) {
-
- // dead cell not to be imported
- if (log.isWarnEnabled()) {
- log.warn("Will not import cell of row " + rowNumber);
- }
- continue;
- }
-
- int cellType = row.getCellType();
-
- String esduCellId = cellDateFormat.format(startDate);
-
- if (cellType == 4) {
-
- if (log.isDebugEnabled()) {
- log.debug("[row " + rowNumber + "] Esdu cell (" +
- esduCellId + ")");
- }
-
- // this is a esdu cell row
-
- // create esdu cell
- Cell esduCell = create(cellDAO,
- Cell.PROPERTY_CELL_TYPE, esduCellType,
- Cell.PROPERTY_NAME, esduCellId
- );
-
- // add all found elementary cells
- esduCell.addAllChilds(elementaryCells);
-
- // clear elementary cells
- elementaryCells.clear();
-
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.Cell);
-
- // add it to data processing
- dataProcessing.addCell(esduCell);
-
- // create esdu cell data
- createEsduCellData(suffix,
- esduCell,
- dataMetadatasByName,
- row,
- dataDAO,
- importResult);
- } else {
-
- // this is a elementary cell row
-
- int cellNum = row.getCellNum();
-
- boolean surface = cellType == 0;
-
- String elementaryCellId = cellNum + (surface ? "S" : "B");
-
- if (log.isDebugEnabled()) {
- log.debug("[row " + rowNumber + "] elementary cell (" +
- elementaryCellId + ")");
- }
-
- // create the elementary cell
- elementaryCell = create(cellDAO,
- Cell.PROPERTY_CELL_TYPE, elementaryCellType,
- Cell.PROPERTY_NAME, elementaryCellId
- );
-
- // keep (to attach them to esdu cell)
- elementaryCells.add(elementaryCell);
-
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.Cell);
-
- // create datas of the elementary cell
- createElementaryCellData(suffix,
- elementaryCell,
- dataMetadatasByName,
- surface,
- row,
- dataDAO,
- importResult);
- }
- }
-
- return importResult;
- } catch (ImportRuntimeException e) {
- throw new ImportException(locale, inputFile, e);
- } finally {
- closeReader(reader, inputFile);
- }
- }
-
- protected void createEsduCellData(String suffix,
- Cell cell,
- Map<String, DataMetadata> dataMetadatas,
- AcousticDataImportRow row,
- DataDAO dao,
- CsvFileImportResult importResult) {
-
- String dataValue;
-
- // create Latitude data
- dataValue = String.valueOf(row.getCellLatitude());
- createCellData(dao, cell, dataMetadatas, "Latitude" + suffix,
- dataValue, importResult);
-
- // create Longitude data
- dataValue = String.valueOf(row.getCellLongitude());
- createCellData(dao, cell, dataMetadatas, "Longitude" + suffix,
- dataValue, importResult);
-
- // create Depth data
- dataValue = row.getEsduCellDataDepth();
- createCellData(dao, cell, dataMetadatas, "DepthRefSurface" + suffix,
- dataValue, importResult);
-
- // create Time Start data
- dataValue = cellDateFormat.format(row.getCellDateStart());
- createCellData(dao, cell, dataMetadatas, "TimeStart",
- dataValue, importResult);
-
- // create Time end data
- dataValue = cellDateFormat.format(row.getCellDateEnd());
- createCellData(dao, cell, dataMetadatas, "TimeEnd",
- dataValue, importResult);
-
- // create NASC data
- if (row.getCellNasc() != null) {
- dataValue = String.valueOf(row.getCellNasc());
- createCellData(dao, cell, dataMetadatas, "NASC",
- dataValue, importResult);
- }
-
- // create Volume data
- if (row.getCellVolume() != null) {
- dataValue = String.valueOf(row.getCellVolume());
- createCellData(dao, cell, dataMetadatas, "Volume ",
- dataValue, importResult);
- }
- // create Surface data
- dataValue = String.valueOf(row.getCellSurface());
- createCellData(dao, cell, dataMetadatas, "Surface",
- dataValue, importResult);
-
- // create NumberOfSamplesRecorded data
- if (row.getCellNumberOfSamplesRecorded() != null) {
- dataValue = String.valueOf(row.getCellNumberOfSamplesRecorded());
- createCellData(dao, cell, dataMetadatas, "NumberOfSamplesRecorded",
- dataValue, importResult);
- }
- // create NumberOfSamplesEchoIntegrated data
- if (row.getCellNumberOfSamplesEchoIntegrated() != null) {
- dataValue = String.valueOf(row.getCellNumberOfSamplesEchoIntegrated());
- createCellData(dao, cell, dataMetadatas, "NumberOfSamplesEchoIntegrated",
- dataValue, importResult);
- }
- }
-
- private void createElementaryCellData(String suffix,
- Cell cell,
- Map<String, DataMetadata> dataMetadatas,
- boolean surface,
- AcousticDataImportRow row,
- DataDAO dao,
- CsvFileImportResult importResult) {
-
- String dataValue;
- String startMeta;
- String endMeta;
-
- if (surface) {
-
- // surface
-
- startMeta = "DepthRefSurfaceStart";
- endMeta = "DepthRefSurfaceEnd";
-
- } else {
-
- // bottom
-
- startMeta = "DepthRefBottomStart";
- endMeta = "DepthRefBottomEnd";
- }
-
- // create Latitude data
- dataValue = String.valueOf(row.getCellLatitude());
- createCellData(dao, cell, dataMetadatas, "Latitude" + suffix,
- dataValue, importResult);
-
- // create Longitude data
- dataValue = String.valueOf(row.getCellLongitude());
- createCellData(dao, cell, dataMetadatas, "Longitude" + suffix,
- dataValue, importResult);
-
- // create depth start data
- dataValue = String.valueOf(row.getCellDepthStart());
- createCellData(dao, cell, dataMetadatas, startMeta, dataValue, importResult);
-
- // create depth end data
- dataValue = String.valueOf(row.getCellDepthEnd());
- createCellData(dao, cell, dataMetadatas, endMeta, dataValue, importResult);
-
-
- // create Time Start data
- dataValue = cellDateFormat.format(row.getCellDateStart());
- createCellData(dao, cell, dataMetadatas, "TimeStart",
- dataValue, importResult);
-
- // create Time end data
- dataValue = cellDateFormat.format(row.getCellDateEnd());
- createCellData(dao, cell, dataMetadatas, "TimeEnd",
- dataValue, importResult);
-
- // create acoustic density data
- if (row.getCellNasc() != null) {
- dataValue = String.valueOf(row.getCellNasc());
- createCellData(dao, cell, dataMetadatas, "NASC", dataValue, importResult);
- }
- // create Volume data
- if (row.getCellVolume() != null) {
- dataValue = String.valueOf(row.getCellVolume());
- createCellData(dao, cell, dataMetadatas, "Volume ",
- dataValue, importResult);
- }
- // create Surface data
- dataValue = String.valueOf(row.getCellSurface());
- createCellData(dao, cell, dataMetadatas, "Surface",
- dataValue, importResult);
-
- // create NumberOfSamplesRecorded data
- if (row.getCellNumberOfSamplesRecorded() != null) {
- dataValue = String.valueOf(row.getCellNumberOfSamplesRecorded());
- createCellData(dao, cell, dataMetadatas, "NumberOfSamplesRecorded",
- dataValue, importResult);
- }
- // create NumberOfSamplesEchoIntegrated data
- if (row.getCellNumberOfSamplesEchoIntegrated() != null) {
- dataValue = String.valueOf(row.getCellNumberOfSamplesEchoIntegrated());
- createCellData(dao, cell, dataMetadatas, "NumberOfSamplesEchoIntegrated",
- dataValue, importResult);
- }
- }
-
- private DataAcquisition createDataAcquisition(AcousticDataImportConfiguration configuration,
- AcousticInstrument instrument,
- String softwareVersion,
- String soundSpeedCalculations,
- AcousticDataImportRow row,
- DataAcquisitionDAO dataAcquisitionDAO) {
-
- String transceiverAcquisitionAbsorptionDescription =
- configuration.getTransceiverAcquisitionAbsorptionDescription();
- String loggedDataFormat = configuration.getLoggedDataFormat();
- String loggedDataDatatype = configuration.getLoggedDataDatatype();
- String pingDutyCycle = configuration.getPingDutyCycle();
-
- DataAcquisition dataAcquisition = create(
- dataAcquisitionDAO,
- DataAcquisition.PROPERTY_ACOUSTIC_INSTRUMENT, instrument
- );
-
- // fill from manual configuration
-// dataAcquisition.setAcousticInstrument(instrument);
- dataAcquisition.setTransceiverAcquisitionAbsorptionDescription(transceiverAcquisitionAbsorptionDescription);
- dataAcquisition.setAcquisitionSoftwareVersion(softwareVersion);
- dataAcquisition.setLoggedDataFormat(loggedDataFormat);
- dataAcquisition.setLoggedDataDatatype(loggedDataDatatype);
- dataAcquisition.setPingDutyCycle(pingDutyCycle);
- dataAcquisition.setEchosounderSoundSpeed(row.getSoundCelerity());
- dataAcquisition.setSoundSpeedCalculations(soundSpeedCalculations);
-
- // fill from csv file
- Float transceiverAcquisitionAbsorption =
- row.getTransceiverAcquisitionAbsorption();
- Float transducerAcquisitionBeamAngleAthwartship =
- row.getTransducerAcquisitionBeamAngleAthwartship();
- Float transducerAcquisitionBeamAngleAlongship =
- row.getTransducerAcquisitionBeamAngleAlongship();
- Float transducerAcquisitionPsi =
- row.getTransducerAcquisitionPsi();
- Float transceiverAcquisitionPower =
- row.getTransceiverAcquisitionPower();
- Float transceiverAcquisitionPulseLength =
- row.getTransceiverAcquisitionPulseLength();
- Float transceiverAcquisitionGain =
- row.getTransceiverAcquisitionGain();
- Float transceiverAcquisitionSacorrection =
- row.getTransceiverAcquisitionSacorrection();
-
- dataAcquisition.setTransceiverAcquisitionAbsorption(transceiverAcquisitionAbsorption);
- dataAcquisition.setTransducerAcquisitionBeamAngleAthwartship(transducerAcquisitionBeamAngleAthwartship);
- dataAcquisition.setTransducerAcquisitionBeamAngleAlongship(transducerAcquisitionBeamAngleAlongship);
- dataAcquisition.setTransducerAcquisitionPsi(transducerAcquisitionPsi);
- dataAcquisition.setTransceiverAcquisitionPower(transceiverAcquisitionPower);
- dataAcquisition.setTransceiverAcquisitionPulseLength(transceiverAcquisitionPulseLength);
- dataAcquisition.setTransceiverAcquisitionGain(transceiverAcquisitionGain);
- dataAcquisition.setTransceiverAcquisitionSacorrection(transceiverAcquisitionSacorrection);
-
- return dataAcquisition;
- }
-
- private DataProcessing createDataProcessing(AcousticDataImportConfiguration configuration,
- String id,
- String softwareVersion,
- String soundSpeedCalculations,
- AcousticDataImportRow row,
- DataProcessingDAO dataProcessingDAO) {
-
- String transceiverAcquisitionAbsorptionDescription =
- configuration.getTransceiverAcquisitionAbsorptionDescription();
- String processingTemplate = configuration.getProcessingTemplate();
- String processingDescription = configuration.getProcessingDescription();
- String sounderConstant = configuration.getSounderConstant();
- float digitThreshold = configuration.getDigitThreshold();
- String acousticDensityUnit = configuration.getAcousticDensityUnit();
- String notes = configuration.getNotes();
-
- DataProcessing dataProcessing = create(
- dataProcessingDAO,
- DataProcessing.PROPERTY_ID, id,
- DataProcessing.PROPERTY_PROCESSING_TEMPLATE, processingTemplate
- );
-
- // fill from manual configuration
-// dataProcessing.setId(id);
-// dataProcessing.setProcessingTemplate(processingTemplate);
- dataProcessing.setProcessingDescription(processingDescription);
- dataProcessing.setSounderConstant(sounderConstant);
- dataProcessing.setDigitThreshold(digitThreshold);
- dataProcessing.setAcousticDensityUnit(acousticDensityUnit);
- dataProcessing.setNotes(notes);
- dataProcessing.setProcessingSoftwareVersion(softwareVersion);
- dataProcessing.setTransceiverProcessingAbsorptionDescription(transceiverAcquisitionAbsorptionDescription);
- dataProcessing.setEchosounderSoundSpeed(row.getSoundCelerity());
- dataProcessing.setSoundSpeedCalculations(soundSpeedCalculations);
-
- // fill from csv file
-
- Float transceiverAcquisitionAbsorption =
- row.getTransceiverAcquisitionAbsorption();
- Float transducerAcquisitionBeamAngleAthwartship =
- row.getTransducerAcquisitionBeamAngleAthwartship();
- Float transducerAcquisitionBeamAngleAlongship =
- row.getTransducerAcquisitionBeamAngleAlongship();
- Float transducerAcquisitionPsi =
- row.getTransducerAcquisitionPsi();
- Float transceiverAcquisitionGain =
- row.getTransceiverAcquisitionGain();
- Float transceiverAcquisitionSacorrection =
- row.getTransceiverAcquisitionSacorrection();
- int eIThresholdLow = row.geteIThresholdLow();
- int eIThresholdHigh = row.geteIThresholdHigh();
-
- dataProcessing.seteIThresholdLow(eIThresholdLow);
- dataProcessing.seteIThresholdHigh(eIThresholdHigh);
- dataProcessing.setTransceiverProcessingSacorrection(transceiverAcquisitionSacorrection);
- dataProcessing.setTransceiverProcessingAbsorption(transceiverAcquisitionAbsorption);
- dataProcessing.setTransceiverProcessingGain(transceiverAcquisitionGain);
- dataProcessing.setTransducerProcessingPsi(transducerAcquisitionPsi);
- dataProcessing.setTransducerProcessingBeamAngleAthwartship(transducerAcquisitionBeamAngleAthwartship);
- dataProcessing.setTransducerProcessingBeamAngleAlongship(transducerAcquisitionBeamAngleAlongship);
-
- return dataProcessing;
- }
-
- private void createCellData(DataDAO dao,
- Cell cell,
- Map<String, DataMetadata> dataMetadatasByName,
- String metadataName,
- String dataValue,
- CsvFileImportResult importResult) {
- createCellData(
- dao,
- cell,
- dataMetadatasByName.get(metadataName),
- dataValue,
- importResult
- );
-
-// DataMetadata dataMetaData = dataMetadatasByName.get(metadataName);
-// Data data = create(dao,
-// Data.PROPERTY_DATA_METADATA, dataMetaData,
-// Data.PROPERTY_DATA_VALUE, dataValue
-// );
-// data.setDataMetadata(dataMetaData);
-// data.setDataValue(dataValue);
-// cell.addData(data);
-
-// importResult.incrementsNumberCreated(EchoBaseEntityEnum.Data);
- }
-
- private String getSoftwareVersion(AcousticDataImportConfiguration configuration,
- boolean isME70) {
- String result;
- if (isME70) {
- result = configuration.getAcquisitionSoftwareVersionME70();
- } else {
- result = configuration.getAcquisitionSoftwareVersionER60();
- }
- return result;
- }
-
- private String getSoundSpeedCalculations(AcousticDataImportConfiguration configuration,
- boolean isME70) {
- String result;
- if (isME70) {
- result = configuration.getSoundSpeedCalculationsME70();
- } else {
- result = configuration.getSoundSpeedCalculationsER60();
- }
- return result;
- }
-
-}
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportConfiguration.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportConfiguration.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,256 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata;
+
+import fr.ifremer.echobase.InputFile;
+
+import java.util.Locale;
+
+import static org.nuiton.i18n.I18n.l_;
+
+/**
+ * Configuration of a "accoustic datas" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class AcousticImportConfiguration extends AbstractImportConfiguration {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Selected voyage id where to import datas. */
+ protected String voyageId;
+
+ /** Selected vessel id to find out transect where to import datas. */
+ protected String vesselId;
+
+ /** Flag to always add new dataAcquisition when a new instrument is found in movies file. */
+ protected boolean addDataAcquisition = true;
+
+ /** Manual transceiverAcquisitionAbsorptionDescription. */
+ protected String transceiverAcquisitionAbsorptionDescription = "(i) Equation: Francois and garrison 1982,(ii) CTD, (iii) nominal value for entire data set";
+
+ /** Manual acquisitionSoftwareVersion (ER60 instrument). */
+ protected String acquisitionSoftwareVersionER60;
+
+ /** Manual acquisitionSoftwareVersion (ME70 instrument). */
+ protected String acquisitionSoftwareVersionME70;
+
+ /** Manual loggedDataFormat. */
+ protected String loggedDataFormat = ".hac and .raw formats";
+
+ /** Manual loggedDataDatatype. */
+ protected String loggedDataDatatype = "‘raw’ digitisation samples";
+
+ /** Manual pingDutyCycle. */
+ protected String pingDutyCycle = "Ifremer's standard ping duty cycle";
+
+ /** Manual soundSpeedCalculations (ER60 instrument). */
+ protected String soundSpeedCalculationsER60 = "(i) Equation: Mackenzie (1980), (ii) CTD, (iii) nominal value for entire data set";
+
+ /** Manual soundSpeedCalculations (ME70 instrument). */
+ protected String soundSpeedCalculationsME70 = "(i) Equation: Mackenzie (1980), (ii) Hull-mounted thermosalinometer, (iii) surface absorption value recomputed every 30s and applied to the entire data set";
+
+ /** Manual sounderConstant. */
+ protected String sounderConstant = "NA";
+
+ /** Manual processingTemplate. */
+ protected String processingTemplate;
+
+ /** Manual processingDescription. */
+ protected String processingDescription;
+
+ /** Manual digitThreshold. */
+ protected float digitThreshold = -100f;
+
+ /** Manual acousticDensityUnit. */
+ protected String acousticDensityUnit = "sA";
+
+ /** Manual notes. */
+ protected String notes;
+
+ /** Cell position reference for esdu cell datas. */
+ protected CellPositionReference cellPositionReference;
+
+ /** Movies file to import. */
+ protected final InputFile moviesFile;
+
+
+ public AcousticImportConfiguration(Locale locale) {
+ moviesFile = InputFile.newFile(l_(locale, "echobase.common.moviesFile"));
+ }
+
+ public String getVoyageId() {
+ return voyageId;
+ }
+
+ public void setVoyageId(String voyageId) {
+ this.voyageId = voyageId;
+ }
+
+ public String getVesselId() {
+ return vesselId;
+ }
+
+ public void setVesselId(String vesselId) {
+ this.vesselId = vesselId;
+ }
+
+ public boolean isAddDataAcquisition() {
+ return addDataAcquisition;
+ }
+
+ public void setAddDataAcquisition(boolean addDataAcquisition) {
+ this.addDataAcquisition = addDataAcquisition;
+ }
+
+ public String getTransceiverAcquisitionAbsorptionDescription() {
+ return transceiverAcquisitionAbsorptionDescription;
+ }
+
+ public void setTransceiverAcquisitionAbsorptionDescription(String transceiverAcquisitionAbsorptionDescription) {
+ this.transceiverAcquisitionAbsorptionDescription = transceiverAcquisitionAbsorptionDescription;
+ }
+
+ public String getAcquisitionSoftwareVersionER60() {
+ return acquisitionSoftwareVersionER60;
+ }
+
+ public void setAcquisitionSoftwareVersionER60(String acquisitionSoftwareVersionER60) {
+ this.acquisitionSoftwareVersionER60 = acquisitionSoftwareVersionER60;
+ }
+
+ public String getAcquisitionSoftwareVersionME70() {
+ return acquisitionSoftwareVersionME70;
+ }
+
+ public void setAcquisitionSoftwareVersionME70(String acquisitionSoftwareVersionME70) {
+ this.acquisitionSoftwareVersionME70 = acquisitionSoftwareVersionME70;
+ }
+
+ public String getLoggedDataFormat() {
+ return loggedDataFormat;
+ }
+
+ public void setLoggedDataFormat(String loggedDataFormat) {
+ this.loggedDataFormat = loggedDataFormat;
+ }
+
+ public String getLoggedDataDatatype() {
+ return loggedDataDatatype;
+ }
+
+ public void setLoggedDataDatatype(String loggedDataDatatype) {
+ this.loggedDataDatatype = loggedDataDatatype;
+ }
+
+ public String getPingDutyCycle() {
+ return pingDutyCycle;
+ }
+
+ public void setPingDutyCycle(String pingDutyCycle) {
+ this.pingDutyCycle = pingDutyCycle;
+ }
+
+ public String getSoundSpeedCalculationsER60() {
+ return soundSpeedCalculationsER60;
+ }
+
+ public void setSoundSpeedCalculationsER60(String soundSpeedCalculationsER60) {
+ this.soundSpeedCalculationsER60 = soundSpeedCalculationsER60;
+ }
+
+ public String getSoundSpeedCalculationsME70() {
+ return soundSpeedCalculationsME70;
+ }
+
+ public void setSoundSpeedCalculationsME70(String soundSpeedCalculationsME70) {
+ this.soundSpeedCalculationsME70 = soundSpeedCalculationsME70;
+ }
+
+ public String getSounderConstant() {
+ return sounderConstant;
+ }
+
+ public void setSounderConstant(String sounderConstant) {
+ this.sounderConstant = sounderConstant;
+ }
+
+ public float getDigitThreshold() {
+ return digitThreshold;
+ }
+
+ public void setDigitThreshold(float digitThreshold) {
+ this.digitThreshold = digitThreshold;
+ }
+
+ public String getAcousticDensityUnit() {
+ return acousticDensityUnit;
+ }
+
+ public void setAcousticDensityUnit(String acousticDensityUnit) {
+ this.acousticDensityUnit = acousticDensityUnit;
+ }
+
+ public String getNotes() {
+ return notes;
+ }
+
+ public void setNotes(String notes) {
+ this.notes = notes;
+ }
+
+ public InputFile getMoviesFile() {
+ return moviesFile;
+ }
+
+ public String getProcessingTemplate() {
+ return processingTemplate;
+ }
+
+ public void setProcessingTemplate(String processingTemplate) {
+ this.processingTemplate = processingTemplate;
+ }
+
+ public String getProcessingDescription() {
+ return processingDescription;
+ }
+
+ public void setProcessingDescription(String processingDescription) {
+ this.processingDescription = processingDescription;
+ }
+
+ public CellPositionReference getCellPositionReference() {
+ return cellPositionReference;
+ }
+
+ public void setCellPositionReference(CellPositionReference cellPositionReference) {
+ this.cellPositionReference = cellPositionReference;
+ }
+
+ @Override
+ public InputFile[] getInputFiles() {
+ return new InputFile[]{moviesFile};
+ }
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportConfiguration.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportService.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportService.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportService.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportService.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,742 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import fr.ifremer.echobase.EchoBaseFunctions;
+import fr.ifremer.echobase.EchoBasePredicates;
+import fr.ifremer.echobase.InputFile;
+import fr.ifremer.echobase.csv.CsvFileImportResult;
+import fr.ifremer.echobase.csv.EchoBaseImport;
+import fr.ifremer.echobase.csv.EchobaseCsvUtil;
+import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
+import fr.ifremer.echobase.entities.EchoBaseUser;
+import fr.ifremer.echobase.entities.data.Cell;
+import fr.ifremer.echobase.entities.data.CellDAO;
+import fr.ifremer.echobase.entities.data.Data;
+import fr.ifremer.echobase.entities.data.DataAcquisition;
+import fr.ifremer.echobase.entities.data.DataAcquisitionDAO;
+import fr.ifremer.echobase.entities.data.DataDAO;
+import fr.ifremer.echobase.entities.data.DataProcessing;
+import fr.ifremer.echobase.entities.data.DataProcessingDAO;
+import fr.ifremer.echobase.entities.data.Transect;
+import fr.ifremer.echobase.entities.data.Transit;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.AcousticInstrument;
+import fr.ifremer.echobase.entities.references.CellType;
+import fr.ifremer.echobase.entities.references.DataMetadata;
+import fr.ifremer.echobase.entities.references.Vessel;
+import fr.ifremer.echobase.services.ImportException;
+import fr.ifremer.echobase.services.importdata.csv.AcousticImportModel;
+import fr.ifremer.echobase.services.importdata.csv.AcousticImportRow;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.csv.Import;
+import org.nuiton.util.csv.ImportRuntimeException;
+
+import java.io.Reader;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import static org.nuiton.i18n.I18n.l_;
+
+/**
+ * Service to launch a "acoustic data" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class AcousticImportService extends AbstractImportDataService<AcousticImportConfiguration> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(AcousticImportService.class);
+
+ @Override
+ protected String getImportLabel() {
+ return l_(getLocale(), ImportMode.Acoustic.getI18nKey());
+ }
+
+ @Override
+ protected void startImport(
+ AcousticImportConfiguration configuration,
+ EchoBaseUser user) throws ImportException {
+
+ // get selected voyage
+ Voyage voyage = getEntityById(Voyage.class,
+ configuration.getVoyageId());
+
+ // get selected vessel
+ Vessel vessel = getEntityById(Vessel.class,
+ configuration.getVesselId());
+
+ CellType esduCellType = getEntityByProperty(
+ CellType.class, CellType.PROPERTY_ID, "Esdu");
+ Preconditions.checkNotNull(esduCellType);
+
+ CellType elementaryCellType = getEntityByProperty(
+ CellType.class, CellType.PROPERTY_ID, "Elementary");
+ Preconditions.checkNotNull(elementaryCellType);
+
+ CsvFileImportResult importResult = importMoviesFile(configuration,
+ voyage,
+ vessel,
+ esduCellType,
+ elementaryCellType);
+ configuration.addResult(importResult);
+ }
+
+ private final DateFormat cellDateFormat = new SimpleDateFormat(
+ EchobaseCsvUtil.CELLULE_DATE_FORMAT);
+
+
+ private DataAcquisition getDataAcquisition(Transect transect,
+ AcousticInstrument instrument,
+ boolean addDataAcquisition) throws ImportException {
+
+
+ DataAcquisition result = null;
+ if (!addDataAcquisition &&
+ !transect.isDataAcquisitionEmpty()) {
+
+ // try to obtain an existing data acquisiton
+
+ for (DataAcquisition acquisition : transect.getDataAcquisition()) {
+
+ if (instrument.equals(acquisition.getAcousticInstrument())) {
+
+ // found a matching dataAcquisition from his acoustic instrument
+ result = acquisition;
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
+ private CsvFileImportResult importMoviesFile(AcousticImportConfiguration configuration,
+ Voyage voyage,
+ Vessel vessel,
+ CellType esduCellType,
+ CellType elementaryCellType
+ ) throws ImportException {
+
+ InputFile inputFile = configuration.getMoviesFile();
+
+ if (log.isInfoEnabled()) {
+ log.info("Starts import of acoustic datas from file " +
+ inputFile.getFileName());
+ }
+
+ CsvFileImportResult importResult = new CsvFileImportResult(
+ inputFile.getFileName());
+
+ Map<String, AcousticInstrument> instrumentsById =
+ getEntitiesMap(AcousticInstrument.class,
+ EchoBaseFunctions.ACOUSTIC_INSTRUMENT_ID);
+
+ Map<String, DataMetadata> dataMetadatasByName = getEntitiesMap(
+ DataMetadata.class, EchoBaseFunctions.DATA_METADATA_NAME);
+
+ AcousticImportModel csvModel = new AcousticImportModel(
+ getCsvSeparator(), instrumentsById);
+
+ DataAcquisitionDAO dataAcquisitionDAO =
+ getDAO(DataAcquisition.class, DataAcquisitionDAO.class);
+ DataProcessingDAO dataProcessingDAO =
+ getDAO(DataProcessing.class, DataProcessingDAO.class);
+ CellDAO cellDAO = getDAO(Cell.class, CellDAO.class);
+ DataDAO dataDAO = getDAO(Data.class, DataDAO.class);
+
+ boolean addDataAcquisition = configuration.isAddDataAcquisition();
+
+ String suffix =
+ configuration.getCellPositionReference().getMetadataNameSuffix();
+
+ List<Cell> elementaryCells = Lists.newArrayList();
+
+ Reader reader = getInputFileReader(inputFile);
+ Locale locale = getLocale();
+ String dataProcessingId = null;
+ try {
+ Import<AcousticImportRow> importer =
+ EchoBaseImport.newImport(csvModel, reader);
+ DataAcquisition dataAcquisition = null;
+ DataProcessing dataProcessing = null;
+
+ Cell elementaryCell;
+ int rowNumber = 0;
+
+ configuration.incrementsProgression();
+ for (AcousticImportRow row : importer) {
+
+ configuration.incrementsProgression();
+ rowNumber++;
+
+ if (rowNumber % 100 == 0) {
+ if (log.isInfoEnabled()) {
+ log.info("Doing line " + rowNumber);
+ }
+ }
+ if (dataProcessingId == null) {
+
+ // compute once for all the common dataprocessing id used
+ // for hole the movies file
+ dataProcessingId = row.getEiLayer() +
+ configuration.getProcessingTemplate();
+ }
+
+ Date startDate = row.getCellDateStart();
+
+ // get transect to use
+ Transit transit = voyage.getTransit(startDate);
+ if (transit == null) {
+
+ // can not find correct transit
+ throw new ImportException(
+ l_(locale, "echobase.importError.transit.notfound",
+ voyage.getName(),
+ startDate,
+ rowNumber));
+ }
+
+ Transect transect = transit.getTransect(vessel);
+ if (transect == null) {
+
+ // can not find correct transect
+ throw new ImportException(
+ l_(locale, "echobase.importError.transect.notfound",
+ voyage.getName(),
+ startDate,
+ vessel.getName(),
+ rowNumber));
+ }
+
+ AcousticInstrument instrument = row.getAcousticInstrument();
+ boolean isME70 =
+ EchoBasePredicates.IS_ACOUSTIC_INSTRUMENT_ME70.apply(instrument);
+
+ if (dataAcquisition == null ||
+ !instrument.equals(dataAcquisition.getAcousticInstrument())) {
+
+ // need to use another data acquisition
+
+ if (log.isDebugEnabled()) {
+ log.debug("[row " + rowNumber + "] New instrument to use (" + instrument.getId() + ")");
+ }
+
+ if (CollectionUtils.isNotEmpty(elementaryCells)) {
+
+ // means miss a esdu cell
+ // can not find correct transect
+ throw new ImportException(
+ l_(locale, "echobase.importError.esduCell.notfound",
+ voyage.getName(),
+ vessel.getName(),
+ instrument.getId(),
+ rowNumber));
+ }
+
+ String softwareVersion =
+ getSoftwareVersion(configuration, isME70);
+
+ String soundSpeedCalculations =
+ getSoundSpeedCalculations(configuration, isME70);
+
+ // try to get existing data acquisition
+ dataAcquisition = getDataAcquisition(
+ transect,
+ instrument,
+ addDataAcquisition
+ );
+
+ if (dataAcquisition == null) {
+
+ // need to create the data acquisition
+ dataAcquisition = createDataAcquisition(
+ configuration,
+ instrument,
+ softwareVersion,
+ soundSpeedCalculations,
+ row,
+ dataAcquisitionDAO
+ );
+
+ // add dataAcquisition to transect
+ transect.addDataAcquisition(dataAcquisition);
+
+ // count creation in result
+ importResult.incrementsNumberCreated(EchoBaseEntityEnum.DataAcquisition);
+
+ if (log.isDebugEnabled()) {
+ log.debug("[row " + rowNumber +
+ "] New dataAquisition to use (number: " +
+ importResult.getNumberCreated(
+ EchoBaseEntityEnum.DataAcquisition) + ")");
+ }
+
+ // create data processing
+ dataProcessing = createDataProcessing(
+ configuration,
+ dataProcessingId,
+ softwareVersion,
+ soundSpeedCalculations,
+ row,
+ dataProcessingDAO
+ );
+
+ if (log.isDebugEnabled()) {
+ log.debug("[row " + rowNumber +
+ "] New dataProcessing to use (" +
+ dataProcessing.getId() + ")");
+ }
+
+ importResult.incrementsNumberCreated(
+ EchoBaseEntityEnum.DataProcessing);
+
+ // add it to data acquisition
+ dataAcquisition.addDataProcessing(dataProcessing);
+ }
+ }
+
+ if (!row.isCellToAdd()) {
+
+ // dead cell not to be imported
+ if (log.isWarnEnabled()) {
+ log.warn("Will not import cell of row " + rowNumber);
+ }
+ continue;
+ }
+
+ int cellType = row.getCellType();
+
+ String esduCellId = cellDateFormat.format(startDate);
+
+ if (cellType == 4) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("[row " + rowNumber + "] Esdu cell (" +
+ esduCellId + ")");
+ }
+
+ // this is a esdu cell row
+
+ // create esdu cell
+ Cell esduCell = create(cellDAO,
+ Cell.PROPERTY_CELL_TYPE, esduCellType,
+ Cell.PROPERTY_NAME, esduCellId
+ );
+
+ // add all found elementary cells
+ esduCell.addAllChilds(elementaryCells);
+
+ // clear elementary cells
+ elementaryCells.clear();
+
+ importResult.incrementsNumberCreated(EchoBaseEntityEnum.Cell);
+
+ // add it to data processing
+ dataProcessing.addCell(esduCell);
+
+ // create esdu cell data
+ createEsduCellData(suffix,
+ esduCell,
+ dataMetadatasByName,
+ row,
+ dataDAO,
+ importResult);
+ } else {
+
+ // this is a elementary cell row
+
+ int cellNum = row.getCellNum();
+
+ boolean surface = cellType == 0;
+
+ String elementaryCellId = cellNum + (surface ? "S" : "B");
+
+ if (log.isDebugEnabled()) {
+ log.debug("[row " + rowNumber + "] elementary cell (" +
+ elementaryCellId + ")");
+ }
+
+ // create the elementary cell
+ elementaryCell = create(cellDAO,
+ Cell.PROPERTY_CELL_TYPE, elementaryCellType,
+ Cell.PROPERTY_NAME, elementaryCellId
+ );
+
+ // keep (to attach them to esdu cell)
+ elementaryCells.add(elementaryCell);
+
+ importResult.incrementsNumberCreated(EchoBaseEntityEnum.Cell);
+
+ // create datas of the elementary cell
+ createElementaryCellData(suffix,
+ elementaryCell,
+ dataMetadatasByName,
+ surface,
+ row,
+ dataDAO,
+ importResult);
+ }
+ }
+
+ return importResult;
+ } catch (ImportRuntimeException e) {
+ throw new ImportException(locale, inputFile, e);
+ } finally {
+ closeReader(reader, inputFile);
+ }
+ }
+
+ protected void createEsduCellData(String suffix,
+ Cell cell,
+ Map<String, DataMetadata> dataMetadatas,
+ AcousticImportRow row,
+ DataDAO dao,
+ CsvFileImportResult importResult) {
+
+ String dataValue;
+
+ // create Latitude data
+ dataValue = String.valueOf(row.getCellLatitude());
+ createCellData(dao, cell, dataMetadatas, "Latitude" + suffix,
+ dataValue, importResult);
+
+ // create Longitude data
+ dataValue = String.valueOf(row.getCellLongitude());
+ createCellData(dao, cell, dataMetadatas, "Longitude" + suffix,
+ dataValue, importResult);
+
+ // create Depth data
+ dataValue = row.getEsduCellDataDepth();
+ createCellData(dao, cell, dataMetadatas, "DepthRefSurface" + suffix,
+ dataValue, importResult);
+
+ // create Time Start data
+ dataValue = cellDateFormat.format(row.getCellDateStart());
+ createCellData(dao, cell, dataMetadatas, "TimeStart",
+ dataValue, importResult);
+
+ // create Time end data
+ dataValue = cellDateFormat.format(row.getCellDateEnd());
+ createCellData(dao, cell, dataMetadatas, "TimeEnd",
+ dataValue, importResult);
+
+ // create NASC data
+ if (row.getCellNasc() != null) {
+ dataValue = String.valueOf(row.getCellNasc());
+ createCellData(dao, cell, dataMetadatas, "NASC",
+ dataValue, importResult);
+ }
+
+ // create Volume data
+ if (row.getCellVolume() != null) {
+ dataValue = String.valueOf(row.getCellVolume());
+ createCellData(dao, cell, dataMetadatas, "Volume ",
+ dataValue, importResult);
+ }
+ // create Surface data
+ dataValue = String.valueOf(row.getCellSurface());
+ createCellData(dao, cell, dataMetadatas, "Surface",
+ dataValue, importResult);
+
+ // create NumberOfSamplesRecorded data
+ if (row.getCellNumberOfSamplesRecorded() != null) {
+ dataValue = String.valueOf(row.getCellNumberOfSamplesRecorded());
+ createCellData(dao, cell, dataMetadatas, "NumberOfSamplesRecorded",
+ dataValue, importResult);
+ }
+ // create NumberOfSamplesEchoIntegrated data
+ if (row.getCellNumberOfSamplesEchoIntegrated() != null) {
+ dataValue = String.valueOf(row.getCellNumberOfSamplesEchoIntegrated());
+ createCellData(dao, cell, dataMetadatas, "NumberOfSamplesEchoIntegrated",
+ dataValue, importResult);
+ }
+ }
+
+ private void createElementaryCellData(String suffix,
+ Cell cell,
+ Map<String, DataMetadata> dataMetadatas,
+ boolean surface,
+ AcousticImportRow row,
+ DataDAO dao,
+ CsvFileImportResult importResult) {
+
+ String dataValue;
+ String startMeta;
+ String endMeta;
+
+ if (surface) {
+
+ // surface
+
+ startMeta = "DepthRefSurfaceStart";
+ endMeta = "DepthRefSurfaceEnd";
+
+ } else {
+
+ // bottom
+
+ startMeta = "DepthRefBottomStart";
+ endMeta = "DepthRefBottomEnd";
+ }
+
+ // create Latitude data
+ dataValue = String.valueOf(row.getCellLatitude());
+ createCellData(dao, cell, dataMetadatas, "Latitude" + suffix,
+ dataValue, importResult);
+
+ // create Longitude data
+ dataValue = String.valueOf(row.getCellLongitude());
+ createCellData(dao, cell, dataMetadatas, "Longitude" + suffix,
+ dataValue, importResult);
+
+ // create depth start data
+ dataValue = String.valueOf(row.getCellDepthStart());
+ createCellData(dao, cell, dataMetadatas, startMeta, dataValue, importResult);
+
+ // create depth end data
+ dataValue = String.valueOf(row.getCellDepthEnd());
+ createCellData(dao, cell, dataMetadatas, endMeta, dataValue, importResult);
+
+
+ // create Time Start data
+ dataValue = cellDateFormat.format(row.getCellDateStart());
+ createCellData(dao, cell, dataMetadatas, "TimeStart",
+ dataValue, importResult);
+
+ // create Time end data
+ dataValue = cellDateFormat.format(row.getCellDateEnd());
+ createCellData(dao, cell, dataMetadatas, "TimeEnd",
+ dataValue, importResult);
+
+ // create acoustic density data
+ if (row.getCellNasc() != null) {
+ dataValue = String.valueOf(row.getCellNasc());
+ createCellData(dao, cell, dataMetadatas, "NASC", dataValue, importResult);
+ }
+ // create Volume data
+ if (row.getCellVolume() != null) {
+ dataValue = String.valueOf(row.getCellVolume());
+ createCellData(dao, cell, dataMetadatas, "Volume ",
+ dataValue, importResult);
+ }
+ // create Surface data
+ dataValue = String.valueOf(row.getCellSurface());
+ createCellData(dao, cell, dataMetadatas, "Surface",
+ dataValue, importResult);
+
+ // create NumberOfSamplesRecorded data
+ if (row.getCellNumberOfSamplesRecorded() != null) {
+ dataValue = String.valueOf(row.getCellNumberOfSamplesRecorded());
+ createCellData(dao, cell, dataMetadatas, "NumberOfSamplesRecorded",
+ dataValue, importResult);
+ }
+ // create NumberOfSamplesEchoIntegrated data
+ if (row.getCellNumberOfSamplesEchoIntegrated() != null) {
+ dataValue = String.valueOf(row.getCellNumberOfSamplesEchoIntegrated());
+ createCellData(dao, cell, dataMetadatas, "NumberOfSamplesEchoIntegrated",
+ dataValue, importResult);
+ }
+ }
+
+ private DataAcquisition createDataAcquisition(AcousticImportConfiguration configuration,
+ AcousticInstrument instrument,
+ String softwareVersion,
+ String soundSpeedCalculations,
+ AcousticImportRow row,
+ DataAcquisitionDAO dataAcquisitionDAO) {
+
+ String transceiverAcquisitionAbsorptionDescription =
+ configuration.getTransceiverAcquisitionAbsorptionDescription();
+ String loggedDataFormat = configuration.getLoggedDataFormat();
+ String loggedDataDatatype = configuration.getLoggedDataDatatype();
+ String pingDutyCycle = configuration.getPingDutyCycle();
+
+ DataAcquisition dataAcquisition = create(
+ dataAcquisitionDAO,
+ DataAcquisition.PROPERTY_ACOUSTIC_INSTRUMENT, instrument
+ );
+
+ // fill from manual configuration
+// dataAcquisition.setAcousticInstrument(instrument);
+ dataAcquisition.setTransceiverAcquisitionAbsorptionDescription(transceiverAcquisitionAbsorptionDescription);
+ dataAcquisition.setAcquisitionSoftwareVersion(softwareVersion);
+ dataAcquisition.setLoggedDataFormat(loggedDataFormat);
+ dataAcquisition.setLoggedDataDatatype(loggedDataDatatype);
+ dataAcquisition.setPingDutyCycle(pingDutyCycle);
+ dataAcquisition.setEchosounderSoundSpeed(row.getSoundCelerity());
+ dataAcquisition.setSoundSpeedCalculations(soundSpeedCalculations);
+
+ // fill from csv file
+ Float transceiverAcquisitionAbsorption =
+ row.getTransceiverAcquisitionAbsorption();
+ Float transducerAcquisitionBeamAngleAthwartship =
+ row.getTransducerAcquisitionBeamAngleAthwartship();
+ Float transducerAcquisitionBeamAngleAlongship =
+ row.getTransducerAcquisitionBeamAngleAlongship();
+ Float transducerAcquisitionPsi =
+ row.getTransducerAcquisitionPsi();
+ Float transceiverAcquisitionPower =
+ row.getTransceiverAcquisitionPower();
+ Float transceiverAcquisitionPulseLength =
+ row.getTransceiverAcquisitionPulseLength();
+ Float transceiverAcquisitionGain =
+ row.getTransceiverAcquisitionGain();
+ Float transceiverAcquisitionSacorrection =
+ row.getTransceiverAcquisitionSacorrection();
+
+ dataAcquisition.setTransceiverAcquisitionAbsorption(transceiverAcquisitionAbsorption);
+ dataAcquisition.setTransducerAcquisitionBeamAngleAthwartship(transducerAcquisitionBeamAngleAthwartship);
+ dataAcquisition.setTransducerAcquisitionBeamAngleAlongship(transducerAcquisitionBeamAngleAlongship);
+ dataAcquisition.setTransducerAcquisitionPsi(transducerAcquisitionPsi);
+ dataAcquisition.setTransceiverAcquisitionPower(transceiverAcquisitionPower);
+ dataAcquisition.setTransceiverAcquisitionPulseLength(transceiverAcquisitionPulseLength);
+ dataAcquisition.setTransceiverAcquisitionGain(transceiverAcquisitionGain);
+ dataAcquisition.setTransceiverAcquisitionSacorrection(transceiverAcquisitionSacorrection);
+
+ return dataAcquisition;
+ }
+
+ private DataProcessing createDataProcessing(AcousticImportConfiguration configuration,
+ String id,
+ String softwareVersion,
+ String soundSpeedCalculations,
+ AcousticImportRow row,
+ DataProcessingDAO dataProcessingDAO) {
+
+ String transceiverAcquisitionAbsorptionDescription =
+ configuration.getTransceiverAcquisitionAbsorptionDescription();
+ String processingTemplate = configuration.getProcessingTemplate();
+ String processingDescription = configuration.getProcessingDescription();
+ String sounderConstant = configuration.getSounderConstant();
+ float digitThreshold = configuration.getDigitThreshold();
+ String acousticDensityUnit = configuration.getAcousticDensityUnit();
+ String notes = configuration.getNotes();
+
+ DataProcessing dataProcessing = create(
+ dataProcessingDAO,
+ DataProcessing.PROPERTY_ID, id,
+ DataProcessing.PROPERTY_PROCESSING_TEMPLATE, processingTemplate
+ );
+
+ // fill from manual configuration
+// dataProcessing.setId(id);
+// dataProcessing.setProcessingTemplate(processingTemplate);
+ dataProcessing.setProcessingDescription(processingDescription);
+ dataProcessing.setSounderConstant(sounderConstant);
+ dataProcessing.setDigitThreshold(digitThreshold);
+ dataProcessing.setAcousticDensityUnit(acousticDensityUnit);
+ dataProcessing.setNotes(notes);
+ dataProcessing.setProcessingSoftwareVersion(softwareVersion);
+ dataProcessing.setTransceiverProcessingAbsorptionDescription(transceiverAcquisitionAbsorptionDescription);
+ dataProcessing.setEchosounderSoundSpeed(row.getSoundCelerity());
+ dataProcessing.setSoundSpeedCalculations(soundSpeedCalculations);
+
+ // fill from csv file
+
+ Float transceiverAcquisitionAbsorption =
+ row.getTransceiverAcquisitionAbsorption();
+ Float transducerAcquisitionBeamAngleAthwartship =
+ row.getTransducerAcquisitionBeamAngleAthwartship();
+ Float transducerAcquisitionBeamAngleAlongship =
+ row.getTransducerAcquisitionBeamAngleAlongship();
+ Float transducerAcquisitionPsi =
+ row.getTransducerAcquisitionPsi();
+ Float transceiverAcquisitionGain =
+ row.getTransceiverAcquisitionGain();
+ Float transceiverAcquisitionSacorrection =
+ row.getTransceiverAcquisitionSacorrection();
+ int eIThresholdLow = row.geteIThresholdLow();
+ int eIThresholdHigh = row.geteIThresholdHigh();
+
+ dataProcessing.seteIThresholdLow(eIThresholdLow);
+ dataProcessing.seteIThresholdHigh(eIThresholdHigh);
+ dataProcessing.setTransceiverProcessingSacorrection(transceiverAcquisitionSacorrection);
+ dataProcessing.setTransceiverProcessingAbsorption(transceiverAcquisitionAbsorption);
+ dataProcessing.setTransceiverProcessingGain(transceiverAcquisitionGain);
+ dataProcessing.setTransducerProcessingPsi(transducerAcquisitionPsi);
+ dataProcessing.setTransducerProcessingBeamAngleAthwartship(transducerAcquisitionBeamAngleAthwartship);
+ dataProcessing.setTransducerProcessingBeamAngleAlongship(transducerAcquisitionBeamAngleAlongship);
+
+ return dataProcessing;
+ }
+
+ private void createCellData(DataDAO dao,
+ Cell cell,
+ Map<String, DataMetadata> dataMetadatasByName,
+ String metadataName,
+ String dataValue,
+ CsvFileImportResult importResult) {
+ createCellData(
+ dao,
+ cell,
+ dataMetadatasByName.get(metadataName),
+ dataValue,
+ importResult
+ );
+
+// DataMetadata dataMetaData = dataMetadatasByName.get(metadataName);
+// Data data = create(dao,
+// Data.PROPERTY_DATA_METADATA, dataMetaData,
+// Data.PROPERTY_DATA_VALUE, dataValue
+// );
+// data.setDataMetadata(dataMetaData);
+// data.setDataValue(dataValue);
+// cell.addData(data);
+
+// importResult.incrementsNumberCreated(EchoBaseEntityEnum.Data);
+ }
+
+ private String getSoftwareVersion(AcousticImportConfiguration configuration,
+ boolean isME70) {
+ String result;
+ if (isME70) {
+ result = configuration.getAcquisitionSoftwareVersionME70();
+ } else {
+ result = configuration.getAcquisitionSoftwareVersionER60();
+ }
+ return result;
+ }
+
+ private String getSoundSpeedCalculations(AcousticImportConfiguration configuration,
+ boolean isME70) {
+ String result;
+ if (isME70) {
+ result = configuration.getSoundSpeedCalculationsME70();
+ } else {
+ result = configuration.getSoundSpeedCalculationsER60();
+ }
+ return result;
+ }
+
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportConfiguration.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,87 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata;
-
-import fr.ifremer.echobase.InputFile;
-
-import java.util.Locale;
-
-import static org.nuiton.i18n.I18n.l_;
-
-/**
- * Configuration of a "catches data import".
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CatchesDataImportConfiguration extends AbstractImportConfiguration {
-
- private static final long serialVersionUID = 1L;
-
- /** Selected voyage id where to import datas. */
- protected String voyageId;
-
- /** Sample file to import. */
- protected final InputFile totalSampleFile;
-
- /** Sub sample file to import. */
- protected final InputFile subSampleFile;
-
- /** Biometry sample file to import. */
- protected final InputFile biometrySampleFile;
-
- public CatchesDataImportConfiguration(Locale locale) {
- totalSampleFile = InputFile.newFile(
- l_(locale, "echobase.common.totalSampleFile"));
- subSampleFile = InputFile.newFile(
- l_(locale, "echobase.common.subSampleFile"));
- biometrySampleFile = InputFile.newFile(
- l_(locale, "echobase.common.biometrySampleFile"));
- }
-
- public String getVoyageId() {
- return voyageId;
- }
-
- public void setVoyageId(String voyageId) {
- this.voyageId = voyageId;
- }
-
- public InputFile getTotalSampleFile() {
- return totalSampleFile;
- }
-
- public InputFile getSubSampleFile() {
- return subSampleFile;
- }
-
- public InputFile getBiometrySampleFile() {
- return biometrySampleFile;
- }
-
- @Override
- public InputFile[] getInputFiles() {
- return new InputFile[]{totalSampleFile, subSampleFile, biometrySampleFile};
- }
-}
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportService.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportService.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,554 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import fr.ifremer.echobase.EchoBaseFunctions;
-import fr.ifremer.echobase.EchoBasePredicates;
-import fr.ifremer.echobase.InputFile;
-import fr.ifremer.echobase.csv.CsvFileImportResult;
-import fr.ifremer.echobase.csv.EchoBaseImport;
-import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
-import fr.ifremer.echobase.entities.EchoBaseUser;
-import fr.ifremer.echobase.entities.data.Operation;
-import fr.ifremer.echobase.entities.data.Sample;
-import fr.ifremer.echobase.entities.data.SampleDAO;
-import fr.ifremer.echobase.entities.data.SampleData;
-import fr.ifremer.echobase.entities.data.SampleDataDAO;
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.entities.references.SampleDataType;
-import fr.ifremer.echobase.entities.references.SampleDataTypeDAO;
-import fr.ifremer.echobase.entities.references.SampleType;
-import fr.ifremer.echobase.entities.references.SampleTypeDAO;
-import fr.ifremer.echobase.entities.references.SexCategory;
-import fr.ifremer.echobase.entities.references.SizeCategory;
-import fr.ifremer.echobase.entities.references.Species;
-import fr.ifremer.echobase.entities.references.SpeciesCategory;
-import fr.ifremer.echobase.entities.references.SpeciesCategoryDAO;
-import fr.ifremer.echobase.services.ImportException;
-import fr.ifremer.echobase.services.importdata.csv.BiometrySampleImportModel;
-import fr.ifremer.echobase.services.importdata.csv.BiometrySampleImportRow;
-import fr.ifremer.echobase.services.importdata.csv.SubSampleImportModel;
-import fr.ifremer.echobase.services.importdata.csv.SubSampleImportRow;
-import fr.ifremer.echobase.services.importdata.csv.TotalSampleImportModel;
-import fr.ifremer.echobase.services.importdata.csv.TotalSampleImportRow;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.util.csv.Import;
-import org.nuiton.util.csv.ImportRuntimeException;
-
-import java.io.Reader;
-import java.util.Collection;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import static org.nuiton.i18n.I18n.l_;
-
-/**
- * Service to launch a "catches sample data" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CatchesDataImportService extends AbstractImportDataService<CatchesDataImportConfiguration> {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(CatchesDataImportService.class);
-
- @Override
- protected String getImportLabel() {
- return l_(getLocale(), ImportDataMode.CatchesData.getI18nKey());
- }
-
- @Override
- protected List<CsvFileImportResult> startImport(CatchesDataImportConfiguration configuration,
- EchoBaseUser user) throws ImportException {
-
- List<CsvFileImportResult> result = Lists.newLinkedList();
-
- Voyage voyage = getEntityById(Voyage.class,
- configuration.getVoyageId());
-
- // get all operation for this voyage and this vessel
- Collection<Operation> operations = voyage.getAllOperations();
-
- // split them by operation Id
- Map<String, Operation> operationMap = Maps.uniqueIndex(
- operations, EchoBaseFunctions.OPERATION_ID);
-
- Map<String, Species> speciesMap = getEntitiesMap(
- Species.class,
- EchoBaseFunctions.SPECIES_BARACOUDA_CODE);
-
- Map<String, SizeCategory> sizeCategoryMap = getEntitiesMap(
- SizeCategory.class,
- EchoBaseFunctions.SIZE_CATEGORY_NAME);
-
-
- if (configuration.getTotalSampleFile().hasFile()) {
- CsvFileImportResult totalSampleResult = importTotalSampleFile(
- configuration,
- configuration.getTotalSampleFile(),
- operationMap,
- speciesMap,
- sizeCategoryMap);
-
- addResultAndLog(result, configuration.getTotalSampleFile(),
- totalSampleResult, user);
- }
-
- if (configuration.getSubSampleFile().hasFile()) {
- CsvFileImportResult subSampleResult = importSubSampleFile(
- configuration,
- configuration.getSubSampleFile(),
- operationMap,
- speciesMap,
- sizeCategoryMap
- );
-
- addResultAndLog(result, configuration.getSubSampleFile(),
- subSampleResult, user);
- }
-
- if (configuration.getBiometrySampleFile().hasFile()) {
- CsvFileImportResult biometrySampleResult = importBiometrySampleFile(
- configuration,
- configuration.getBiometrySampleFile(),
- operationMap,
- speciesMap);
-
-
- addResultAndLog(result, configuration.getBiometrySampleFile(),
- biometrySampleResult, user);
- }
- return result;
- }
-
- private CsvFileImportResult importTotalSampleFile(CatchesDataImportConfiguration configuration,
- InputFile inputFile,
- Map<String, Operation> operationMap,
- Map<String, Species> speciesMap,
- Map<String, SizeCategory> sizeCategoryMap) throws ImportException {
-
- if (log.isInfoEnabled()) {
- log.info("Starts import of totalSample from file " +
- inputFile.getFileName());
- }
-
- CsvFileImportResult importResult = new CsvFileImportResult(
- inputFile.getFileName());
-
- TotalSampleImportModel csvModel = new TotalSampleImportModel(getCsvSeparator(),
- operationMap,
- speciesMap,
- sizeCategoryMap
- );
-
- SampleDAO sampleDAO = getDAO(Sample.class, SampleDAO.class);
- SampleDataDAO sampleDataDAO = getDAO(SampleData.class, SampleDataDAO.class);
- SampleTypeDAO sampleTypeDAO = getDAO(SampleType.class, SampleTypeDAO.class);
- SampleDataTypeDAO sampleDataTypeDAO = getDAO(SampleDataType.class, SampleDataTypeDAO.class);
- SpeciesCategoryDAO speciesCategoryDAO = getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class);
-
- SampleType sampleTypeTotal = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Total");
- Preconditions.checkNotNull(sampleTypeTotal);
- SampleType sampleTypeUnsorted = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Unsorted");
- Preconditions.checkNotNull(sampleTypeUnsorted);
- SampleType sampleTypeSorted = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Sorted");
- Preconditions.checkNotNull(sampleTypeSorted);
-
- SampleDataType sampleDataTypeMeanLength = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "MeanLengthcm");
- Preconditions.checkNotNull(sampleDataTypeMeanLength);
- SampleDataType sampleDataTypeMeanWeight = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "MeanWeightg");
- Preconditions.checkNotNull(sampleDataTypeMeanWeight);
- SampleDataType sampleDataTypeNoPerKg = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "NoPerKg");
- Preconditions.checkNotNull(sampleDataTypeNoPerKg);
-
- Reader reader = getInputFileReader(inputFile);
- Locale locale = getLocale();
- try {
- Import<TotalSampleImportRow> importer =
- EchoBaseImport.newImport(csvModel, reader);
-
- configuration.incrementsProgression();
- for (TotalSampleImportRow row : importer) {
-
- configuration.incrementsProgression();
- Operation operation = row.getOperation();
-
- Species species = row.getSpecies();
- SizeCategory sizeCategory = row.getSizeCategory();
-
- SpeciesCategory category = getSpeciesCategory(
- speciesCategoryDAO,
- species,
- sizeCategory,
- null,
- null,
- importResult
- );
-
- SampleType sampleType;
-
- if (EchoBasePredicates.IS_HORS_VRAC.apply(sizeCategory)) {
-
- // hors vrac case
- sampleType = sampleTypeUnsorted;
-
- } else {
- // none hors vrac case
- sampleType = sampleTypeTotal;
- }
-
- Sample sample = operation.getSample(category, sampleType);
-
- if (sample != null) {
-
- // can not have twice same sample
- throw new ImportException(
- l_(locale, "echobase.importError.duplicate.sample",
- operation.getId(),
- sampleType.getName(),
- species.getBaracoudaCode(),
- sizeCategory.getName()));
- }
-
- if (sample == null) {
-
- // must create it
-
- sample = row.getSample();
- sample.setSpeciesCategory(category);
- sample.setSampleType(sampleType);
-
- sample = addSample(sampleDAO,
- operation,
- sample,
- importResult);
- } else {
- sample = sample;
- }
-
- // create datas
-
- if (row.getMeanLength() != null) {
-
- //create meanLength data
- addSampleData(sampleDataDAO,
- sampleDataTypeMeanLength,
- null,
- row.getMeanLength(),
- sample,
- importResult);
- }
-
- if (row.getMeanWeight() != null) {
-
- //create meanWeight data
- addSampleData(sampleDataDAO,
- sampleDataTypeMeanWeight,
- null,
- row.getMeanWeight(),
- sample,
- importResult);
- }
-
- if (row.getNoPerKg() != null) {
-
- //create noPerKg data
- addSampleData(sampleDataDAO,
- sampleDataTypeNoPerKg,
- null,
- row.getNoPerKg(),
- sample,
- importResult);
- }
-
- Sample createdSortedSample = newInstance(sampleDAO);
- createdSortedSample.setSampleType(sampleTypeSorted);
- createdSortedSample.setSampleWeight(row.getSortedWeight());
-
- // create sorted sample
- addSample(sampleDAO,
- operation,
- createdSortedSample,
- importResult);
-
-
- }
-
- return importResult;
- } catch (ImportRuntimeException e) {
- throw new ImportException(locale, inputFile, e);
- } finally {
- closeReader(reader, inputFile);
- }
- }
-
- private CsvFileImportResult importSubSampleFile(
- CatchesDataImportConfiguration configuration,
- InputFile inputFile,
- Map<String, Operation> operationMap,
- Map<String, Species> speciesMap,
- Map<String, SizeCategory> sizeCategoryMap
- ) throws ImportException {
-
- if (log.isInfoEnabled()) {
- log.info("Starts import of subSample from file " +
- inputFile.getFileName());
- }
-
- Map<String, SexCategory> sexCategoryMap = getEntitiesMap(
- SexCategory.class,
- EchoBaseFunctions.SEX_CATEGORY_NAME);
-
-
- CsvFileImportResult importResult = new CsvFileImportResult(
- inputFile.getFileName());
-
- SubSampleImportModel csvModel = new SubSampleImportModel(
- getCsvSeparator(),
- operationMap,
- speciesMap,
- sizeCategoryMap,
- sexCategoryMap);
-
- SampleDAO sampleDAO = getDAO(Sample.class, SampleDAO.class);
- SampleDataDAO sampleDataDAO = getDAO(SampleData.class, SampleDataDAO.class);
- SampleTypeDAO sampleTypeDAO = getDAO(SampleType.class, SampleTypeDAO.class);
- SampleDataTypeDAO sampleDataTypeDAO = getDAO(SampleDataType.class, SampleDataTypeDAO.class);
- SpeciesCategoryDAO speciesCategoryDAO = getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class);
-
- SampleType sampleTypeSubsample = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Subsample");
- Preconditions.checkNotNull(sampleTypeSubsample);
-
- SampleDataType sampleDataTypeNumberAtLength = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "NumberAtLength");
- Preconditions.checkNotNull(sampleDataTypeNumberAtLength);
- SampleDataType sampleDataTypeWeightAtLength = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "WeightAtLengthkg");
- Preconditions.checkNotNull(sampleDataTypeWeightAtLength);
-
- Reader reader = getInputFileReader(inputFile);
- try {
- Import<SubSampleImportRow> importer =
- EchoBaseImport.newImport(csvModel, reader);
-
- configuration.incrementsProgression();
- for (SubSampleImportRow row : importer) {
-
- configuration.incrementsProgression();
- Operation operation = row.getOperation();
-
- Species species = row.getSpecies();
- SizeCategory sizeCategory = row.getSizeCategory();
- SexCategory sexCategory = row.getSexCategory();
-
- SpeciesCategory category = getSpeciesCategory(
- speciesCategoryDAO,
- species,
- sizeCategory,
- null,
- sexCategory,
- importResult
- );
-
- // find the sample with this category
- Sample sample = operation.getSample(category,
- sampleTypeSubsample);
-
- if (sample == null) {
-
- // must create it
- sample = row.getSample();
-
- sample.setSpeciesCategory(category);
- sample.setSampleType(sampleTypeSubsample);
-
- sample = addSample(sampleDAO,
- operation,
- sample,
- importResult);
- }
-
- //create numberAtLength data
- addSampleData(sampleDataDAO,
- sampleDataTypeNumberAtLength,
- "" + row.getLengthClass(),
- row.getNumberAtLength(),
- sample,
- importResult);
-
- if (row.getWeightAtLength() != null) {
-
- //create weightAtLength data
- addSampleData(sampleDataDAO,
- sampleDataTypeWeightAtLength,
- "" + row.getLengthClass(),
- row.getWeightAtLength(),
- sample,
- importResult);
- }
- }
-
- return importResult;
- } catch (ImportRuntimeException e) {
- throw new ImportException(getLocale(), inputFile, e);
- } finally {
- closeReader(reader, inputFile);
- }
- }
-
- private CsvFileImportResult importBiometrySampleFile(
- CatchesDataImportConfiguration configuration,
- InputFile inputFile,
- Map<String, Operation> operationMap,
- Map<String, Species> speciesMap
- ) throws ImportException {
-
- if (log.isInfoEnabled()) {
- log.info("Starts import of biometrySample from file " +
- inputFile.getFileName());
- }
-
- Map<String, SampleDataType> sampleDataTypeMap = getEntitiesMap(
- SampleDataType.class,
- EchoBaseFunctions.SAMPLE_DATA_TYPE_NAME);
-
- CsvFileImportResult importResult = new CsvFileImportResult(
- inputFile.getFileName());
-
- BiometrySampleImportModel csvModel =
- new BiometrySampleImportModel(getCsvSeparator(),
- operationMap,
- speciesMap,
- sampleDataTypeMap);
-
- SampleDAO sampleDAO = getDAO(Sample.class, SampleDAO.class);
- SampleDataDAO sampleDataDAO = getDAO(SampleData.class, SampleDataDAO.class);
- SampleTypeDAO sampleTypeDAO = getDAO(SampleType.class, SampleTypeDAO.class);
- SpeciesCategoryDAO speciesCategoryDAO = getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class);
-
- SampleType sampleTypeIndividual = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Individual");
- Preconditions.checkNotNull(sampleTypeIndividual);
-
- Map<String, Sample> samples = Maps.newTreeMap();
-
- Reader reader = getInputFileReader(inputFile);
- try {
- Import<BiometrySampleImportRow> importer =
- EchoBaseImport.newImport(csvModel, reader);
-
- configuration.incrementsProgression();
- for (BiometrySampleImportRow row : importer) {
-
- configuration.incrementsProgression();
- Operation operation = row.getOperation();
-
- Species species = row.getSpecies();
-
- int numFish = row.getNumFish();
-
- String sampleKey = operation.getId() + "_" + species.getBaracoudaCode() + "_" + numFish;
-
- Sample sample = samples.get(sampleKey);
-
- if (sample == null) {
-
- // create a new sample
- sample = newInstance(sampleDAO);
-
- sample.setSampleType(sampleTypeIndividual);
-
- SpeciesCategory category = getSpeciesCategory(
- speciesCategoryDAO,
- species,
- null,
- null,
- null,
- importResult
- );
-
- sample.setSpeciesCategory(category);
-
- sample = addSample(sampleDAO,
- operation,
- sample,
- importResult);
-
- samples.put(sampleKey, sample);
- }
-
- SampleData sampleData = row.getSampleData();
-
- SampleData sampleDataCreated = create(sampleDataDAO, sampleData);
- sample.addSampleData(sampleDataCreated);
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.SampleData);
- }
-
- return importResult;
- } catch (ImportRuntimeException e) {
- throw new ImportException(getLocale(), inputFile, e);
- } finally {
- closeReader(reader, inputFile);
- }
- }
-
- private Sample addSample(SampleDAO dao,
- Operation operation,
- Sample sample,
- CsvFileImportResult importResult) {
- Preconditions.checkNotNull(operation);
- Preconditions.checkNotNull(sample);
- Sample result = create(dao, sample);
- operation.addSample(result);
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.Sample);
- return result;
- }
-
- private SampleData addSampleData(SampleDataDAO dao,
- SampleDataType sampleDataType,
- String label,
- float value,
- Sample sample,
- CsvFileImportResult importResult) {
- SampleData sampleData = create(
- dao,
- SampleData.PROPERTY_SAMPLE_DATA_TYPE, sampleDataType,
- SampleData.PROPERTY_DATA_VALUE, value,
- SampleData.PROPERTY_DATA_LABEL, label
-
- );
-// sampleData.setSampleDataType(sampleDataType);
-// sampleData.setDataValue(value);
-// sampleData.setDataLabel(label);
- sample.addSampleData(sampleData);
-
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.SampleData);
- return sampleData;
- }
-
-}
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportConfiguration.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportConfiguration.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportConfiguration.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,87 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata;
+
+import fr.ifremer.echobase.InputFile;
+
+import java.util.Locale;
+
+import static org.nuiton.i18n.I18n.l_;
+
+/**
+ * Configuration of a "catches data import".
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class CatchesImportConfiguration extends AbstractImportConfiguration {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Selected voyage id where to import datas. */
+ protected String voyageId;
+
+ /** Sample file to import. */
+ protected final InputFile totalSampleFile;
+
+ /** Sub sample file to import. */
+ protected final InputFile subSampleFile;
+
+ /** Biometry sample file to import. */
+ protected final InputFile biometrySampleFile;
+
+ public CatchesImportConfiguration(Locale locale) {
+ totalSampleFile = InputFile.newFile(
+ l_(locale, "echobase.common.totalSampleFile"));
+ subSampleFile = InputFile.newFile(
+ l_(locale, "echobase.common.subSampleFile"));
+ biometrySampleFile = InputFile.newFile(
+ l_(locale, "echobase.common.biometrySampleFile"));
+ }
+
+ public String getVoyageId() {
+ return voyageId;
+ }
+
+ public void setVoyageId(String voyageId) {
+ this.voyageId = voyageId;
+ }
+
+ public InputFile getTotalSampleFile() {
+ return totalSampleFile;
+ }
+
+ public InputFile getSubSampleFile() {
+ return subSampleFile;
+ }
+
+ public InputFile getBiometrySampleFile() {
+ return biometrySampleFile;
+ }
+
+ @Override
+ public InputFile[] getInputFiles() {
+ return new InputFile[]{totalSampleFile, subSampleFile, biometrySampleFile};
+ }
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportConfiguration.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportService.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportService.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportService.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportService.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,550 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Maps;
+import fr.ifremer.echobase.EchoBaseFunctions;
+import fr.ifremer.echobase.EchoBasePredicates;
+import fr.ifremer.echobase.InputFile;
+import fr.ifremer.echobase.csv.CsvFileImportResult;
+import fr.ifremer.echobase.csv.EchoBaseImport;
+import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
+import fr.ifremer.echobase.entities.EchoBaseUser;
+import fr.ifremer.echobase.entities.data.Operation;
+import fr.ifremer.echobase.entities.data.Sample;
+import fr.ifremer.echobase.entities.data.SampleDAO;
+import fr.ifremer.echobase.entities.data.SampleData;
+import fr.ifremer.echobase.entities.data.SampleDataDAO;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.SampleDataType;
+import fr.ifremer.echobase.entities.references.SampleDataTypeDAO;
+import fr.ifremer.echobase.entities.references.SampleType;
+import fr.ifremer.echobase.entities.references.SampleTypeDAO;
+import fr.ifremer.echobase.entities.references.SexCategory;
+import fr.ifremer.echobase.entities.references.SizeCategory;
+import fr.ifremer.echobase.entities.references.Species;
+import fr.ifremer.echobase.entities.references.SpeciesCategory;
+import fr.ifremer.echobase.entities.references.SpeciesCategoryDAO;
+import fr.ifremer.echobase.services.ImportException;
+import fr.ifremer.echobase.services.importdata.csv.BiometrySampleImportModel;
+import fr.ifremer.echobase.services.importdata.csv.BiometrySampleImportRow;
+import fr.ifremer.echobase.services.importdata.csv.SubSampleImportModel;
+import fr.ifremer.echobase.services.importdata.csv.SubSampleImportRow;
+import fr.ifremer.echobase.services.importdata.csv.TotalSampleImportModel;
+import fr.ifremer.echobase.services.importdata.csv.TotalSampleImportRow;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.csv.Import;
+import org.nuiton.util.csv.ImportRuntimeException;
+
+import java.io.Reader;
+import java.util.Collection;
+import java.util.Locale;
+import java.util.Map;
+
+import static org.nuiton.i18n.I18n.l_;
+
+/**
+ * Service to launch a "catches sample data" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class CatchesImportService extends AbstractImportDataService<CatchesImportConfiguration> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(CatchesImportService.class);
+
+ @Override
+ protected String getImportLabel() {
+ return l_(getLocale(), ImportMode.Catches.getI18nKey());
+ }
+
+ @Override
+ protected void startImport(CatchesImportConfiguration configuration,
+ EchoBaseUser user) throws ImportException {
+
+ Voyage voyage = getEntityById(Voyage.class,
+ configuration.getVoyageId());
+
+ // get all operation for this voyage and this vessel
+ Collection<Operation> operations = voyage.getAllOperations();
+
+ // split them by operation Id
+ Map<String, Operation> operationMap = Maps.uniqueIndex(
+ operations, EchoBaseFunctions.OPERATION_ID);
+
+ Map<String, Species> speciesMap = getEntitiesMap(
+ Species.class,
+ EchoBaseFunctions.SPECIES_BARACOUDA_CODE);
+
+ Map<String, SizeCategory> sizeCategoryMap = getEntitiesMap(
+ SizeCategory.class,
+ EchoBaseFunctions.SIZE_CATEGORY_NAME);
+
+
+ InputFile inputFile;
+ CsvFileImportResult importResult;
+
+ inputFile = configuration.getTotalSampleFile();
+ if (inputFile.hasFile()) {
+
+ importResult = importTotalSampleFile(
+ configuration,
+ inputFile,
+ operationMap,
+ speciesMap,
+ sizeCategoryMap);
+ configuration.addResult(importResult);
+ }
+
+ inputFile = configuration.getSubSampleFile();
+ if (inputFile.hasFile()) {
+
+ importResult = importSubSampleFile(
+ configuration,
+ inputFile,
+ operationMap,
+ speciesMap,
+ sizeCategoryMap
+ );
+ configuration.addResult(importResult);
+ }
+
+ inputFile = configuration.getBiometrySampleFile();
+ if (inputFile.hasFile()) {
+
+ importResult = importBiometrySampleFile(
+ configuration,
+ inputFile,
+ operationMap,
+ speciesMap);
+
+ configuration.addResult(importResult);
+ }
+ }
+
+ private CsvFileImportResult importTotalSampleFile(
+ CatchesImportConfiguration configuration,
+ InputFile inputFile,
+ Map<String, Operation> operationMap,
+ Map<String, Species> speciesMap,
+ Map<String, SizeCategory> sizeCategoryMap) throws ImportException {
+
+ if (log.isInfoEnabled()) {
+ log.info("Starts import of totalSample from file " +
+ inputFile.getFileName());
+ }
+
+ CsvFileImportResult importResult = new CsvFileImportResult(
+ inputFile.getFileName());
+
+ TotalSampleImportModel csvModel = new TotalSampleImportModel(getCsvSeparator(),
+ operationMap,
+ speciesMap,
+ sizeCategoryMap
+ );
+
+ SampleDAO sampleDAO = getDAO(Sample.class, SampleDAO.class);
+ SampleDataDAO sampleDataDAO = getDAO(SampleData.class, SampleDataDAO.class);
+ SampleTypeDAO sampleTypeDAO = getDAO(SampleType.class, SampleTypeDAO.class);
+ SampleDataTypeDAO sampleDataTypeDAO = getDAO(SampleDataType.class, SampleDataTypeDAO.class);
+ SpeciesCategoryDAO speciesCategoryDAO = getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class);
+
+ SampleType sampleTypeTotal = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Total");
+ Preconditions.checkNotNull(sampleTypeTotal);
+ SampleType sampleTypeUnsorted = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Unsorted");
+ Preconditions.checkNotNull(sampleTypeUnsorted);
+ SampleType sampleTypeSorted = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Sorted");
+ Preconditions.checkNotNull(sampleTypeSorted);
+
+ SampleDataType sampleDataTypeMeanLength = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "MeanLengthcm");
+ Preconditions.checkNotNull(sampleDataTypeMeanLength);
+ SampleDataType sampleDataTypeMeanWeight = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "MeanWeightg");
+ Preconditions.checkNotNull(sampleDataTypeMeanWeight);
+ SampleDataType sampleDataTypeNoPerKg = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "NoPerKg");
+ Preconditions.checkNotNull(sampleDataTypeNoPerKg);
+
+ Reader reader = getInputFileReader(inputFile);
+ Locale locale = getLocale();
+ try {
+ Import<TotalSampleImportRow> importer =
+ EchoBaseImport.newImport(csvModel, reader);
+
+ configuration.incrementsProgression();
+ for (TotalSampleImportRow row : importer) {
+
+ configuration.incrementsProgression();
+ Operation operation = row.getOperation();
+
+ Species species = row.getSpecies();
+ SizeCategory sizeCategory = row.getSizeCategory();
+
+ SpeciesCategory category = getSpeciesCategory(
+ speciesCategoryDAO,
+ species,
+ sizeCategory,
+ null,
+ null,
+ importResult
+ );
+
+ SampleType sampleType;
+
+ if (EchoBasePredicates.IS_HORS_VRAC.apply(sizeCategory)) {
+
+ // hors vrac case
+ sampleType = sampleTypeUnsorted;
+
+ } else {
+ // none hors vrac case
+ sampleType = sampleTypeTotal;
+ }
+
+ Sample sample = operation.getSample(category, sampleType);
+
+ if (sample != null) {
+
+ // can not have twice same sample
+ throw new ImportException(
+ l_(locale, "echobase.importError.duplicate.sample",
+ operation.getId(),
+ sampleType.getName(),
+ species.getBaracoudaCode(),
+ sizeCategory.getName()));
+ }
+
+ if (sample == null) {
+
+ // must create it
+
+ sample = row.getSample();
+ sample.setSpeciesCategory(category);
+ sample.setSampleType(sampleType);
+
+ sample = addSample(sampleDAO,
+ operation,
+ sample,
+ importResult);
+ } else {
+ sample = sample;
+ }
+
+ // create datas
+
+ if (row.getMeanLength() != null) {
+
+ //create meanLength data
+ addSampleData(sampleDataDAO,
+ sampleDataTypeMeanLength,
+ null,
+ row.getMeanLength(),
+ sample,
+ importResult);
+ }
+
+ if (row.getMeanWeight() != null) {
+
+ //create meanWeight data
+ addSampleData(sampleDataDAO,
+ sampleDataTypeMeanWeight,
+ null,
+ row.getMeanWeight(),
+ sample,
+ importResult);
+ }
+
+ if (row.getNoPerKg() != null) {
+
+ //create noPerKg data
+ addSampleData(sampleDataDAO,
+ sampleDataTypeNoPerKg,
+ null,
+ row.getNoPerKg(),
+ sample,
+ importResult);
+ }
+
+ Sample createdSortedSample = newInstance(sampleDAO);
+ createdSortedSample.setSampleType(sampleTypeSorted);
+ createdSortedSample.setSampleWeight(row.getSortedWeight());
+
+ // create sorted sample
+ addSample(sampleDAO,
+ operation,
+ createdSortedSample,
+ importResult);
+
+
+ }
+
+ return importResult;
+ } catch (ImportRuntimeException e) {
+ throw new ImportException(locale, inputFile, e);
+ } finally {
+ closeReader(reader, inputFile);
+ }
+ }
+
+ private CsvFileImportResult importSubSampleFile(
+ CatchesImportConfiguration configuration,
+ InputFile inputFile,
+ Map<String, Operation> operationMap,
+ Map<String, Species> speciesMap,
+ Map<String, SizeCategory> sizeCategoryMap
+ ) throws ImportException {
+
+ if (log.isInfoEnabled()) {
+ log.info("Starts import of subSample from file " +
+ inputFile.getFileName());
+ }
+
+ Map<String, SexCategory> sexCategoryMap = getEntitiesMap(
+ SexCategory.class,
+ EchoBaseFunctions.SEX_CATEGORY_NAME);
+
+
+ CsvFileImportResult importResult = new CsvFileImportResult(
+ inputFile.getFileName());
+
+ SubSampleImportModel csvModel = new SubSampleImportModel(
+ getCsvSeparator(),
+ operationMap,
+ speciesMap,
+ sizeCategoryMap,
+ sexCategoryMap);
+
+ SampleDAO sampleDAO = getDAO(Sample.class, SampleDAO.class);
+ SampleDataDAO sampleDataDAO = getDAO(SampleData.class, SampleDataDAO.class);
+ SampleTypeDAO sampleTypeDAO = getDAO(SampleType.class, SampleTypeDAO.class);
+ SampleDataTypeDAO sampleDataTypeDAO = getDAO(SampleDataType.class, SampleDataTypeDAO.class);
+ SpeciesCategoryDAO speciesCategoryDAO = getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class);
+
+ SampleType sampleTypeSubsample = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Subsample");
+ Preconditions.checkNotNull(sampleTypeSubsample);
+
+ SampleDataType sampleDataTypeNumberAtLength = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "NumberAtLength");
+ Preconditions.checkNotNull(sampleDataTypeNumberAtLength);
+ SampleDataType sampleDataTypeWeightAtLength = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "WeightAtLengthkg");
+ Preconditions.checkNotNull(sampleDataTypeWeightAtLength);
+
+ Reader reader = getInputFileReader(inputFile);
+ try {
+ Import<SubSampleImportRow> importer =
+ EchoBaseImport.newImport(csvModel, reader);
+
+ configuration.incrementsProgression();
+ for (SubSampleImportRow row : importer) {
+
+ configuration.incrementsProgression();
+ Operation operation = row.getOperation();
+
+ Species species = row.getSpecies();
+ SizeCategory sizeCategory = row.getSizeCategory();
+ SexCategory sexCategory = row.getSexCategory();
+
+ SpeciesCategory category = getSpeciesCategory(
+ speciesCategoryDAO,
+ species,
+ sizeCategory,
+ null,
+ sexCategory,
+ importResult
+ );
+
+ // find the sample with this category
+ Sample sample = operation.getSample(category,
+ sampleTypeSubsample);
+
+ if (sample == null) {
+
+ // must create it
+ sample = row.getSample();
+
+ sample.setSpeciesCategory(category);
+ sample.setSampleType(sampleTypeSubsample);
+
+ sample = addSample(sampleDAO,
+ operation,
+ sample,
+ importResult);
+ }
+
+ //create numberAtLength data
+ addSampleData(sampleDataDAO,
+ sampleDataTypeNumberAtLength,
+ "" + row.getLengthClass(),
+ row.getNumberAtLength(),
+ sample,
+ importResult);
+
+ if (row.getWeightAtLength() != null) {
+
+ //create weightAtLength data
+ addSampleData(sampleDataDAO,
+ sampleDataTypeWeightAtLength,
+ "" + row.getLengthClass(),
+ row.getWeightAtLength(),
+ sample,
+ importResult);
+ }
+ }
+
+ return importResult;
+ } catch (ImportRuntimeException e) {
+ throw new ImportException(getLocale(), inputFile, e);
+ } finally {
+ closeReader(reader, inputFile);
+ }
+ }
+
+ private CsvFileImportResult importBiometrySampleFile(
+ CatchesImportConfiguration configuration,
+ InputFile inputFile,
+ Map<String, Operation> operationMap,
+ Map<String, Species> speciesMap
+ ) throws ImportException {
+
+ if (log.isInfoEnabled()) {
+ log.info("Starts import of biometrySample from file " +
+ inputFile.getFileName());
+ }
+
+ Map<String, SampleDataType> sampleDataTypeMap = getEntitiesMap(
+ SampleDataType.class,
+ EchoBaseFunctions.SAMPLE_DATA_TYPE_NAME);
+
+ CsvFileImportResult importResult = new CsvFileImportResult(
+ inputFile.getFileName());
+
+ BiometrySampleImportModel csvModel =
+ new BiometrySampleImportModel(getCsvSeparator(),
+ operationMap,
+ speciesMap,
+ sampleDataTypeMap);
+
+ SampleDAO sampleDAO = getDAO(Sample.class, SampleDAO.class);
+ SampleDataDAO sampleDataDAO = getDAO(SampleData.class, SampleDataDAO.class);
+ SampleTypeDAO sampleTypeDAO = getDAO(SampleType.class, SampleTypeDAO.class);
+ SpeciesCategoryDAO speciesCategoryDAO = getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class);
+
+ SampleType sampleTypeIndividual = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Individual");
+ Preconditions.checkNotNull(sampleTypeIndividual);
+
+ Map<String, Sample> samples = Maps.newTreeMap();
+
+ Reader reader = getInputFileReader(inputFile);
+ try {
+ Import<BiometrySampleImportRow> importer =
+ EchoBaseImport.newImport(csvModel, reader);
+
+ configuration.incrementsProgression();
+ for (BiometrySampleImportRow row : importer) {
+
+ configuration.incrementsProgression();
+ Operation operation = row.getOperation();
+
+ Species species = row.getSpecies();
+
+ int numFish = row.getNumFish();
+
+ String sampleKey = operation.getId() + "_" + species.getBaracoudaCode() + "_" + numFish;
+
+ Sample sample = samples.get(sampleKey);
+
+ if (sample == null) {
+
+ // create a new sample
+ sample = newInstance(sampleDAO);
+
+ sample.setSampleType(sampleTypeIndividual);
+
+ SpeciesCategory category = getSpeciesCategory(
+ speciesCategoryDAO,
+ species,
+ null,
+ null,
+ null,
+ importResult
+ );
+
+ sample.setSpeciesCategory(category);
+
+ sample = addSample(sampleDAO,
+ operation,
+ sample,
+ importResult);
+
+ samples.put(sampleKey, sample);
+ }
+
+ SampleData sampleData = row.getSampleData();
+
+ SampleData sampleDataCreated = create(sampleDataDAO, sampleData);
+ sample.addSampleData(sampleDataCreated);
+ importResult.incrementsNumberCreated(EchoBaseEntityEnum.SampleData);
+ }
+
+ return importResult;
+ } catch (ImportRuntimeException e) {
+ throw new ImportException(getLocale(), inputFile, e);
+ } finally {
+ closeReader(reader, inputFile);
+ }
+ }
+
+ private Sample addSample(SampleDAO dao,
+ Operation operation,
+ Sample sample,
+ CsvFileImportResult importResult) {
+ Preconditions.checkNotNull(operation);
+ Preconditions.checkNotNull(sample);
+ Sample result = create(dao, sample);
+ operation.addSample(result);
+ importResult.incrementsNumberCreated(EchoBaseEntityEnum.Sample);
+ return result;
+ }
+
+ private SampleData addSampleData(SampleDataDAO dao,
+ SampleDataType sampleDataType,
+ String label,
+ float value,
+ Sample sample,
+ CsvFileImportResult importResult) {
+ SampleData sampleData = create(
+ dao,
+ SampleData.PROPERTY_SAMPLE_DATA_TYPE, sampleDataType,
+ SampleData.PROPERTY_DATA_VALUE, value,
+ SampleData.PROPERTY_DATA_LABEL, label
+
+ );
+ sample.addSampleData(sampleData);
+
+ importResult.incrementsNumberCreated(EchoBaseEntityEnum.SampleData);
+ return sampleData;
+ }
+
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportConfiguration.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,186 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata;
-
-import fr.ifremer.echobase.InputFile;
-
-import java.util.Locale;
-
-import static org.nuiton.i18n.I18n.l_;
-
-/**
- * Configuration of a "common data complete" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CommonDataImportConfiguration extends AbstractImportConfiguration {
-
- private static final long serialVersionUID = 1L;
-
- /** Selected import mode. */
- protected CommonDataImportMode importMode;
-
- /** Selected mission id to use in voyage. */
- protected String missionId;
-
- /** Selected voyage id to use (in mode 2). */
- protected String voyageId;
-
- /** Selected area of operation to use for voyage. */
- protected String areaOfOperationId;
-
- /** Manual description of voyage. */
- protected String voyageDescription;
-
- /** transit related activity. */
- protected String transitRelatedActivity;
-
- /** transect license. */
- protected String transectLicence;
-
- /** transect geospatialVerticalPositive. */
- protected String transectGeospatialVerticalPositive = "down";
-
- /** transect binUnitsPingAxis. */
- protected String transectBinUnitsPingAxis = "1 nautical mile";
-
- /** Manual datum to use in voyage. */
- protected String datum = "WGS84";
-
- /** Voyage file to import. */
- protected final InputFile voyageFile;
-
- /** Transit file to import. */
- protected final InputFile transitFile;
-
- /** Transect file to import. */
- protected final InputFile transectFile;
-
- public CommonDataImportConfiguration(Locale locale) {
- voyageFile = InputFile.newFile(
- l_(locale, "echobase.common.voyageFile"));
- transitFile = InputFile.newFile(
- l_(locale, "echobase.common.transitFile"));
- transectFile = InputFile.newFile(
- l_(locale, "echobase.common.transectFile"));
- }
-
- public CommonDataImportMode getImportMode() {
- return importMode;
- }
-
- public void setImportMode(CommonDataImportMode importMode) {
- this.importMode = importMode;
- }
-
- public String getMissionId() {
- return missionId;
- }
-
- public void setMissionId(String missionId) {
- this.missionId = missionId;
- }
-
- public String getAreaOfOperationId() {
- return areaOfOperationId;
- }
-
- public void setAreaOfOperationId(String areaOfOperationId) {
- this.areaOfOperationId = areaOfOperationId;
- }
-
- public String getVoyageId() {
- return voyageId;
- }
-
- public void setVoyageId(String voyageId) {
- this.voyageId = voyageId;
- }
-
- public String getVoyageDescription() {
- return voyageDescription;
- }
-
- public void setVoyageDescription(String voyageDescription) {
- this.voyageDescription = voyageDescription;
- }
-
- public String getDatum() {
- return datum;
- }
-
- public void setDatum(String datum) {
- this.datum = datum;
- }
-
- public String getTransitRelatedActivity() {
- return transitRelatedActivity;
- }
-
- public void setTransitRelatedActivity(String transitRelatedActivity) {
- this.transitRelatedActivity = transitRelatedActivity;
- }
-
- public String getTransectLicence() {
- return transectLicence;
- }
-
- public void setTransectLicence(String transectLicence) {
- this.transectLicence = transectLicence;
- }
-
- public String getTransectGeospatialVerticalPositive() {
- return transectGeospatialVerticalPositive;
- }
-
- public void setTransectGeospatialVerticalPositive(String transectGeospatialVerticalPositive) {
- this.transectGeospatialVerticalPositive = transectGeospatialVerticalPositive;
- }
-
- public String getTransectBinUnitsPingAxis() {
- return transectBinUnitsPingAxis;
- }
-
- public void setTransectBinUnitsPingAxis(String transectBinUnitsPingAxis) {
- this.transectBinUnitsPingAxis = transectBinUnitsPingAxis;
- }
-
- public InputFile getVoyageFile() {
- return voyageFile;
- }
-
- public InputFile getTransitFile() {
- return transitFile;
- }
-
- public InputFile getTransectFile() {
- return transectFile;
- }
-
- @Override
- public InputFile[] getInputFiles() {
- return new InputFile[]{voyageFile, transitFile, transectFile};
- }
-}
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,54 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata;
-
-import fr.ifremer.echobase.I18nAble;
-
-import static org.nuiton.i18n.I18n.n_;
-
-/**
- * To define common data import mode.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public enum CommonDataImportMode implements I18nAble {
-
- /** Import Voyage / Transit / Transect. */
- ALL(n_("echobase.common.commonDataImportMode.all")),
-
- /** Import all common data from Transect to Operation. */
- TRANSECT(n_("echobase.common.commonDataImportMode.transect"));
-
- private final String i18nKey;
-
- CommonDataImportMode(String i18nKey) {
- this.i18nKey = i18nKey;
- }
-
- @Override
- public String getI18nKey() {
- return i18nKey;
- }
-}
\ No newline at end of file
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportService.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportService.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,337 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import fr.ifremer.echobase.EchoBaseFunctions;
-import fr.ifremer.echobase.EchoBaseTechnicalException;
-import fr.ifremer.echobase.InputFile;
-import fr.ifremer.echobase.csv.CsvFileImportResult;
-import fr.ifremer.echobase.csv.EchoBaseImport;
-import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
-import fr.ifremer.echobase.entities.EchoBaseUser;
-import fr.ifremer.echobase.entities.data.Transect;
-import fr.ifremer.echobase.entities.data.TransectDAO;
-import fr.ifremer.echobase.entities.data.Transit;
-import fr.ifremer.echobase.entities.data.TransitDAO;
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.entities.data.VoyageDAO;
-import fr.ifremer.echobase.entities.references.AreaOfOperation;
-import fr.ifremer.echobase.entities.references.Mission;
-import fr.ifremer.echobase.entities.references.MissionDAO;
-import fr.ifremer.echobase.entities.references.Vessel;
-import fr.ifremer.echobase.services.ImportException;
-import fr.ifremer.echobase.services.exceptions.MissionNameAlreadyExistException;
-import fr.ifremer.echobase.services.importdata.csv.TransectImportModel;
-import fr.ifremer.echobase.services.importdata.csv.TransectImportRow;
-import fr.ifremer.echobase.services.importdata.csv.TransitImportModel;
-import fr.ifremer.echobase.services.importdata.csv.TransitImportRow;
-import fr.ifremer.echobase.services.importdata.csv.VoyageImportModel;
-import org.nuiton.topia.TopiaException;
-import org.nuiton.util.csv.Import;
-import org.nuiton.util.csv.ImportModel;
-import org.nuiton.util.csv.ImportRuntimeException;
-
-import java.io.Reader;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import static org.nuiton.i18n.I18n.l_;
-
-/**
- * Service to launch a "common data" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CommonDataImportService extends AbstractImportDataService<CommonDataImportConfiguration> {
-
- @Override
- protected String getImportLabel() {
- return l_(getLocale(), ImportDataMode.CommonData.getI18nKey());
- }
-
- @Override
- protected List<CsvFileImportResult> startImport(
- CommonDataImportConfiguration configuration,
- EchoBaseUser user) throws ImportException {
-
- List<CsvFileImportResult> result = Lists.newLinkedList();
-
- // get usable vessels
- Map<String, Vessel> vesselMap = getEntitiesMap(
- Vessel.class, EchoBaseFunctions.VESSEL_NAME);
-
- InputFile transectFile = configuration.getTransectFile();
-
- switch (configuration.getImportMode()) {
-
- case ALL: {
-
- InputFile voyageFile = configuration.getVoyageFile();
- InputFile transitFile = configuration.getTransitFile();
-
- CsvFileImportResult voyageResult = importVoyageFile(
- voyageFile, configuration);
-
- CsvFileImportResult transitResult = importTransitFile(
- transitFile, configuration);
-
- CsvFileImportResult transectResult = importTransectFile(
- transectFile, vesselMap, configuration);
-
- addResultAndLog(result, voyageFile, voyageResult, user);
- addResultAndLog(result, transitFile, transitResult, user);
- addResultAndLog(result, transectFile, transectResult, user);
- }
- break;
- case TRANSECT: {
-
- CsvFileImportResult transectResult = importTransectFile(
- transectFile, vesselMap, configuration);
-
- addResultAndLog(result, transectFile, transectResult, user);
- }
- break;
- }
- return result;
- }
-
-
- public Mission createMission(Mission mission) throws MissionNameAlreadyExistException {
-
- Preconditions.checkNotNull(mission);
-
- try {
- MissionDAO dao = getDAO(Mission.class, MissionDAO.class);
-
- // check mission name is unique
- boolean exists = dao.existByProperties(Mission.PROPERTY_NAME,
- mission.getName());
-
- if (exists) {
- throw new MissionNameAlreadyExistException();
- }
- Mission result = create(dao, mission);
- commitTransaction("Could not create mission " +
- mission.getName());
- return result;
- } catch (TopiaException eee) {
- throw new EchoBaseTechnicalException(eee);
- }
- }
-
- protected CsvFileImportResult importVoyageFile(
- InputFile inputFile,
- CommonDataImportConfiguration configuration) throws ImportException {
-
- Mission mission = getEntityById(Mission.class,
- configuration.getMissionId());
- AreaOfOperation areaOfOperation =
- getEntityById(AreaOfOperation.class,
- configuration.getAreaOfOperationId());
-
- CsvFileImportResult importResult = new CsvFileImportResult(
- inputFile.getFileName());
-
- String voyageDescription = configuration.getVoyageDescription();
- String datum = configuration.getDatum();
-
- VoyageDAO dao = getDAO(Voyage.class, VoyageDAO.class);
-
- ImportModel<Voyage> csvModel = new VoyageImportModel(getCsvSeparator());
-
- Voyage newVoyage = null;
- Locale locale = getLocale();
- Reader reader = getInputFileReader(inputFile);
- try {
- Import<Voyage> importer = EchoBaseImport.newImport(csvModel, reader);
-
- configuration.incrementsProgression();
- for (Voyage voyage : importer) {
-
- configuration.incrementsProgression();
-
- voyage.setMission(mission);
- voyage.setAreaOfOperation(areaOfOperation);
- voyage.setDescription(voyageDescription);
- voyage.setDatum(datum);
-
- Voyage createdVoyage = create(dao, voyage);
- if (newVoyage == null) {
- newVoyage = createdVoyage;
- } else {
- // this means a voyage file with more than one row not possible...
-
- throw new ImportException(
- l_(locale, "echobase.importError.can.only.import.one.voyage.atime"));
- }
-
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.Voyage);
- }
-
- if (newVoyage == null) {
- throw new ImportException(
- l_(locale, "echobase.importError.no.voyage.imported"));
- }
-
- // push back to id of the voyage in configuration for next imports
- configuration.setVoyageId(newVoyage.getTopiaId());
-
- return importResult;
- } catch (ImportRuntimeException e) {
- throw new ImportException(locale, inputFile, e);
- } finally {
- closeReader(reader, inputFile);
- }
- }
-
- protected CsvFileImportResult importTransitFile(
- InputFile inputFile,
- CommonDataImportConfiguration configuration) throws ImportException {
-
- CsvFileImportResult importResult = new CsvFileImportResult(
- inputFile.getFileName());
-
- // get voyage
- Voyage voyage = getEntityById(Voyage.class,
- configuration.getVoyageId());
-
- // restrict voyage to use to this voyage
- Map<String, Voyage> voyageMap = Maps.uniqueIndex(
- Arrays.asList(voyage), EchoBaseFunctions.VOYAGE_NAME);
-
- String relatedActivity = configuration.getTransitRelatedActivity();
-
- TransitImportModel csvModel =
- new TransitImportModel(getCsvSeparator(), voyageMap);
-
- TransitDAO dao = getDAO(Transit.class, TransitDAO.class);
-
- Reader reader = getInputFileReader(inputFile);
- try {
- Import<TransitImportRow> importer =
- EchoBaseImport.newImport(csvModel, reader);
-
- configuration.incrementsProgression();
- for (TransitImportRow row : importer) {
-
- configuration.incrementsProgression();
- Transit transit = row.getTransit();
-
- transit.setRelatedActivity(relatedActivity);
-
- Transit createdTransit = create(dao, transit);
-
- voyage.addTransit(createdTransit);
-
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.Transit);
- }
- return importResult;
- } catch (ImportRuntimeException e) {
- throw new ImportException(getLocale(), inputFile, e);
- } finally {
- closeReader(reader, inputFile);
- }
- }
-
- private CsvFileImportResult importTransectFile(
- InputFile inputFile,
- Map<String, Vessel> vesselMap,
- CommonDataImportConfiguration configuration) throws ImportException {
-
- CsvFileImportResult importResult = new CsvFileImportResult(
- inputFile.getFileName());
-
- // get voyage
- Voyage voyage = getEntityById(Voyage.class,
- configuration.getVoyageId());
-
- // restrict voyage to use to this voyage
- Map<String, Voyage> voyageMap = Maps.uniqueIndex(
- Arrays.asList(voyage), EchoBaseFunctions.VOYAGE_NAME);
-
- String datum = configuration.getDatum();
- String license = configuration.getTransectLicence();
- String geospatialVerticalPositive =
- configuration.getTransectGeospatialVerticalPositive();
- String binUnitsPingAxis = configuration.getTransectBinUnitsPingAxis();
-
- TransectImportModel csvModel =
- new TransectImportModel(getCsvSeparator(),
- voyageMap,
- vesselMap);
-
- TransectDAO dao = getDAO(Transect.class, TransectDAO.class);
-
- Reader reader = getInputFileReader(inputFile);
- try {
- Import<TransectImportRow> importer =
- EchoBaseImport.newImport(csvModel, reader);
-
- configuration.incrementsProgression();
- for (TransectImportRow row : importer) {
-
- configuration.incrementsProgression();
- Transect transect = row.getTransect();
-
- Date timeCoverageStart = transect.getTimeCoverageStart();
- Date timeCoverageEnd = transect.getTimeCoverageEnd();
-
- Transit transit = voyage.getTransit(timeCoverageStart,
- timeCoverageEnd);
- if (transit == null) {
- throw new ImportException(
- l_(getLocale(), "echobase.importError.no.transit.between.date",
- voyage.getName(), timeCoverageStart, timeCoverageEnd));
- }
-
- transect.setDatum(datum);
- transect.setLicence(license);
- transect.setGeospatialVerticalPositive(
- geospatialVerticalPositive);
- transect.setBinUnitsPingAxis(binUnitsPingAxis);
-
- Transect createdTransect = create(dao, transect);
-
- transit.addTransect(createdTransect);
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.Transect);
- }
-
- return importResult;
-
- } catch (ImportRuntimeException e) {
- throw new ImportException(getLocale(), inputFile, e);
- } finally {
- closeReader(reader, inputFile);
- }
- }
-
-
-}
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportConfiguration.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportConfiguration.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportConfiguration.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,186 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata;
+
+import fr.ifremer.echobase.InputFile;
+
+import java.util.Locale;
+
+import static org.nuiton.i18n.I18n.l_;
+
+/**
+ * Configuration of a "common data complete" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class CommonImportConfiguration extends AbstractImportConfiguration {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Selected import mode. */
+ protected CommonImportMode importMode;
+
+ /** Selected mission id to use in voyage. */
+ protected String missionId;
+
+ /** Selected voyage id to use (in mode 2). */
+ protected String voyageId;
+
+ /** Selected area of operation to use for voyage. */
+ protected String areaOfOperationId;
+
+ /** Manual description of voyage. */
+ protected String voyageDescription;
+
+ /** transit related activity. */
+ protected String transitRelatedActivity;
+
+ /** transect license. */
+ protected String transectLicence;
+
+ /** transect geospatialVerticalPositive. */
+ protected String transectGeospatialVerticalPositive = "down";
+
+ /** transect binUnitsPingAxis. */
+ protected String transectBinUnitsPingAxis = "1 nautical mile";
+
+ /** Manual datum to use in voyage. */
+ protected String datum = "WGS84";
+
+ /** Voyage file to import. */
+ protected final InputFile voyageFile;
+
+ /** Transit file to import. */
+ protected final InputFile transitFile;
+
+ /** Transect file to import. */
+ protected final InputFile transectFile;
+
+ public CommonImportConfiguration(Locale locale) {
+ voyageFile = InputFile.newFile(
+ l_(locale, "echobase.common.voyageFile"));
+ transitFile = InputFile.newFile(
+ l_(locale, "echobase.common.transitFile"));
+ transectFile = InputFile.newFile(
+ l_(locale, "echobase.common.transectFile"));
+ }
+
+ public CommonImportMode getImportMode() {
+ return importMode;
+ }
+
+ public void setImportMode(CommonImportMode importMode) {
+ this.importMode = importMode;
+ }
+
+ public String getMissionId() {
+ return missionId;
+ }
+
+ public void setMissionId(String missionId) {
+ this.missionId = missionId;
+ }
+
+ public String getAreaOfOperationId() {
+ return areaOfOperationId;
+ }
+
+ public void setAreaOfOperationId(String areaOfOperationId) {
+ this.areaOfOperationId = areaOfOperationId;
+ }
+
+ public String getVoyageId() {
+ return voyageId;
+ }
+
+ public void setVoyageId(String voyageId) {
+ this.voyageId = voyageId;
+ }
+
+ public String getVoyageDescription() {
+ return voyageDescription;
+ }
+
+ public void setVoyageDescription(String voyageDescription) {
+ this.voyageDescription = voyageDescription;
+ }
+
+ public String getDatum() {
+ return datum;
+ }
+
+ public void setDatum(String datum) {
+ this.datum = datum;
+ }
+
+ public String getTransitRelatedActivity() {
+ return transitRelatedActivity;
+ }
+
+ public void setTransitRelatedActivity(String transitRelatedActivity) {
+ this.transitRelatedActivity = transitRelatedActivity;
+ }
+
+ public String getTransectLicence() {
+ return transectLicence;
+ }
+
+ public void setTransectLicence(String transectLicence) {
+ this.transectLicence = transectLicence;
+ }
+
+ public String getTransectGeospatialVerticalPositive() {
+ return transectGeospatialVerticalPositive;
+ }
+
+ public void setTransectGeospatialVerticalPositive(String transectGeospatialVerticalPositive) {
+ this.transectGeospatialVerticalPositive = transectGeospatialVerticalPositive;
+ }
+
+ public String getTransectBinUnitsPingAxis() {
+ return transectBinUnitsPingAxis;
+ }
+
+ public void setTransectBinUnitsPingAxis(String transectBinUnitsPingAxis) {
+ this.transectBinUnitsPingAxis = transectBinUnitsPingAxis;
+ }
+
+ public InputFile getVoyageFile() {
+ return voyageFile;
+ }
+
+ public InputFile getTransitFile() {
+ return transitFile;
+ }
+
+ public InputFile getTransectFile() {
+ return transectFile;
+ }
+
+ @Override
+ public InputFile[] getInputFiles() {
+ return new InputFile[]{voyageFile, transitFile, transectFile};
+ }
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportConfiguration.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportMode.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportMode.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportMode.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,54 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata;
+
+import fr.ifremer.echobase.I18nAble;
+
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ * To define common data import mode.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public enum CommonImportMode implements I18nAble {
+
+ /** Import Voyage / Transit / Transect. */
+ ALL(n_("echobase.common.commonDataImportMode.all")),
+
+ /** Import all common data from Transect to Operation. */
+ TRANSECT(n_("echobase.common.commonDataImportMode.transect"));
+
+ private final String i18nKey;
+
+ CommonImportMode(String i18nKey) {
+ this.i18nKey = i18nKey;
+ }
+
+ @Override
+ public String getI18nKey() {
+ return i18nKey;
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportMode.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportService.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportService.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportService.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportService.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,347 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Maps;
+import fr.ifremer.echobase.EchoBaseFunctions;
+import fr.ifremer.echobase.EchoBaseTechnicalException;
+import fr.ifremer.echobase.InputFile;
+import fr.ifremer.echobase.csv.CsvFileImportResult;
+import fr.ifremer.echobase.csv.EchoBaseImport;
+import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
+import fr.ifremer.echobase.entities.EchoBaseUser;
+import fr.ifremer.echobase.entities.data.Transect;
+import fr.ifremer.echobase.entities.data.TransectDAO;
+import fr.ifremer.echobase.entities.data.Transit;
+import fr.ifremer.echobase.entities.data.TransitDAO;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.data.VoyageDAO;
+import fr.ifremer.echobase.entities.references.AreaOfOperation;
+import fr.ifremer.echobase.entities.references.Mission;
+import fr.ifremer.echobase.entities.references.MissionDAO;
+import fr.ifremer.echobase.entities.references.Vessel;
+import fr.ifremer.echobase.services.ImportException;
+import fr.ifremer.echobase.services.exceptions.MissionNameAlreadyExistException;
+import fr.ifremer.echobase.services.importdata.csv.TransectImportModel;
+import fr.ifremer.echobase.services.importdata.csv.TransectImportRow;
+import fr.ifremer.echobase.services.importdata.csv.TransitImportModel;
+import fr.ifremer.echobase.services.importdata.csv.TransitImportRow;
+import fr.ifremer.echobase.services.importdata.csv.VoyageImportModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.util.csv.Import;
+import org.nuiton.util.csv.ImportModel;
+import org.nuiton.util.csv.ImportRuntimeException;
+
+import java.io.Reader;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Map;
+
+import static org.nuiton.i18n.I18n.l_;
+
+/**
+ * Service to launch a "common data" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class CommonImportService extends AbstractImportDataService<CommonImportConfiguration> {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(CommonImportService.class);
+
+ @Override
+ protected String getImportLabel() {
+ return l_(getLocale(), ImportMode.Common.getI18nKey());
+ }
+
+ @Override
+ protected void startImport(
+ CommonImportConfiguration configuration,
+ EchoBaseUser user) throws ImportException {
+
+ // get usable vessels
+ Map<String, Vessel> vesselMap = getEntitiesMap(
+ Vessel.class, EchoBaseFunctions.VESSEL_NAME);
+
+ switch (configuration.getImportMode()) {
+
+ case ALL: {
+
+ CsvFileImportResult importResult;
+
+ importResult = importVoyageFile(configuration);
+ configuration.addResult(importResult);
+
+ importResult = importTransitFile(configuration);
+ configuration.addResult(importResult);
+
+ importResult = importTransectFile(vesselMap, configuration);
+ configuration.addResult(importResult);
+ }
+ break;
+ case TRANSECT: {
+
+ CsvFileImportResult importResult;
+
+ importResult = importTransectFile(vesselMap, configuration);
+ configuration.addResult(importResult);
+ }
+ break;
+ }
+ }
+
+
+ public Mission createMission(Mission mission) throws MissionNameAlreadyExistException {
+
+ Preconditions.checkNotNull(mission);
+
+ try {
+ MissionDAO dao = getDAO(Mission.class, MissionDAO.class);
+
+ // check mission name is unique
+ boolean exists = dao.existByProperties(Mission.PROPERTY_NAME,
+ mission.getName());
+
+ if (exists) {
+ throw new MissionNameAlreadyExistException();
+ }
+ Mission result = create(dao, mission);
+ commitTransaction("Could not create mission " +
+ mission.getName());
+ return result;
+ } catch (TopiaException eee) {
+ throw new EchoBaseTechnicalException(eee);
+ }
+ }
+
+ protected CsvFileImportResult importVoyageFile(
+ CommonImportConfiguration configuration) throws ImportException {
+
+ InputFile inputFile = configuration.getVoyageFile();
+
+ if (log.isInfoEnabled()) {
+ log.info("Starts import of voyages from file " +
+ inputFile.getFileName());
+ }
+
+ Mission mission = getEntityById(Mission.class,
+ configuration.getMissionId());
+ AreaOfOperation areaOfOperation =
+ getEntityById(AreaOfOperation.class,
+ configuration.getAreaOfOperationId());
+
+ CsvFileImportResult importResult = new CsvFileImportResult(
+ inputFile.getFileName());
+
+ String voyageDescription = configuration.getVoyageDescription();
+ String datum = configuration.getDatum();
+
+ VoyageDAO dao = getDAO(Voyage.class, VoyageDAO.class);
+
+ ImportModel<Voyage> csvModel = new VoyageImportModel(getCsvSeparator());
+
+ Voyage newVoyage = null;
+ Locale locale = getLocale();
+ Reader reader = getInputFileReader(inputFile);
+ try {
+ Import<Voyage> importer = EchoBaseImport.newImport(csvModel, reader);
+
+ configuration.incrementsProgression();
+ for (Voyage voyage : importer) {
+
+ configuration.incrementsProgression();
+
+ voyage.setMission(mission);
+ voyage.setAreaOfOperation(areaOfOperation);
+ voyage.setDescription(voyageDescription);
+ voyage.setDatum(datum);
+
+ Voyage createdVoyage = create(dao, voyage);
+ if (newVoyage == null) {
+ newVoyage = createdVoyage;
+ } else {
+ // this means a voyage file with more than one row not possible...
+
+ throw new ImportException(
+ l_(locale, "echobase.importError.can.only.import.one.voyage.atime"));
+ }
+
+ importResult.incrementsNumberCreated(EchoBaseEntityEnum.Voyage);
+ }
+
+ if (newVoyage == null) {
+ throw new ImportException(
+ l_(locale, "echobase.importError.no.voyage.imported"));
+ }
+
+ // push back to id of the voyage in configuration for next imports
+ configuration.setVoyageId(newVoyage.getTopiaId());
+
+ return importResult;
+ } catch (ImportRuntimeException e) {
+ throw new ImportException(locale, inputFile, e);
+ } finally {
+ closeReader(reader, inputFile);
+ }
+ }
+
+ protected CsvFileImportResult importTransitFile(
+ CommonImportConfiguration configuration) throws ImportException {
+
+ InputFile inputFile = configuration.getTransitFile();
+
+ if (log.isInfoEnabled()) {
+ log.info("Starts import of transits from file " +
+ inputFile.getFileName());
+ }
+ CsvFileImportResult importResult = new CsvFileImportResult(
+ inputFile.getFileName());
+
+ // get voyage
+ Voyage voyage = getEntityById(Voyage.class,
+ configuration.getVoyageId());
+
+ // restrict voyage to use to this voyage
+ Map<String, Voyage> voyageMap = Maps.uniqueIndex(
+ Arrays.asList(voyage), EchoBaseFunctions.VOYAGE_NAME);
+
+ String relatedActivity = configuration.getTransitRelatedActivity();
+
+ TransitImportModel csvModel =
+ new TransitImportModel(getCsvSeparator(), voyageMap);
+
+ TransitDAO dao = getDAO(Transit.class, TransitDAO.class);
+
+ Reader reader = getInputFileReader(inputFile);
+ try {
+ Import<TransitImportRow> importer =
+ EchoBaseImport.newImport(csvModel, reader);
+
+ configuration.incrementsProgression();
+ for (TransitImportRow row : importer) {
+
+ configuration.incrementsProgression();
+ Transit transit = row.getTransit();
+
+ transit.setRelatedActivity(relatedActivity);
+
+ Transit createdTransit = create(dao, transit);
+
+ voyage.addTransit(createdTransit);
+
+ importResult.incrementsNumberCreated(EchoBaseEntityEnum.Transit);
+ }
+ return importResult;
+ } catch (ImportRuntimeException e) {
+ throw new ImportException(getLocale(), inputFile, e);
+ } finally {
+ closeReader(reader, inputFile);
+ }
+ }
+
+ private CsvFileImportResult importTransectFile(
+ Map<String, Vessel> vesselMap,
+ CommonImportConfiguration configuration) throws ImportException {
+
+ InputFile inputFile = configuration.getTransectFile();
+
+ if (log.isInfoEnabled()) {
+ log.info("Starts import of transects from file " +
+ inputFile.getFileName());
+ }
+
+ CsvFileImportResult importResult = new CsvFileImportResult(
+ inputFile.getFileName());
+
+ // get voyage
+ Voyage voyage = getEntityById(Voyage.class,
+ configuration.getVoyageId());
+
+ // restrict voyage to use to this voyage
+ Map<String, Voyage> voyageMap = Maps.uniqueIndex(
+ Arrays.asList(voyage), EchoBaseFunctions.VOYAGE_NAME);
+
+ String datum = configuration.getDatum();
+ String license = configuration.getTransectLicence();
+ String geospatialVerticalPositive =
+ configuration.getTransectGeospatialVerticalPositive();
+ String binUnitsPingAxis = configuration.getTransectBinUnitsPingAxis();
+
+ TransectImportModel csvModel =
+ new TransectImportModel(getCsvSeparator(),
+ voyageMap,
+ vesselMap);
+
+ TransectDAO dao = getDAO(Transect.class, TransectDAO.class);
+
+ Reader reader = getInputFileReader(inputFile);
+ try {
+ Import<TransectImportRow> importer =
+ EchoBaseImport.newImport(csvModel, reader);
+
+ configuration.incrementsProgression();
+ for (TransectImportRow row : importer) {
+
+ configuration.incrementsProgression();
+ Transect transect = row.getTransect();
+
+ Date timeCoverageStart = transect.getTimeCoverageStart();
+ Date timeCoverageEnd = transect.getTimeCoverageEnd();
+
+ Transit transit = voyage.getTransit(timeCoverageStart,
+ timeCoverageEnd);
+ if (transit == null) {
+ throw new ImportException(
+ l_(getLocale(), "echobase.importError.no.transit.between.date",
+ voyage.getName(), timeCoverageStart, timeCoverageEnd));
+ }
+
+ transect.setDatum(datum);
+ transect.setLicence(license);
+ transect.setGeospatialVerticalPositive(
+ geospatialVerticalPositive);
+ transect.setBinUnitsPingAxis(binUnitsPingAxis);
+
+ Transect createdTransect = create(dao, transect);
+
+ transit.addTransect(createdTransect);
+ importResult.incrementsNumberCreated(EchoBaseEntityEnum.Transect);
+ }
+
+ return importResult;
+
+ } catch (ImportRuntimeException e) {
+ throw new ImportException(getLocale(), inputFile, e);
+ } finally {
+ closeReader(reader, inputFile);
+ }
+ }
+
+
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportDataMode.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportDataMode.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportDataMode.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,63 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata;
-
-import fr.ifremer.echobase.I18nAble;
-
-import static org.nuiton.i18n.I18n.n_;
-
-/**
- * To define the mode of import data (says files to be imported).
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public enum ImportDataMode implements I18nAble {
-
- /** Import Voyage / Transit / Transect. */
- CommonData(n_("echobase.common.importDataMode.commonData")),
-
- /** Import operations common data. */
- Operation(n_("echobase.common.importDataMode.operation")),
-
- /** Import catches data (unsorted, total, but no individual ones). */
- CatchesData(n_("echobase.common.importDataMode.catchesData")),
-
- /** Import accoustic data (Cells ESDU and Elementary). */
- AccousticData(n_("echobase.common.importDataMode.accousticData")),
-
- /** Import results. */
- Results(n_("echobase.common.importDataMode.results"));
-
- private final String i18nKey;
-
- ImportDataMode(String i18nKey) {
- this.i18nKey = i18nKey;
- }
-
- @Override
- public String getI18nKey() {
- return i18nKey;
- }
-}
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportMode.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportDataMode.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportMode.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportMode.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,63 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata;
+
+import fr.ifremer.echobase.I18nAble;
+
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ * To define the mode of import data (says files to be imported).
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public enum ImportMode implements I18nAble {
+
+ /** Import Voyage / Transit / Transect. */
+ Common(n_("echobase.common.importMode.common")),
+
+ /** Import operations common data. */
+ Operation(n_("echobase.common.importMode.operation")),
+
+ /** Import catches data (unsorted, total, but no individual ones). */
+ Catches(n_("echobase.common.importMode.catches")),
+
+ /** Import accoustic data (Cells ESDU and Elementary). */
+ Acoustic(n_("echobase.common.importMode.acoustic")),
+
+ /** Import results. */
+ Results(n_("echobase.common.importMode.results"));
+
+ private final String i18nKey;
+
+ ImportMode(String i18nKey) {
+ this.i18nKey = i18nKey;
+ }
+
+ @Override
+ public String getI18nKey() {
+ return i18nKey;
+ }
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportMode.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportService.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportService.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -23,7 +23,6 @@
*/
package fr.ifremer.echobase.services.importdata;
-import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import fr.ifremer.echobase.EchoBaseFunctions;
import fr.ifremer.echobase.InputFile;
@@ -60,7 +59,6 @@
import java.io.Reader;
import java.util.Collection;
import java.util.Date;
-import java.util.List;
import java.util.Map;
import static org.nuiton.i18n.I18n.l_;
@@ -79,16 +77,14 @@
@Override
protected String getImportLabel() {
- return l_(getLocale(), ImportDataMode.Operation.getI18nKey());
+ return l_(getLocale(), ImportMode.Operation.getI18nKey());
}
@Override
- protected List<CsvFileImportResult> startImport(
+ protected void startImport(
OperationImportConfiguration configuration,
EchoBaseUser user) throws ImportException {
- List<CsvFileImportResult> result = Lists.newLinkedList();
-
// get selected voyage
Voyage voyage = getEntityById(Voyage.class,
configuration.getVoyageId());
@@ -101,13 +97,14 @@
Map<String, Gear> gearMap = getEntitiesMap(
Gear.class, EchoBaseFunctions.GEAR_CASINO_GEAR_NAME);
- InputFile operationFile = configuration.getOperationFile();
- CsvFileImportResult nbOperations = importOperationFile(
+ CsvFileImportResult importResult;
+
+ importResult = importOperationFile(
configuration,
- operationFile,
voyage,
vesselMap,
gearMap);
+ configuration.addResult(importResult);
// get all operation for this voyage and this vessel
Collection<Operation> operations = voyage.getAllOperations();
@@ -116,37 +113,29 @@
Map<String, Operation> operationMap = Maps.uniqueIndex(
operations, EchoBaseFunctions.OPERATION_ID);
- InputFile operationMetadataFile = configuration.getOperationMetadataFile();
- CsvFileImportResult nbOperationMetas = importOperationMetadataFile(
+ importResult = importOperationMetadataFile(
configuration,
- operationMetadataFile,
vesselMap,
operationMap);
+ configuration.addResult(importResult);
- InputFile gearMetadataFile = configuration.getGearMetadataFile();
- CsvFileImportResult nbGearMetas = importGearMetadataFile(
+ importResult = importGearMetadataFile(
configuration,
- gearMetadataFile,
vesselMap,
gearMap,
operationMap);
-
- addResultAndLog(result, operationFile, nbOperations, user);
-
- addResultAndLog(result, operationMetadataFile, nbOperationMetas, user);
-
- addResultAndLog(result, gearMetadataFile, nbGearMetas, user);
-
- return result;
+ configuration.addResult(importResult);
}
protected CsvFileImportResult importOperationFile(
OperationImportConfiguration configuration,
- InputFile inputFile,
Voyage voyage,
Map<String, Vessel> vesselMap,
Map<String, Gear> gearMap) throws ImportException {
+
+ InputFile inputFile = configuration.getOperationFile();
+
if (log.isInfoEnabled()) {
log.info("Starts import of operation from file " +
inputFile.getFileName());
@@ -203,10 +192,11 @@
protected CsvFileImportResult importOperationMetadataFile(
OperationImportConfiguration configuration,
- InputFile inputFile,
Map<String, Vessel> vesselMap,
Map<String, Operation> operationMap) throws ImportException {
+ InputFile inputFile = configuration.getOperationMetadataFile();
+
if (log.isInfoEnabled()) {
log.info("Starts import of operation metadata values from file " +
inputFile.getFileName());
@@ -258,11 +248,12 @@
protected CsvFileImportResult importGearMetadataFile(
OperationImportConfiguration configuration,
- InputFile inputFile,
Map<String, Vessel> vesselMap,
Map<String, Gear> gearMap,
Map<String, Operation> operationMap) throws ImportException {
+ InputFile inputFile = configuration.getGearMetadataFile();
+
if (log.isInfoEnabled()) {
log.info("Starts import of gear metadata values from file " +
inputFile.getFileName());
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -23,7 +23,6 @@
*/
package fr.ifremer.echobase.services.importdata;
-import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import fr.ifremer.echobase.EchoBaseFunctions;
import fr.ifremer.echobase.InputFile;
@@ -81,11 +80,11 @@
@Override
protected String getImportLabel() {
- return l_(getLocale(), ImportDataMode.Results.getI18nKey());
+ return l_(getLocale(), ImportMode.Results.getI18nKey());
}
@Override
- public List<CsvFileImportResult> startImport(
+ public void startImport(
ResultsImportConfiguration configuration,
EchoBaseUser user) throws ImportException {
@@ -119,13 +118,13 @@
Map<String, Echotype> echotypeMap = Maps.uniqueIndex(
voyage.getEchotype(), EchoBaseFunctions.ECHOTYPE_NAME);
- List<CsvFileImportResult> result = Lists.newLinkedList();
-
InputFile inputFile;
+ CsvFileImportResult importResult;
inputFile = configuration.getEsduByEchotypeFile();
if (inputFile.hasFile()) {
- CsvFileImportResult importResult = importByEchotypeFile(
+
+ importResult = importByEchotypeFile(
configuration,
inputFile,
voyage,
@@ -133,12 +132,12 @@
dataMetadataMap,
esduCellMap
);
- addResultAndLog(result, inputFile, importResult, user);
+ configuration.addResult(importResult);
}
inputFile = configuration.getEsduByEchotypeAndSpeciesCategoryFile();
if (inputFile.hasFile()) {
- CsvFileImportResult importResult = importByEchotypeAndSpeciesCategoryFile(
+ importResult = importByEchotypeAndSpeciesCategoryFile(
configuration,
inputFile,
voyage,
@@ -148,12 +147,12 @@
sizeCategoryMap,
esduCellMap
);
- addResultAndLog(result, inputFile, importResult, user);
+ configuration.addResult(importResult);
}
inputFile = configuration.getEsduBySpeciesAndSizeCategoryFile();
if (inputFile.hasFile()) {
- CsvFileImportResult importResult = importBySpeciesAndSizeCategoryFile(
+ importResult = importBySpeciesAndSizeCategoryFile(
configuration,
inputFile,
voyage,
@@ -162,13 +161,13 @@
sizeCategoryMap,
esduCellMap
);
- addResultAndLog(result, inputFile, importResult, user);
+ configuration.addResult(importResult);
}
inputFile = configuration.getEsduBySpeciesAndAgeCategoryFile();
if (inputFile.hasFile()) {
- CsvFileImportResult importResult = importBySpeciesAndAgeCategoryFile(
+ importResult = importBySpeciesAndAgeCategoryFile(
configuration,
inputFile,
voyage,
@@ -177,9 +176,8 @@
ageCategoryMap,
esduCellMap
);
- addResultAndLog(result, inputFile, importResult, user);
+ configuration.addResult(importResult);
}
- return result;
}
private CsvFileImportResult importByEchotypeFile(
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportService.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportService.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -25,7 +25,6 @@
import com.google.common.collect.Maps;
import fr.ifremer.echobase.EchoBaseTechnicalException;
-import fr.ifremer.echobase.csv.CsvFileImportResult;
import fr.ifremer.echobase.entities.EchoBaseUser;
import fr.ifremer.echobase.entities.data.DataAcquisition;
import fr.ifremer.echobase.entities.data.DataProcessing;
@@ -36,7 +35,6 @@
import fr.ifremer.echobase.services.ImportException;
import org.nuiton.util.decorator.Decorator;
-import java.util.List;
import java.util.Map;
import static org.nuiton.i18n.I18n.l_;
@@ -51,12 +49,12 @@
@Override
protected String getImportLabel() {
- return l_(getLocale(), ImportDataMode.Results.getI18nKey());
+ return l_(getLocale(), ImportMode.Results.getI18nKey());
}
@Override
- public List<CsvFileImportResult> startImport(ResultsImportConfiguration configuration,
- EchoBaseUser user) throws ImportException {
+ public void startImport(ResultsImportConfiguration configuration,
+ EchoBaseUser user) throws ImportException {
ResultsImportMode importMode = configuration.getImportMode();
@@ -87,9 +85,7 @@
"Can not treate import result of type " + importMode);
}
- List<CsvFileImportResult> result;
- result = service.startImport(configuration, user);
- return result;
+ service.startImport(configuration, user);
}
public Map<String, String> getDataProcessings(Voyage voyage) {
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -24,7 +24,6 @@
package fr.ifremer.echobase.services.importdata;
import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import fr.ifremer.echobase.EchoBaseFunctions;
import fr.ifremer.echobase.InputFile;
@@ -76,11 +75,11 @@
@Override
protected String getImportLabel() {
- return l_(getLocale(), ImportDataMode.Results.getI18nKey());
+ return l_(getLocale(), ImportMode.Results.getI18nKey());
}
@Override
- public List<CsvFileImportResult> startImport(
+ public void startImport(
ResultsImportConfiguration configuration,
EchoBaseUser user) throws ImportException {
@@ -88,21 +87,22 @@
Voyage voyage = getEntityById(Voyage.class,
configuration.getVoyageId());
- InputFile inputFile = configuration.getMapsFile();
- CsvFileImportResult importResult = importMapFile(configuration,
- inputFile,
- voyage);
-
- List<CsvFileImportResult> result = Lists.newLinkedList();
- addResultAndLog(result, inputFile, importResult, user);
- return result;
+ CsvFileImportResult importResult;
+ importResult = importMapFile(configuration, voyage);
+ configuration.addResult(importResult);
}
protected CsvFileImportResult importMapFile(
ResultsImportConfiguration configuration,
- InputFile inputFile,
Voyage voyage) throws ImportException {
+ InputFile inputFile = configuration.getMapsFile();
+
+ if (log.isInfoEnabled()) {
+ log.info("Starts import of Map cells from file " +
+ inputFile.getFileName());
+ }
+
String resultLabel = configuration.getResultLabel();
CellType cellType = getEntityByProperty(
@@ -169,11 +169,6 @@
ageCategoryMap,
metas);
- if (log.isInfoEnabled()) {
- log.info("Starts import of Map cells from file " +
- inputFile.getFileName());
- }
-
CsvFileImportResult importResult = new CsvFileImportResult(
inputFile.getFileName());
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -24,7 +24,6 @@
package fr.ifremer.echobase.services.importdata;
import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import fr.ifremer.echobase.EchoBaseFunctions;
import fr.ifremer.echobase.InputFile;
@@ -80,49 +79,36 @@
@Override
protected String getImportLabel() {
- return l_(getLocale(), ImportDataMode.Results.getI18nKey());
+ return l_(getLocale(), ImportMode.Results.getI18nKey());
}
@Override
- public List<CsvFileImportResult> startImport(
+ public void startImport(
ResultsImportConfiguration configuration,
EchoBaseUser user) throws ImportException {
- List<CsvFileImportResult> result = Lists.newLinkedList();
-
// get selected voyage
Voyage voyage = getEntityById(Voyage.class,
configuration.getVoyageId());
- InputFile inputFile = configuration.getRegionsFile();
- CsvFileImportResult importResult = importRegionFile(
- configuration,
- inputFile, voyage);
+ CsvFileImportResult importResult;
- addResultAndLog(result, inputFile, importResult, user);
+ importResult = importRegionFile(configuration, voyage);
+ configuration.addResult(importResult);
- inputFile = configuration.getRegionAssociationFile();
- importResult = importRegionAssociationFile(
- configuration,
- inputFile,
- voyage);
- addResultAndLog(result, inputFile, importResult, user);
+ importResult = importRegionAssociationFile(configuration, voyage);
+ configuration.addResult(importResult);
- inputFile = configuration.getRegionResultFile();
- importResult = importRegionResultFile(
- configuration,
- inputFile, voyage);
-
- addResultAndLog(result, inputFile, importResult, user);
-
- return result;
+ importResult = importRegionResultFile(configuration, voyage);
+ configuration.addResult(importResult);
}
protected CsvFileImportResult importRegionFile(
ResultsImportConfiguration configuration,
- InputFile inputFile,
Voyage voyage) throws ImportException {
+ InputFile inputFile = configuration.getRegionsFile();
+
CellType cellSurfaceType = getEntityByProperty(
CellType.class, CellType.PROPERTY_ID, "RegionSURF");
Preconditions.checkNotNull(cellSurfaceType);
@@ -214,9 +200,10 @@
protected CsvFileImportResult importRegionAssociationFile(
ResultsImportConfiguration configuration,
- InputFile inputFile,
Voyage voyage) throws ImportException {
+ InputFile inputFile = configuration.getRegionAssociationFile();
+
if (log.isInfoEnabled()) {
log.info("Starts import of Region cells association from file " +
inputFile.getFileName());
@@ -265,9 +252,10 @@
protected CsvFileImportResult importRegionResultFile(
ResultsImportConfiguration configuration,
- InputFile inputFile,
Voyage voyage) throws ImportException {
+ InputFile inputFile = configuration.getRegionResultFile();
+
if (log.isInfoEnabled()) {
log.info("Starts import of Map cell results from file " +
inputFile.getFileName());
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsVoyageImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsVoyageImportService.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsVoyageImportService.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -25,7 +25,6 @@
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import fr.ifremer.echobase.EchoBaseFunctions;
import fr.ifremer.echobase.EchoBasePredicates;
@@ -61,7 +60,6 @@
import java.io.Reader;
import java.util.Arrays;
import java.util.Collection;
-import java.util.List;
import java.util.Map;
import static org.nuiton.i18n.I18n.l_;
@@ -80,15 +78,13 @@
@Override
protected String getImportLabel() {
- return l_(getLocale(), ImportDataMode.Results.getI18nKey());
+ return l_(getLocale(), ImportMode.Results.getI18nKey());
}
@Override
- public List<CsvFileImportResult> startImport(ResultsImportConfiguration configuration,
- EchoBaseUser user) throws ImportException {
+ public void startImport(ResultsImportConfiguration configuration,
+ EchoBaseUser user) throws ImportException {
- List<CsvFileImportResult> result = Lists.newLinkedList();
-
Map<String, Species> speciesMap = getEntitiesMap(
Species.class,
EchoBaseFunctions.SPECIES_BARACOUDA_CODE);
@@ -101,44 +97,45 @@
Map<String, Voyage> voyageMap = Maps.uniqueIndex(Arrays.asList(
voyage), EchoBaseFunctions.VOYAGE_NAME);
- InputFile inputFile = configuration.getLengthAgeKeyFile();
+ InputFile inputFile;
+ CsvFileImportResult importResult;
+
+ inputFile = configuration.getLengthAgeKeyFile();
if (inputFile.hasFile()) {
- CsvFileImportResult importResult = importLenthAgeKey(
+ importResult = importLenthAgeKey(
configuration,
inputFile,
voyageMap,
speciesMap
);
- addResultAndLog(result, inputFile, importResult, user);
+ configuration.addResult(importResult);
}
inputFile = configuration.getLengthWeightKeyFile();
if (inputFile.hasFile()) {
- CsvFileImportResult importResult = importLenghtWeightKey(
+ importResult = importLenghtWeightKey(
configuration,
inputFile,
voyageMap,
speciesMap
);
- addResultAndLog(result, inputFile, importResult, user);
+ configuration.addResult(importResult);
}
inputFile = configuration.getEchotypeFile();
if (inputFile.hasFile()) {
- CsvFileImportResult importResult = importEchotypeFile(
+ importResult = importEchotypeFile(
configuration,
inputFile,
voyageMap,
speciesMap
);
- addResultAndLog(result, inputFile, importResult, user);
+ configuration.addResult(importResult);
}
-
- return result;
}
protected CsvFileImportResult importLenghtWeightKey(
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportModel.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportModel.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,132 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata.csv;
-
-import fr.ifremer.echobase.csv.AbstractImportModel;
-import fr.ifremer.echobase.csv.EchobaseCsvUtil;
-import fr.ifremer.echobase.entities.data.Cell;
-import fr.ifremer.echobase.entities.data.Data;
-import fr.ifremer.echobase.entities.data.DataAcquisition;
-import fr.ifremer.echobase.entities.data.DataProcessing;
-import fr.ifremer.echobase.entities.references.AcousticInstrument;
-
-import java.util.Map;
-
-/**
- * To import acoustic datas (says {@link DataAcquisition},
- * {@link DataProcessing}, {@link Cell} and {@link Data}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class AcousticDataImportModel extends AbstractImportModel<AcousticDataImportRow> {
-
- public AcousticDataImportModel(char separator,
- Map<String, AcousticInstrument> instrumentsById) {
- super(separator);
-
- newMandatoryColumn("MOVIES_EILayer", AcousticDataImportRow.PROPERTY_EI_LAYER);//A
- newIgnoredColumn("MOVIES_EILayer\\sndset");//B
- newIgnoredColumn("MOVIES_EILayer\\sndset\\sndname");//C
- newIgnoredColumn("MOVIES_EILayer\\sndset\\sndident");//D
- newForeignKeyColumn("MOVIES_EILayer\\sndset\\softChannelId", AcousticDataImportRow.PROPERTY_ACOUSTIC_INSTRUMENT, AcousticInstrument.class, AcousticInstrument.PROPERTY_ID, instrumentsById); //E
- newIgnoredColumn("MOVIES_EILayer\\sndset\\channelName");//F
- newIgnoredColumn("MOVIES_EILayer\\sndset\\dataType");//G
- newIgnoredColumn("MOVIES_EILayer\\sndset\\beamType");//H
- newIgnoredColumn("MOVIES_EILayer\\sndset\\acousticFrequency");//I
- newIgnoredColumn("MOVIES_EILayer\\sndset\\startSample");//J
- newIgnoredColumn("MOVIES_EILayer\\sndset\\mainBeamAlongSteeringAngle");//K
- newIgnoredColumn("MOVIES_EILayer\\sndset\\mainBeamAthwartSteeringAngle");//L
- newMandatoryColumn("MOVIES_EILayer\\sndset\\absorptionCoef", AcousticDataImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_ABSORPTION, EchobaseCsvUtil.FLOAT);//M
- newMandatoryColumn("MOVIES_EILayer\\sndset\\transmissionPower", AcousticDataImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_POWER, EchobaseCsvUtil.INTEGER);//N
- newMandatoryColumn("MOVIES_EILayer\\sndset\\beamAlongAngleSensitivity", AcousticDataImportRow.PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ALONGSHIP, EchobaseCsvUtil.FLOAT);//O
- newMandatoryColumn("MOVIES_EILayer\\sndset\\beamAthwartAngleSensitivity", AcousticDataImportRow.PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ATHWARTSHIP, EchobaseCsvUtil.FLOAT);//P
- newIgnoredColumn("MOVIES_EILayer\\sndset\\beam3dBWidthAlong");//Q
- newIgnoredColumn("MOVIES_EILayer\\sndset\\beam3dBWidthAthwart");//R
- newMandatoryColumn("MOVIES_EILayer\\sndset\\beamEquTwoWayAngle", AcousticDataImportRow.PROPERTY_TRANSDUCER_ACQUISITION_PSI, EchobaseCsvUtil.FLOAT);//S
- newMandatoryColumn("MOVIES_EILayer\\sndset\\beamGain", AcousticDataImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_GAIN, EchobaseCsvUtil.FLOAT);//T
- newMandatoryColumn("MOVIES_EILayer\\sndset\\beamSACorrection", AcousticDataImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_SACORRECTION, EchobaseCsvUtil.FLOAT);//U
- newIgnoredColumn("MOVIES_EILayer\\sndset\\bottomDetectionMinDepth");//V
- newIgnoredColumn("MOVIES_EILayer\\sndset\\bottomDetectionMaxDepth");//W
- newIgnoredColumn("MOVIES_EILayer\\sndset\\bottomDetectionMinLevel");//X
- newIgnoredColumn("MOVIES_EILayer\\sndset\\AlongTXRXWeightId");//Y
- newIgnoredColumn("MOVIES_EILayer\\sndset\\AthwartTXRXWeightId");//Z
- newIgnoredColumn("MOVIES_EILayer\\sndset\\SplitBeamAlongTXRXWeightId");//AA
- newIgnoredColumn("MOVIES_EILayer\\sndset\\SplitBeamAthwartTXRXWeightId");//AB
- newIgnoredColumn("MOVIES_EILayer\\sndset\\bandWidth");//AC
- newIgnoredColumn("MOVIES_EILayer\\sndset\\tvgminrange");//AD
- newIgnoredColumn("MOVIES_EILayer\\sndset\\tvgmaxrange");//AE
- newMandatoryColumn("MOVIES_EILayer\\sndset\\pulseduration", AcousticDataImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_PULSE_LENGTH, EchobaseCsvUtil.FLOAT);//AF
- newIgnoredColumn("MOVIES_EILayer\\shipnav");//AG
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\lat");//AH
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\long");//AI
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\alt");//AJ
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\gndspeed");//AK
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\gndcourse");//AL
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\surfspeed");//AM
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\surfcourse");//AN
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\driftspeed");//AO
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\driftcourse");//AP
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\heading");//AQ
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\roll");//AR
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\pitch");//AS
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\heave");//AT
- newMandatoryColumn("MOVIES_EILayer\\shipnav\\depth", AcousticDataImportRow.PROPERTY_ESDU_CELL_DATA_DEPTH);//AU
- newIgnoredColumn("MOVIES_EILayer\\shipnav\\draught");//AV
-
- // Cell elementary Datas
- newIgnoredColumn("MOVIES_EILayer\\cellset");//AW
- newMandatoryColumn("MOVIES_EILayer\\cellset\\cellnum", AcousticDataImportRow.PROPERTY_CELL_NUM, EchobaseCsvUtil.PRIMITIVE_INTEGER);//AX
- newMandatoryColumn("MOVIES_EILayer\\cellset\\celltype", AcousticDataImportRow.PROPERTY_CELL_TYPE, EchobaseCsvUtil.PRIMITIVE_INTEGER);//AY
- newMandatoryColumn("MOVIES_EILayer\\cellset\\depthstart", AcousticDataImportRow.PROPERTY_CELL_DEPTH_START, EchobaseCsvUtil.PRIMITIVE_FLOAT);//AZ
- newMandatoryColumn("MOVIES_EILayer\\cellset\\depthend", AcousticDataImportRow.PROPERTY_CELL_DEPTH_END, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BA
- newIgnoredColumn("MOVIES_EILayer\\cellset\\indexstart");//BB
- newIgnoredColumn("MOVIES_EILayer\\cellset\\indexend");//BC
- newMandatoryColumn("MOVIES_EILayer\\cellset\\datestart", AcousticDataImportRow.PROPERTY_CELL_DATE_START, EchobaseCsvUtil.IMPORT_DAY_TIME3);//BD
- newMandatoryColumn("MOVIES_EILayer\\cellset\\dateend", AcousticDataImportRow.PROPERTY_CELL_DATE_END, EchobaseCsvUtil.IMPORT_DAY_TIME3);//BE
-
- newMandatoryColumn("MOVIES_EILayer\\cellset\\lat", AcousticDataImportRow.PROPERTY_CELL_LATITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BF
- newMandatoryColumn("MOVIES_EILayer\\cellset\\long", AcousticDataImportRow.PROPERTY_CELL_LONGITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BG
- newMandatoryColumn("MOVIES_EILayer\\cellset\\volume", AcousticDataImportRow.PROPERTY_CELL_VOLUME, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BH
- newMandatoryColumn("MOVIES_EILayer\\cellset\\area", AcousticDataImportRow.PROPERTY_CELL_SURFACE, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BI
- newIgnoredColumn("MOVIES_EILayer\\cellset\\diststart");//BJ
- newIgnoredColumn("MOVIES_EILayer\\cellset\\distend");//BK
- newMandatoryColumn("MOVIES_EILayer\\cellset\\thresholdup", AcousticDataImportRow.PROPERTY_E_ITHRESHOLD_HIGH, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BL
- newMandatoryColumn("MOVIES_EILayer\\cellset\\thresholdlow", AcousticDataImportRow.PROPERTY_E_ITHRESHOLD_LOW, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BM
- newIgnoredColumn("MOVIES_EILayer\\eilayer");//BN
- newMandatoryColumn("MOVIES_EILayer\\eilayer\\sa", AcousticDataImportRow.PROPERTY_CELL_NASC, EchobaseCsvUtil.NA_TO_FLOAT_PARSER);//BO
- newIgnoredColumn("MOVIES_EILayer\\eilayer\\sv");//BP
- newMandatoryColumn("MOVIES_EILayer\\eilayer\\ni", AcousticDataImportRow.PROPERTY_CELL_NUMBER_OF_SAMPLES_ECHO_INTEGRATED, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BQ
- newMandatoryColumn("MOVIES_EILayer\\eilayer\\nt", AcousticDataImportRow.PROPERTY_CELL_NUMBER_OF_SAMPLES_RECORDED, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BR
- newIgnoredColumn("MOVIES_EILayer\\boterr");//BR
- newIgnoredColumn("MOVIES_EILayer\\boterr\\sa");//BT
- newIgnoredColumn("MOVIES_EILayer\\boterr\\ni");//BU
- newMandatoryColumn("MOVIES_EILayer\\sndset\\soundcelerity", AcousticDataImportRow.PROPERTY_SOUND_CELERITY);//BV
- }
-
- @Override
- public AcousticDataImportRow newEmptyInstance() {
- return new AcousticDataImportRow();
- }
-}
\ No newline at end of file
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportRow.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportRow.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,365 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata.csv;
-
-import fr.ifremer.echobase.entities.references.AcousticInstrument;
-
-import java.util.Date;
-
-/**
- * Bean of a row for {@link AcousticDataImportModel} import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class AcousticDataImportRow {
-
- public static final String PROPERTY_ACOUSTIC_INSTRUMENT = "acousticInstrument";
-
- public static final String PROPERTY_EI_LAYER = "eiLayer";
-
- public static final String PROPERTY_CELL_TYPE = "cellType";
-
- public static final String PROPERTY_CELL_NUM = "cellNum";
-
- public static final String PROPERTY_ESDU_CELL_DATA_DEPTH = "esduCellDataDepth";
-
- public static final String PROPERTY_CELL_DATE_START = "cellDateStart";
-
- public static final String PROPERTY_CELL_DATE_END = "cellDateEnd";
-
- public static final String PROPERTY_CELL_DEPTH_START = "cellDepthStart";
-
- public static final String PROPERTY_CELL_DEPTH_END = "cellDepthEnd";
-
- public static final String PROPERTY_CELL_NASC = "cellNasc";
-
- public static final String PROPERTY_TRANSCEIVER_ACQUISITION_PULSE_LENGTH = "transceiverAcquisitionPulseLength";
-
- public static final String PROPERTY_TRANSCEIVER_ACQUISITION_GAIN = "transceiverAcquisitionGain";
-
- public static final String PROPERTY_TRANSCEIVER_ACQUISITION_ABSORPTION = "transceiverAcquisitionAbsorption";
-
- public static final String PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ATHWARTSHIP = "transducerAcquisitionBeamAngleAthwartship";
-
- public static final String PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ALONGSHIP = "transducerAcquisitionBeamAngleAlongship";
-
- public static final String PROPERTY_TRANSDUCER_ACQUISITION_PSI = "transducerAcquisitionPsi";
-
- public static final String PROPERTY_TRANSCEIVER_ACQUISITION_POWER = "transceiverAcquisitionPower";
-
- public static final String PROPERTY_TRANSCEIVER_ACQUISITION_SACORRECTION = "transceiverAcquisitionSacorrection";
-
- public static final String PROPERTY_E_ITHRESHOLD_LOW = "eIThresholdLow";
-
- public static final String PROPERTY_E_ITHRESHOLD_HIGH = "eIThresholdHigh";
-
- public static final String PROPERTY_CELL_VOLUME = "cellVolume";
-
- public static final String PROPERTY_CELL_SURFACE = "cellSurface";
-
- public static final String PROPERTY_CELL_NUMBER_OF_SAMPLES_RECORDED = "cellNumberOfSamplesRecorded";
-
- public static final String PROPERTY_CELL_NUMBER_OF_SAMPLES_ECHO_INTEGRATED = "cellNumberOfSamplesEchoIntegrated";
-
- public static final String PROPERTY_SOUND_CELERITY = "soundCelerity";
-
- public static final String PROPERTY_CELL_LATITUDE = "cellLatitude";
-
- public static final String PROPERTY_CELL_LONGITUDE = "cellLongitude";
-
- protected String eiLayer;
-
- protected String esduCellDataDepth;
-
- protected Date cellDateStart;
-
- protected Date cellDateEnd;
-
- protected float cellLatitude;
-
- protected float cellLongitude;
-
- protected Float cellVolume;
-
- protected int cellSurface;
-
- protected Integer cellNumberOfSamplesRecorded;
-
- protected Integer cellNumberOfSamplesEchoIntegrated;
-
- protected int cellType;
-
- protected int cellNum;
-
- protected float cellDepthStart;
-
- protected float cellDepthEnd;
-
- protected Float cellNasc;
-
- protected float transceiverAcquisitionPulseLength;
-
- protected float transceiverAcquisitionGain;
-
- protected float transceiverAcquisitionAbsorption;
-
- protected float transceiverAcquisitionPower;
-
- protected float transceiverAcquisitionSacorrection;
-
- protected float transducerAcquisitionBeamAngleAthwartship;
-
- protected float transducerAcquisitionBeamAngleAlongship;
-
- protected float transducerAcquisitionPsi;
-
- protected int eIThresholdLow;
-
- protected int eIThresholdHigh;
-
- protected String soundCelerity;
-
- protected AcousticInstrument acousticInstrument;
-
- public boolean isCellToAdd() {
- return cellNasc != null;
- }
-
- public String getEiLayer() {
- return eiLayer;
- }
-
- public void setEiLayer(String eiLayer) {
- this.eiLayer = eiLayer;
- }
-
- public AcousticInstrument getAcousticInstrument() {
- return acousticInstrument;
- }
-
- public void setAcousticInstrument(AcousticInstrument acousticInstrument) {
- this.acousticInstrument = acousticInstrument;
- }
-
- public Date getCellDateStart() {
- return cellDateStart;
- }
-
- public void setCellDateStart(Date cellDateStart) {
- this.cellDateStart = cellDateStart;
- }
-
- public int getCellType() {
- return cellType;
- }
-
- public void setCellType(int cellType) {
- this.cellType = cellType;
- }
-
- public int getCellNum() {
- return cellNum;
- }
-
- public void setCellNum(int cellNum) {
- this.cellNum = cellNum;
- }
-
- public String getEsduCellDataDepth() {
- return esduCellDataDepth;
- }
-
- public void setEsduCellDataDepth(String esduCellDataDepth) {
- this.esduCellDataDepth = esduCellDataDepth;
- }
-
- public float getCellDepthStart() {
- return cellDepthStart;
- }
-
- public void setCellDepthStart(float cellDepthStart) {
- this.cellDepthStart = cellDepthStart;
- }
-
- public float getCellDepthEnd() {
- return cellDepthEnd;
- }
-
- public void setCellDepthEnd(float cellDepthEnd) {
- this.cellDepthEnd = cellDepthEnd;
- }
-
- public Float getCellNasc() {
- return cellNasc;
- }
-
- public void setCellNasc(Float cellNasc) {
- this.cellNasc = cellNasc;
- }
-
- public float getTransceiverAcquisitionPulseLength() {
- return transceiverAcquisitionPulseLength;
- }
-
- public void setTransceiverAcquisitionPulseLength(float transceiverAcquisitionPulseLength) {
- this.transceiverAcquisitionPulseLength = transceiverAcquisitionPulseLength;
- }
-
- public float getTransceiverAcquisitionGain() {
- return transceiverAcquisitionGain;
- }
-
- public void setTransceiverAcquisitionGain(float transceiverAcquisitionGain) {
- this.transceiverAcquisitionGain = transceiverAcquisitionGain;
- }
-
- public float getTransceiverAcquisitionAbsorption() {
- return transceiverAcquisitionAbsorption;
- }
-
- public void setTransceiverAcquisitionAbsorption(float transceiverAcquisitionAbsorption) {
- this.transceiverAcquisitionAbsorption = transceiverAcquisitionAbsorption;
- }
-
- public float getTransceiverAcquisitionPower() {
- return transceiverAcquisitionPower;
- }
-
- public void setTransceiverAcquisitionPower(float transceiverAcquisitionPower) {
- this.transceiverAcquisitionPower = transceiverAcquisitionPower;
- }
-
- public float getTransceiverAcquisitionSacorrection() {
- return transceiverAcquisitionSacorrection;
- }
-
- public void setTransceiverAcquisitionSacorrection(float transceiverAcquisitionSacorrection) {
- this.transceiverAcquisitionSacorrection = transceiverAcquisitionSacorrection;
- }
-
- public float getTransducerAcquisitionBeamAngleAthwartship() {
- return transducerAcquisitionBeamAngleAthwartship;
- }
-
- public void setTransducerAcquisitionBeamAngleAthwartship(float transducerAcquisitionBeamAngleAthwartship) {
- this.transducerAcquisitionBeamAngleAthwartship = transducerAcquisitionBeamAngleAthwartship;
- }
-
- public float getTransducerAcquisitionBeamAngleAlongship() {
- return transducerAcquisitionBeamAngleAlongship;
- }
-
- public void setTransducerAcquisitionBeamAngleAlongship(float transducerAcquisitionBeamAngleAlongship) {
- this.transducerAcquisitionBeamAngleAlongship = transducerAcquisitionBeamAngleAlongship;
- }
-
- public float getTransducerAcquisitionPsi() {
- return transducerAcquisitionPsi;
- }
-
- public void setTransducerAcquisitionPsi(float transducerAcquisitionPsi) {
- this.transducerAcquisitionPsi = transducerAcquisitionPsi;
- }
-
- public float getCellLatitude() {
- return cellLatitude;
- }
-
- public void setCellLatitude(float cellLatitude) {
- this.cellLatitude = cellLatitude;
- }
-
- public float getCellLongitude() {
- return cellLongitude;
- }
-
- public void setCellLongitude(float cellLongitude) {
- this.cellLongitude = cellLongitude;
- }
-
- public int geteIThresholdLow() {
- return eIThresholdLow;
- }
-
- public void seteIThresholdLow(int eIThresholdLow) {
- this.eIThresholdLow = eIThresholdLow;
- }
-
- public int geteIThresholdHigh() {
- return eIThresholdHigh;
- }
-
- public void seteIThresholdHigh(int eIThresholdHigh) {
- this.eIThresholdHigh = eIThresholdHigh;
- }
-
- public Date getCellDateEnd() {
- return cellDateEnd;
- }
-
- public void setCellDateEnd(Date cellDateEnd) {
- this.cellDateEnd = cellDateEnd;
- }
-
- public Float getCellVolume() {
- return cellVolume;
- }
-
- public void setCellVolume(Float cellVolume) {
- this.cellVolume = cellVolume;
- }
-
- public int getCellSurface() {
- return cellSurface;
- }
-
- public void setCellSurface(int cellSurface) {
- this.cellSurface = cellSurface;
- }
-
- public Integer getCellNumberOfSamplesRecorded() {
- return cellNumberOfSamplesRecorded;
- }
-
- public void setCellNumberOfSamplesRecorded(Integer cellNumberOfSamplesRecorded) {
- this.cellNumberOfSamplesRecorded = cellNumberOfSamplesRecorded;
- }
-
- public Integer getCellNumberOfSamplesEchoIntegrated() {
- return cellNumberOfSamplesEchoIntegrated;
- }
-
- public void setCellNumberOfSamplesEchoIntegrated(Integer cellNumberOfSamplesEchoIntegrated) {
- this.cellNumberOfSamplesEchoIntegrated = cellNumberOfSamplesEchoIntegrated;
- }
-
- public String getSoundCelerity() {
- return soundCelerity;
- }
-
- public void setSoundCelerity(String soundCelerity) {
- this.soundCelerity = soundCelerity;
- }
-}
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportModel.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportModel.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportModel.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportModel.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,132 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata.csv;
+
+import fr.ifremer.echobase.csv.AbstractImportModel;
+import fr.ifremer.echobase.csv.EchobaseCsvUtil;
+import fr.ifremer.echobase.entities.data.Cell;
+import fr.ifremer.echobase.entities.data.Data;
+import fr.ifremer.echobase.entities.data.DataAcquisition;
+import fr.ifremer.echobase.entities.data.DataProcessing;
+import fr.ifremer.echobase.entities.references.AcousticInstrument;
+
+import java.util.Map;
+
+/**
+ * To import acoustic datas (says {@link DataAcquisition},
+ * {@link DataProcessing}, {@link Cell} and {@link Data}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class AcousticImportModel extends AbstractImportModel<AcousticImportRow> {
+
+ public AcousticImportModel(char separator,
+ Map<String, AcousticInstrument> instrumentsById) {
+ super(separator);
+
+ newMandatoryColumn("MOVIES_EILayer", AcousticImportRow.PROPERTY_EI_LAYER);//A
+ newIgnoredColumn("MOVIES_EILayer\\sndset");//B
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\sndname");//C
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\sndident");//D
+ newForeignKeyColumn("MOVIES_EILayer\\sndset\\softChannelId", AcousticImportRow.PROPERTY_ACOUSTIC_INSTRUMENT, AcousticInstrument.class, AcousticInstrument.PROPERTY_ID, instrumentsById); //E
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\channelName");//F
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\dataType");//G
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\beamType");//H
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\acousticFrequency");//I
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\startSample");//J
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\mainBeamAlongSteeringAngle");//K
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\mainBeamAthwartSteeringAngle");//L
+ newMandatoryColumn("MOVIES_EILayer\\sndset\\absorptionCoef", AcousticImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_ABSORPTION, EchobaseCsvUtil.FLOAT);//M
+ newMandatoryColumn("MOVIES_EILayer\\sndset\\transmissionPower", AcousticImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_POWER, EchobaseCsvUtil.INTEGER);//N
+ newMandatoryColumn("MOVIES_EILayer\\sndset\\beamAlongAngleSensitivity", AcousticImportRow.PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ALONGSHIP, EchobaseCsvUtil.FLOAT);//O
+ newMandatoryColumn("MOVIES_EILayer\\sndset\\beamAthwartAngleSensitivity", AcousticImportRow.PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ATHWARTSHIP, EchobaseCsvUtil.FLOAT);//P
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\beam3dBWidthAlong");//Q
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\beam3dBWidthAthwart");//R
+ newMandatoryColumn("MOVIES_EILayer\\sndset\\beamEquTwoWayAngle", AcousticImportRow.PROPERTY_TRANSDUCER_ACQUISITION_PSI, EchobaseCsvUtil.FLOAT);//S
+ newMandatoryColumn("MOVIES_EILayer\\sndset\\beamGain", AcousticImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_GAIN, EchobaseCsvUtil.FLOAT);//T
+ newMandatoryColumn("MOVIES_EILayer\\sndset\\beamSACorrection", AcousticImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_SACORRECTION, EchobaseCsvUtil.FLOAT);//U
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\bottomDetectionMinDepth");//V
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\bottomDetectionMaxDepth");//W
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\bottomDetectionMinLevel");//X
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\AlongTXRXWeightId");//Y
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\AthwartTXRXWeightId");//Z
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\SplitBeamAlongTXRXWeightId");//AA
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\SplitBeamAthwartTXRXWeightId");//AB
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\bandWidth");//AC
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\tvgminrange");//AD
+ newIgnoredColumn("MOVIES_EILayer\\sndset\\tvgmaxrange");//AE
+ newMandatoryColumn("MOVIES_EILayer\\sndset\\pulseduration", AcousticImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_PULSE_LENGTH, EchobaseCsvUtil.FLOAT);//AF
+ newIgnoredColumn("MOVIES_EILayer\\shipnav");//AG
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\lat");//AH
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\long");//AI
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\alt");//AJ
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\gndspeed");//AK
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\gndcourse");//AL
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\surfspeed");//AM
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\surfcourse");//AN
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\driftspeed");//AO
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\driftcourse");//AP
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\heading");//AQ
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\roll");//AR
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\pitch");//AS
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\heave");//AT
+ newMandatoryColumn("MOVIES_EILayer\\shipnav\\depth", AcousticImportRow.PROPERTY_ESDU_CELL_DATA_DEPTH);//AU
+ newIgnoredColumn("MOVIES_EILayer\\shipnav\\draught");//AV
+
+ // Cell elementary Datas
+ newIgnoredColumn("MOVIES_EILayer\\cellset");//AW
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\cellnum", AcousticImportRow.PROPERTY_CELL_NUM, EchobaseCsvUtil.PRIMITIVE_INTEGER);//AX
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\celltype", AcousticImportRow.PROPERTY_CELL_TYPE, EchobaseCsvUtil.PRIMITIVE_INTEGER);//AY
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\depthstart", AcousticImportRow.PROPERTY_CELL_DEPTH_START, EchobaseCsvUtil.PRIMITIVE_FLOAT);//AZ
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\depthend", AcousticImportRow.PROPERTY_CELL_DEPTH_END, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BA
+ newIgnoredColumn("MOVIES_EILayer\\cellset\\indexstart");//BB
+ newIgnoredColumn("MOVIES_EILayer\\cellset\\indexend");//BC
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\datestart", AcousticImportRow.PROPERTY_CELL_DATE_START, EchobaseCsvUtil.IMPORT_DAY_TIME3);//BD
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\dateend", AcousticImportRow.PROPERTY_CELL_DATE_END, EchobaseCsvUtil.IMPORT_DAY_TIME3);//BE
+
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\lat", AcousticImportRow.PROPERTY_CELL_LATITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BF
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\long", AcousticImportRow.PROPERTY_CELL_LONGITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BG
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\volume", AcousticImportRow.PROPERTY_CELL_VOLUME, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BH
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\area", AcousticImportRow.PROPERTY_CELL_SURFACE, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BI
+ newIgnoredColumn("MOVIES_EILayer\\cellset\\diststart");//BJ
+ newIgnoredColumn("MOVIES_EILayer\\cellset\\distend");//BK
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\thresholdup", AcousticImportRow.PROPERTY_E_ITHRESHOLD_HIGH, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BL
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\thresholdlow", AcousticImportRow.PROPERTY_E_ITHRESHOLD_LOW, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BM
+ newIgnoredColumn("MOVIES_EILayer\\eilayer");//BN
+ newMandatoryColumn("MOVIES_EILayer\\eilayer\\sa", AcousticImportRow.PROPERTY_CELL_NASC, EchobaseCsvUtil.NA_TO_FLOAT_PARSER);//BO
+ newIgnoredColumn("MOVIES_EILayer\\eilayer\\sv");//BP
+ newMandatoryColumn("MOVIES_EILayer\\eilayer\\ni", AcousticImportRow.PROPERTY_CELL_NUMBER_OF_SAMPLES_ECHO_INTEGRATED, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BQ
+ newMandatoryColumn("MOVIES_EILayer\\eilayer\\nt", AcousticImportRow.PROPERTY_CELL_NUMBER_OF_SAMPLES_RECORDED, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BR
+ newIgnoredColumn("MOVIES_EILayer\\boterr");//BR
+ newIgnoredColumn("MOVIES_EILayer\\boterr\\sa");//BT
+ newIgnoredColumn("MOVIES_EILayer\\boterr\\ni");//BU
+ newMandatoryColumn("MOVIES_EILayer\\sndset\\soundcelerity", AcousticImportRow.PROPERTY_SOUND_CELERITY);//BV
+ }
+
+ @Override
+ public AcousticImportRow newEmptyInstance() {
+ return new AcousticImportRow();
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportRow.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportRow.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportRow.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportRow.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,365 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata.csv;
+
+import fr.ifremer.echobase.entities.references.AcousticInstrument;
+
+import java.util.Date;
+
+/**
+ * Bean of a row for {@link AcousticImportModel} import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class AcousticImportRow {
+
+ public static final String PROPERTY_ACOUSTIC_INSTRUMENT = "acousticInstrument";
+
+ public static final String PROPERTY_EI_LAYER = "eiLayer";
+
+ public static final String PROPERTY_CELL_TYPE = "cellType";
+
+ public static final String PROPERTY_CELL_NUM = "cellNum";
+
+ public static final String PROPERTY_ESDU_CELL_DATA_DEPTH = "esduCellDataDepth";
+
+ public static final String PROPERTY_CELL_DATE_START = "cellDateStart";
+
+ public static final String PROPERTY_CELL_DATE_END = "cellDateEnd";
+
+ public static final String PROPERTY_CELL_DEPTH_START = "cellDepthStart";
+
+ public static final String PROPERTY_CELL_DEPTH_END = "cellDepthEnd";
+
+ public static final String PROPERTY_CELL_NASC = "cellNasc";
+
+ public static final String PROPERTY_TRANSCEIVER_ACQUISITION_PULSE_LENGTH = "transceiverAcquisitionPulseLength";
+
+ public static final String PROPERTY_TRANSCEIVER_ACQUISITION_GAIN = "transceiverAcquisitionGain";
+
+ public static final String PROPERTY_TRANSCEIVER_ACQUISITION_ABSORPTION = "transceiverAcquisitionAbsorption";
+
+ public static final String PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ATHWARTSHIP = "transducerAcquisitionBeamAngleAthwartship";
+
+ public static final String PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ALONGSHIP = "transducerAcquisitionBeamAngleAlongship";
+
+ public static final String PROPERTY_TRANSDUCER_ACQUISITION_PSI = "transducerAcquisitionPsi";
+
+ public static final String PROPERTY_TRANSCEIVER_ACQUISITION_POWER = "transceiverAcquisitionPower";
+
+ public static final String PROPERTY_TRANSCEIVER_ACQUISITION_SACORRECTION = "transceiverAcquisitionSacorrection";
+
+ public static final String PROPERTY_E_ITHRESHOLD_LOW = "eIThresholdLow";
+
+ public static final String PROPERTY_E_ITHRESHOLD_HIGH = "eIThresholdHigh";
+
+ public static final String PROPERTY_CELL_VOLUME = "cellVolume";
+
+ public static final String PROPERTY_CELL_SURFACE = "cellSurface";
+
+ public static final String PROPERTY_CELL_NUMBER_OF_SAMPLES_RECORDED = "cellNumberOfSamplesRecorded";
+
+ public static final String PROPERTY_CELL_NUMBER_OF_SAMPLES_ECHO_INTEGRATED = "cellNumberOfSamplesEchoIntegrated";
+
+ public static final String PROPERTY_SOUND_CELERITY = "soundCelerity";
+
+ public static final String PROPERTY_CELL_LATITUDE = "cellLatitude";
+
+ public static final String PROPERTY_CELL_LONGITUDE = "cellLongitude";
+
+ protected String eiLayer;
+
+ protected String esduCellDataDepth;
+
+ protected Date cellDateStart;
+
+ protected Date cellDateEnd;
+
+ protected float cellLatitude;
+
+ protected float cellLongitude;
+
+ protected Float cellVolume;
+
+ protected int cellSurface;
+
+ protected Integer cellNumberOfSamplesRecorded;
+
+ protected Integer cellNumberOfSamplesEchoIntegrated;
+
+ protected int cellType;
+
+ protected int cellNum;
+
+ protected float cellDepthStart;
+
+ protected float cellDepthEnd;
+
+ protected Float cellNasc;
+
+ protected float transceiverAcquisitionPulseLength;
+
+ protected float transceiverAcquisitionGain;
+
+ protected float transceiverAcquisitionAbsorption;
+
+ protected float transceiverAcquisitionPower;
+
+ protected float transceiverAcquisitionSacorrection;
+
+ protected float transducerAcquisitionBeamAngleAthwartship;
+
+ protected float transducerAcquisitionBeamAngleAlongship;
+
+ protected float transducerAcquisitionPsi;
+
+ protected int eIThresholdLow;
+
+ protected int eIThresholdHigh;
+
+ protected String soundCelerity;
+
+ protected AcousticInstrument acousticInstrument;
+
+ public boolean isCellToAdd() {
+ return cellNasc != null;
+ }
+
+ public String getEiLayer() {
+ return eiLayer;
+ }
+
+ public void setEiLayer(String eiLayer) {
+ this.eiLayer = eiLayer;
+ }
+
+ public AcousticInstrument getAcousticInstrument() {
+ return acousticInstrument;
+ }
+
+ public void setAcousticInstrument(AcousticInstrument acousticInstrument) {
+ this.acousticInstrument = acousticInstrument;
+ }
+
+ public Date getCellDateStart() {
+ return cellDateStart;
+ }
+
+ public void setCellDateStart(Date cellDateStart) {
+ this.cellDateStart = cellDateStart;
+ }
+
+ public int getCellType() {
+ return cellType;
+ }
+
+ public void setCellType(int cellType) {
+ this.cellType = cellType;
+ }
+
+ public int getCellNum() {
+ return cellNum;
+ }
+
+ public void setCellNum(int cellNum) {
+ this.cellNum = cellNum;
+ }
+
+ public String getEsduCellDataDepth() {
+ return esduCellDataDepth;
+ }
+
+ public void setEsduCellDataDepth(String esduCellDataDepth) {
+ this.esduCellDataDepth = esduCellDataDepth;
+ }
+
+ public float getCellDepthStart() {
+ return cellDepthStart;
+ }
+
+ public void setCellDepthStart(float cellDepthStart) {
+ this.cellDepthStart = cellDepthStart;
+ }
+
+ public float getCellDepthEnd() {
+ return cellDepthEnd;
+ }
+
+ public void setCellDepthEnd(float cellDepthEnd) {
+ this.cellDepthEnd = cellDepthEnd;
+ }
+
+ public Float getCellNasc() {
+ return cellNasc;
+ }
+
+ public void setCellNasc(Float cellNasc) {
+ this.cellNasc = cellNasc;
+ }
+
+ public float getTransceiverAcquisitionPulseLength() {
+ return transceiverAcquisitionPulseLength;
+ }
+
+ public void setTransceiverAcquisitionPulseLength(float transceiverAcquisitionPulseLength) {
+ this.transceiverAcquisitionPulseLength = transceiverAcquisitionPulseLength;
+ }
+
+ public float getTransceiverAcquisitionGain() {
+ return transceiverAcquisitionGain;
+ }
+
+ public void setTransceiverAcquisitionGain(float transceiverAcquisitionGain) {
+ this.transceiverAcquisitionGain = transceiverAcquisitionGain;
+ }
+
+ public float getTransceiverAcquisitionAbsorption() {
+ return transceiverAcquisitionAbsorption;
+ }
+
+ public void setTransceiverAcquisitionAbsorption(float transceiverAcquisitionAbsorption) {
+ this.transceiverAcquisitionAbsorption = transceiverAcquisitionAbsorption;
+ }
+
+ public float getTransceiverAcquisitionPower() {
+ return transceiverAcquisitionPower;
+ }
+
+ public void setTransceiverAcquisitionPower(float transceiverAcquisitionPower) {
+ this.transceiverAcquisitionPower = transceiverAcquisitionPower;
+ }
+
+ public float getTransceiverAcquisitionSacorrection() {
+ return transceiverAcquisitionSacorrection;
+ }
+
+ public void setTransceiverAcquisitionSacorrection(float transceiverAcquisitionSacorrection) {
+ this.transceiverAcquisitionSacorrection = transceiverAcquisitionSacorrection;
+ }
+
+ public float getTransducerAcquisitionBeamAngleAthwartship() {
+ return transducerAcquisitionBeamAngleAthwartship;
+ }
+
+ public void setTransducerAcquisitionBeamAngleAthwartship(float transducerAcquisitionBeamAngleAthwartship) {
+ this.transducerAcquisitionBeamAngleAthwartship = transducerAcquisitionBeamAngleAthwartship;
+ }
+
+ public float getTransducerAcquisitionBeamAngleAlongship() {
+ return transducerAcquisitionBeamAngleAlongship;
+ }
+
+ public void setTransducerAcquisitionBeamAngleAlongship(float transducerAcquisitionBeamAngleAlongship) {
+ this.transducerAcquisitionBeamAngleAlongship = transducerAcquisitionBeamAngleAlongship;
+ }
+
+ public float getTransducerAcquisitionPsi() {
+ return transducerAcquisitionPsi;
+ }
+
+ public void setTransducerAcquisitionPsi(float transducerAcquisitionPsi) {
+ this.transducerAcquisitionPsi = transducerAcquisitionPsi;
+ }
+
+ public float getCellLatitude() {
+ return cellLatitude;
+ }
+
+ public void setCellLatitude(float cellLatitude) {
+ this.cellLatitude = cellLatitude;
+ }
+
+ public float getCellLongitude() {
+ return cellLongitude;
+ }
+
+ public void setCellLongitude(float cellLongitude) {
+ this.cellLongitude = cellLongitude;
+ }
+
+ public int geteIThresholdLow() {
+ return eIThresholdLow;
+ }
+
+ public void seteIThresholdLow(int eIThresholdLow) {
+ this.eIThresholdLow = eIThresholdLow;
+ }
+
+ public int geteIThresholdHigh() {
+ return eIThresholdHigh;
+ }
+
+ public void seteIThresholdHigh(int eIThresholdHigh) {
+ this.eIThresholdHigh = eIThresholdHigh;
+ }
+
+ public Date getCellDateEnd() {
+ return cellDateEnd;
+ }
+
+ public void setCellDateEnd(Date cellDateEnd) {
+ this.cellDateEnd = cellDateEnd;
+ }
+
+ public Float getCellVolume() {
+ return cellVolume;
+ }
+
+ public void setCellVolume(Float cellVolume) {
+ this.cellVolume = cellVolume;
+ }
+
+ public int getCellSurface() {
+ return cellSurface;
+ }
+
+ public void setCellSurface(int cellSurface) {
+ this.cellSurface = cellSurface;
+ }
+
+ public Integer getCellNumberOfSamplesRecorded() {
+ return cellNumberOfSamplesRecorded;
+ }
+
+ public void setCellNumberOfSamplesRecorded(Integer cellNumberOfSamplesRecorded) {
+ this.cellNumberOfSamplesRecorded = cellNumberOfSamplesRecorded;
+ }
+
+ public Integer getCellNumberOfSamplesEchoIntegrated() {
+ return cellNumberOfSamplesEchoIntegrated;
+ }
+
+ public void setCellNumberOfSamplesEchoIntegrated(Integer cellNumberOfSamplesEchoIntegrated) {
+ this.cellNumberOfSamplesEchoIntegrated = cellNumberOfSamplesEchoIntegrated;
+ }
+
+ public String getSoundCelerity() {
+ return soundCelerity;
+ }
+
+ public void setSoundCelerity(String soundCelerity) {
+ this.soundCelerity = soundCelerity;
+ }
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportRow.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-services/src/main/resources/i18n/echobase-services_en_GB.properties
===================================================================
--- trunk/echobase-services/src/main/resources/i18n/echobase-services_en_GB.properties 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/resources/i18n/echobase-services_en_GB.properties 2012-03-30 16:46:14 UTC (rev 460)
@@ -14,12 +14,12 @@
echobase.common.esduBySpeciesAndAgeCategoryFile=
echobase.common.esduBySpeciesAndSizeCategoryFile=
echobase.common.gearMetadataFile=
-echobase.common.importDataMode.accousticData=
-echobase.common.importDataMode.catchesData=
-echobase.common.importDataMode.commonData=
-echobase.common.importDataMode.operation=
-echobase.common.importDataMode.results=
echobase.common.importDbFile=
+echobase.common.importMode.acoustic=
+echobase.common.importMode.catches=
+echobase.common.importMode.common=
+echobase.common.importMode.operation=
+echobase.common.importMode.results=
echobase.common.lengthAgeKeyFile=
echobase.common.lengthWeightKeyFile=
echobase.common.moviesFile=
Modified: trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties
===================================================================
--- trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties 2012-03-30 16:46:14 UTC (rev 460)
@@ -14,12 +14,12 @@
echobase.common.esduBySpeciesAndAgeCategoryFile=Fichier ESDU / Espèce / Catégorie Age
echobase.common.esduBySpeciesAndSizeCategoryFile=Fichier ESDU / Espèce / Catégorie Taille
echobase.common.gearMetadataFile=Fichier Méta-données d'engin
-echobase.common.importDataMode.accousticData=Import des données accoustiques
-echobase.common.importDataMode.catchesData=Import des données de pêche
-echobase.common.importDataMode.commonData=Import Voyage / Transit / Transect
-echobase.common.importDataMode.operation=Import des opérations
-echobase.common.importDataMode.results=Import des résultats
echobase.common.importDbFile=Fichier d'import (zip)
+echobase.common.importMode.acoustic=Import des données acoustiques
+echobase.common.importMode.catches=Import des données de pêche
+echobase.common.importMode.common=Import Voyage / Transit / Transect
+echobase.common.importMode.operation=Import des opérations
+echobase.common.importMode.results=Import des résultats
echobase.common.lengthAgeKeyFile=Fichier de relation Taille-Age
echobase.common.lengthWeightKeyFile=Fichier de relation Taille-Poids
echobase.common.moviesFile=Fichier Movies
Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -174,7 +174,9 @@
}
protected <M extends AbstractImportConfiguration, S extends AbstractImportDataService<M>>
- List<CsvFileImportResult> doImport(M conf, Class<S> serviceType, int nbResults) throws ImportException {
+ List<CsvFileImportResult> doImport(M conf,
+ Class<S> serviceType,
+ int nbResults) throws ImportException {
S service = getService(serviceType);
@@ -182,34 +184,19 @@
long s0 = TimeLog.getTime();
- List<CsvFileImportResult> result = service.doImport(conf, fakeUser);
+ String resume = service.doImport(conf, fakeUser);
TIME_LOG.log(s0, "doImport");
+ List<CsvFileImportResult> result = conf.getImportResults();
+
Assert.assertNotNull(result);
Assert.assertEquals(nbResults, result.size());
assertConfProgressionToEnd(conf);
if (log.isInfoEnabled()) {
- int index = 0;
- for (CsvFileImportResult importResult : result) {
-
- StringBuilder resultBuffer =
- new StringBuilder("Result " + (index++) + " for " + importResult.getImportFileName());
- for (EchoBaseEntityEnum type : importResult.getEntityTypes()) {
- resultBuffer.append("\n").append(type.name());
- int numberCreated = importResult.getNumberCreated(type);
- int numberUpdated = importResult.getNumberUpdated(type);
- if (numberCreated > 0) {
- resultBuffer.append(" (created ").append(numberCreated).append(')');
- }
- if (numberUpdated > 0) {
- resultBuffer.append(" (updated").append(numberUpdated).append(')');
- }
- long nbEntities = countEntities(type.getContract());
- resultBuffer.append(" (total count ").append(nbEntities).append(')');
- }
- log.info(resultBuffer.toString());
+ if (log.isInfoEnabled()) {
+ log.info('\n' + resume);
}
}
Deleted: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticDataImportServiceIT.java
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticDataImportServiceIT.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticDataImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,98 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata;
-
-import fr.ifremer.echobase.csv.CsvFileImportResult;
-import fr.ifremer.echobase.entities.data.Cell;
-import fr.ifremer.echobase.entities.data.Data;
-import fr.ifremer.echobase.entities.data.DataAcquisition;
-import fr.ifremer.echobase.entities.data.DataProcessing;
-import fr.ifremer.echobase.services.FakeEchoBaseServiceContext;
-import org.junit.Test;
-
-import java.util.List;
-
-/**
- * Tests {@link AcousticDataImportService}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class AcousticDataImportServiceIT extends AbstractImportDataServiceIT {
-
- protected FakeEchoBaseServiceContext initContext() {
- return new FakeEchoBaseServiceContext(IMPORT_DATA_ECHOBASE_CATCHES);
- }
-
- protected String[] getImportPath(String filename) {
- return new String[]{"/import-data", "acousticData", filename};
- }
-
- @Test
- public void doImport() throws Exception {
-
- assertImportCommonData();
-
- assertNoEntities(DataAcquisition.class,
- DataProcessing.class,
- Cell.class,
- Data.class);
-
- AcousticDataImportConfiguration conf =
- new AcousticDataImportConfiguration(getLocale());
-
- conf.setVoyageId(getVoyageId());
- conf.setVesselId(VESSEL_ID);
- conf.setAcousticDensityUnit("acousticDensityUnit");
- conf.setAcquisitionSoftwareVersionER60("acquisitionSoftwareVersionER60");
- conf.setAcquisitionSoftwareVersionME70("acquisitionSoftwareVersionME70");
- conf.setAddDataAcquisition(false);
- conf.setTransceiverAcquisitionAbsorptionDescription("transceiverAcquisitionAbsorptionDescription");
- conf.setCellPositionReference(CellPositionReference.START);
- conf.setDigitThreshold(1.5f);
- conf.setLoggedDataDatatype("loggedDataDatatype");
- conf.setLoggedDataFormat("loggedDataFormat");
- conf.setNotes("notes");
- conf.setPingDutyCycle("pingDutyCycle");
- conf.setProcessingDescription("processingDescription");
- conf.setProcessingTemplate("processingTemplate");
- conf.setSoundSpeedCalculationsER60("soundSpeedCalculationsER60");
- conf.setSoundSpeedCalculationsME70("soundSpeedCalculationsME70");
- conf.setTransceiverAcquisitionAbsorptionDescription("transceiverAcquisitionAbsorptionDescription");
-
- prepareInputFile(conf.getMoviesFile(), getImportPath("movies.csv.gz"));
-
- List<CsvFileImportResult> result;
- result = doImport(conf, AcousticDataImportService.class, 1);
-
- assertCsvImportResult(result, 0, DataAcquisition.class, NB_DATA_ACQUISITION);
- assertCsvImportResult(result, 0, DataProcessing.class, NB_DATA_PROCESSING);
- assertCsvImportResult(result, 0, Cell.class, NB_CELL);
- assertCsvImportResult(result, 0, Data.class, NB_DATA);
-
- assertImportAcousticDatas();
- }
-
-
-}
Copied: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticImportServiceIT.java (from rev 458, trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticDataImportServiceIT.java)
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticImportServiceIT.java (rev 0)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,98 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata;
+
+import fr.ifremer.echobase.csv.CsvFileImportResult;
+import fr.ifremer.echobase.entities.data.Cell;
+import fr.ifremer.echobase.entities.data.Data;
+import fr.ifremer.echobase.entities.data.DataAcquisition;
+import fr.ifremer.echobase.entities.data.DataProcessing;
+import fr.ifremer.echobase.services.FakeEchoBaseServiceContext;
+import org.junit.Test;
+
+import java.util.List;
+
+/**
+ * Tests {@link AcousticImportService}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class AcousticImportServiceIT extends AbstractImportDataServiceIT {
+
+ protected FakeEchoBaseServiceContext initContext() {
+ return new FakeEchoBaseServiceContext(IMPORT_DATA_ECHOBASE_CATCHES);
+ }
+
+ protected String[] getImportPath(String filename) {
+ return new String[]{"/import-data", "acoustic", filename};
+ }
+
+ @Test
+ public void doImport() throws Exception {
+
+ assertImportCommonData();
+
+ assertNoEntities(DataAcquisition.class,
+ DataProcessing.class,
+ Cell.class,
+ Data.class);
+
+ AcousticImportConfiguration conf =
+ new AcousticImportConfiguration(getLocale());
+
+ conf.setVoyageId(getVoyageId());
+ conf.setVesselId(VESSEL_ID);
+ conf.setAcousticDensityUnit("acousticDensityUnit");
+ conf.setAcquisitionSoftwareVersionER60("acquisitionSoftwareVersionER60");
+ conf.setAcquisitionSoftwareVersionME70("acquisitionSoftwareVersionME70");
+ conf.setAddDataAcquisition(false);
+ conf.setTransceiverAcquisitionAbsorptionDescription("transceiverAcquisitionAbsorptionDescription");
+ conf.setCellPositionReference(CellPositionReference.START);
+ conf.setDigitThreshold(1.5f);
+ conf.setLoggedDataDatatype("loggedDataDatatype");
+ conf.setLoggedDataFormat("loggedDataFormat");
+ conf.setNotes("notes");
+ conf.setPingDutyCycle("pingDutyCycle");
+ conf.setProcessingDescription("processingDescription");
+ conf.setProcessingTemplate("processingTemplate");
+ conf.setSoundSpeedCalculationsER60("soundSpeedCalculationsER60");
+ conf.setSoundSpeedCalculationsME70("soundSpeedCalculationsME70");
+ conf.setTransceiverAcquisitionAbsorptionDescription("transceiverAcquisitionAbsorptionDescription");
+
+ prepareInputFile(conf.getMoviesFile(), getImportPath("movies.csv.gz"));
+
+ List<CsvFileImportResult> result;
+ result = doImport(conf, AcousticImportService.class, 1);
+
+ assertCsvImportResult(result, 0, DataAcquisition.class, NB_DATA_ACQUISITION);
+ assertCsvImportResult(result, 0, DataProcessing.class, NB_DATA_PROCESSING);
+ assertCsvImportResult(result, 0, Cell.class, NB_CELL);
+ assertCsvImportResult(result, 0, Data.class, NB_DATA);
+
+ assertImportAcousticDatas();
+ }
+
+
+}
Property changes on: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticImportServiceIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesDataImportServiceIT.java
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesDataImportServiceIT.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesDataImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,153 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata;
-
-import fr.ifremer.echobase.csv.CsvFileImportResult;
-import fr.ifremer.echobase.entities.data.Sample;
-import fr.ifremer.echobase.entities.data.SampleData;
-import fr.ifremer.echobase.services.FakeEchoBaseServiceContext;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.util.List;
-
-/**
- * Tests {@link CatchesDataImportService}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CatchesDataImportServiceIT extends AbstractImportDataServiceIT {
-
- protected FakeEchoBaseServiceContext initContext() {
- return new FakeEchoBaseServiceContext(IMPORT_DATA_ECHOBASE_OPERATION);
- }
-
- protected String[] getImportPath(String filename) {
- return new String[]{"/import-data", "catchesData", filename};
- }
-
- @Test
- public void doImportAllSamples() throws Exception {
-
- assertImportCommonData();
- assertImportOperations();
- assertNoEntities(Sample.class, SampleData.class);
-
- CatchesDataImportConfiguration conf =
- new CatchesDataImportConfiguration(getLocale());
-
- conf.setVoyageId(getVoyageId());
-
- prepareInputFile(conf.getTotalSampleFile(),
- getImportPath("totalsample.csv.gz"));
- prepareInputFile(conf.getSubSampleFile(),
- getImportPath("subsample.csv.gz"));
- prepareInputFile(conf.getBiometrySampleFile(),
- getImportPath("biometrysample.csv.gz"));
-
- List<CsvFileImportResult> result;
- result = doImport(conf, CatchesDataImportService.class, 3);
-
- assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_TOTAL, 0, NB_SAMPLE);
- assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_TOTAL, 0, NB_SAMPLE_DATA);
-
- assertCsvImportResult(result, 1, Sample.class, NB_SAMPLE_UNSORTED, 0, NB_SAMPLE);
- assertCsvImportResult(result, 1, SampleData.class, NB_SAMPLE_DATA_UNSORTED, 0, NB_SAMPLE_DATA);
-
- assertCsvImportResult(result, 2, Sample.class, NB_SAMPLE_BIOMETRY, 0, NB_SAMPLE);
- assertCsvImportResult(result, 2, SampleData.class, NB_SAMPLE_DATA_BIOMETRY, 0, NB_SAMPLE_DATA);
-
- assertImportSampleDatas();
- }
-
- @Ignore
- @Test
- public void doImportTotalSample() throws Exception {
-
- assertImportCommonData();
- assertImportOperations();
- assertNoEntities(Sample.class, SampleData.class);
-
- CatchesDataImportConfiguration conf =
- new CatchesDataImportConfiguration(getLocale());
-
- conf.setVoyageId(getVoyageId());
-
- prepareInputFile(conf.getTotalSampleFile(),
- getImportPath("totalsample.csv.gz"));
-
- List<CsvFileImportResult> result;
- result = doImport(conf, CatchesDataImportService.class, 1);
-
- assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_TOTAL);
- assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_TOTAL);
- }
-
- @Ignore
- @Test
- public void doImportSubSample() throws Exception {
-
- assertImportCommonData();
- assertImportOperations();
- assertNoEntities(Sample.class, SampleData.class);
-
- CatchesDataImportConfiguration conf =
- new CatchesDataImportConfiguration(getLocale());
-
- conf.setVoyageId(getVoyageId());
-
- prepareInputFile(conf.getSubSampleFile(),
- getImportPath("subsample.csv.gz"));
-
- List<CsvFileImportResult> result;
- result = doImport(conf, CatchesDataImportService.class, 1);
-
- assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_UNSORTED);
- assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_UNSORTED);
- }
-
- @Ignore
- @Test
- public void doImportBiometrySample() throws Exception {
-
- assertImportCommonData();
- assertImportOperations();
- assertNoEntities(Sample.class, SampleData.class);
-
- CatchesDataImportConfiguration conf =
- new CatchesDataImportConfiguration(getLocale());
-
- conf.setVoyageId(getVoyageId());
-
- prepareInputFile(conf.getBiometrySampleFile(),
- getImportPath("biometrysample.csv.gz"));
-
- List<CsvFileImportResult> result;
- result = doImport(conf, CatchesDataImportService.class, 1);
- assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_BIOMETRY);
- assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_BIOMETRY);
- }
-
-}
Copied: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesImportServiceIT.java (from rev 458, trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesDataImportServiceIT.java)
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesImportServiceIT.java (rev 0)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,153 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata;
+
+import fr.ifremer.echobase.csv.CsvFileImportResult;
+import fr.ifremer.echobase.entities.data.Sample;
+import fr.ifremer.echobase.entities.data.SampleData;
+import fr.ifremer.echobase.services.FakeEchoBaseServiceContext;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.List;
+
+/**
+ * Tests {@link CatchesImportService}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class CatchesImportServiceIT extends AbstractImportDataServiceIT {
+
+ protected FakeEchoBaseServiceContext initContext() {
+ return new FakeEchoBaseServiceContext(IMPORT_DATA_ECHOBASE_OPERATION);
+ }
+
+ protected String[] getImportPath(String filename) {
+ return new String[]{"/import-data", "catches", filename};
+ }
+
+ @Test
+ public void doImportAllSamples() throws Exception {
+
+ assertImportCommonData();
+ assertImportOperations();
+ assertNoEntities(Sample.class, SampleData.class);
+
+ CatchesImportConfiguration conf =
+ new CatchesImportConfiguration(getLocale());
+
+ conf.setVoyageId(getVoyageId());
+
+ prepareInputFile(conf.getTotalSampleFile(),
+ getImportPath("totalsample.csv.gz"));
+ prepareInputFile(conf.getSubSampleFile(),
+ getImportPath("subsample.csv.gz"));
+ prepareInputFile(conf.getBiometrySampleFile(),
+ getImportPath("biometrysample.csv.gz"));
+
+ List<CsvFileImportResult> result;
+ result = doImport(conf, CatchesImportService.class, 3);
+
+ assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_TOTAL, 0, NB_SAMPLE);
+ assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_TOTAL, 0, NB_SAMPLE_DATA);
+
+ assertCsvImportResult(result, 1, Sample.class, NB_SAMPLE_UNSORTED, 0, NB_SAMPLE);
+ assertCsvImportResult(result, 1, SampleData.class, NB_SAMPLE_DATA_UNSORTED, 0, NB_SAMPLE_DATA);
+
+ assertCsvImportResult(result, 2, Sample.class, NB_SAMPLE_BIOMETRY, 0, NB_SAMPLE);
+ assertCsvImportResult(result, 2, SampleData.class, NB_SAMPLE_DATA_BIOMETRY, 0, NB_SAMPLE_DATA);
+
+ assertImportSampleDatas();
+ }
+
+ @Ignore
+ @Test
+ public void doImportTotalSample() throws Exception {
+
+ assertImportCommonData();
+ assertImportOperations();
+ assertNoEntities(Sample.class, SampleData.class);
+
+ CatchesImportConfiguration conf =
+ new CatchesImportConfiguration(getLocale());
+
+ conf.setVoyageId(getVoyageId());
+
+ prepareInputFile(conf.getTotalSampleFile(),
+ getImportPath("totalsample.csv.gz"));
+
+ List<CsvFileImportResult> result;
+ result = doImport(conf, CatchesImportService.class, 1);
+
+ assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_TOTAL);
+ assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_TOTAL);
+ }
+
+ @Ignore
+ @Test
+ public void doImportSubSample() throws Exception {
+
+ assertImportCommonData();
+ assertImportOperations();
+ assertNoEntities(Sample.class, SampleData.class);
+
+ CatchesImportConfiguration conf =
+ new CatchesImportConfiguration(getLocale());
+
+ conf.setVoyageId(getVoyageId());
+
+ prepareInputFile(conf.getSubSampleFile(),
+ getImportPath("subsample.csv.gz"));
+
+ List<CsvFileImportResult> result;
+ result = doImport(conf, CatchesImportService.class, 1);
+
+ assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_UNSORTED);
+ assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_UNSORTED);
+ }
+
+ @Ignore
+ @Test
+ public void doImportBiometrySample() throws Exception {
+
+ assertImportCommonData();
+ assertImportOperations();
+ assertNoEntities(Sample.class, SampleData.class);
+
+ CatchesImportConfiguration conf =
+ new CatchesImportConfiguration(getLocale());
+
+ conf.setVoyageId(getVoyageId());
+
+ prepareInputFile(conf.getBiometrySampleFile(),
+ getImportPath("biometrysample.csv.gz"));
+
+ List<CsvFileImportResult> result;
+ result = doImport(conf, CatchesImportService.class, 1);
+ assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_BIOMETRY);
+ assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_BIOMETRY);
+ }
+
+}
Property changes on: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesImportServiceIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/Common2ImportServiceIT.java (from rev 458, trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonData2ImportServiceIT.java)
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/Common2ImportServiceIT.java (rev 0)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/Common2ImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,84 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata;
+
+import fr.ifremer.echobase.csv.CsvFileImportResult;
+import fr.ifremer.echobase.entities.data.Transect;
+import fr.ifremer.echobase.entities.data.Transit;
+import fr.ifremer.echobase.services.FakeEchoBaseServiceContext;
+import org.junit.Test;
+
+import java.util.List;
+
+/**
+ * Tests {@link CommonImportService} with {@link CommonImportMode#TRANSECT} mode.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class Common2ImportServiceIT extends AbstractImportDataServiceIT {
+
+ protected FakeEchoBaseServiceContext initContext() {
+ return new FakeEchoBaseServiceContext(IMPORT_DATA_ECHOBASE_COMMON_DATA);
+ }
+
+ protected String[] getImportPath(String filename) {
+ return new String[]{"/import-data", "common", filename};
+ }
+
+ @Test
+ public void doImport() throws Exception {
+
+ // import with mode transect
+
+ assertImportCommonData();
+
+ CommonImportConfiguration conf =
+ new CommonImportConfiguration(getLocale());
+
+ conf.setAreaOfOperationId(AREA_OF_OPERATION_ID);
+ conf.setDatum("datum");
+ conf.setVoyageId(getVoyageId());
+ conf.setTransectBinUnitsPingAxis("transectBinUnitsPingAxis");
+ conf.setTransectGeospatialVerticalPositive("transectGeospatialVerticalPositive");
+ conf.setTransectLicence("transectLicence");
+
+ prepareInputFile(conf.getTransectFile(), getImportPath("transect.csv.gz"));
+
+ conf.setImportMode(CommonImportMode.TRANSECT);
+
+ // let's delete every transects
+ for (Transit transit : getEntities(Transit.class)) {
+ transit.clearTransect();
+ }
+
+ List<CsvFileImportResult> result;
+ result = doImport(conf, CommonImportService.class, 1);
+
+ assertCsvImportResult(result, 0, Transect.class, NB_TRANSECT);
+
+ assertImportCommonData();
+ }
+
+}
Property changes on: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/Common2ImportServiceIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonData2ImportServiceIT.java
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonData2ImportServiceIT.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonData2ImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,84 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata;
-
-import fr.ifremer.echobase.csv.CsvFileImportResult;
-import fr.ifremer.echobase.entities.data.Transect;
-import fr.ifremer.echobase.entities.data.Transit;
-import fr.ifremer.echobase.services.FakeEchoBaseServiceContext;
-import org.junit.Test;
-
-import java.util.List;
-
-/**
- * Tests {@link CommonDataImportService} with {@link CommonDataImportMode#TRANSECT} mode.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CommonData2ImportServiceIT extends AbstractImportDataServiceIT {
-
- protected FakeEchoBaseServiceContext initContext() {
- return new FakeEchoBaseServiceContext(IMPORT_DATA_ECHOBASE_COMMON_DATA);
- }
-
- protected String[] getImportPath(String filename) {
- return new String[]{"/import-data", "commonData", filename};
- }
-
- @Test
- public void doImport() throws Exception {
-
- // import with mode transect
-
- assertImportCommonData();
-
- CommonDataImportConfiguration conf =
- new CommonDataImportConfiguration(getLocale());
-
- conf.setAreaOfOperationId(AREA_OF_OPERATION_ID);
- conf.setDatum("datum");
- conf.setVoyageId(getVoyageId());
- conf.setTransectBinUnitsPingAxis("transectBinUnitsPingAxis");
- conf.setTransectGeospatialVerticalPositive("transectGeospatialVerticalPositive");
- conf.setTransectLicence("transectLicence");
-
- prepareInputFile(conf.getTransectFile(), getImportPath("transect.csv.gz"));
-
- conf.setImportMode(CommonDataImportMode.TRANSECT);
-
- // let's delete every transects
- for (Transit transit : getEntities(Transit.class)) {
- transit.clearTransect();
- }
-
- List<CsvFileImportResult> result;
- result = doImport(conf, CommonDataImportService.class, 1);
-
- assertCsvImportResult(result, 0, Transect.class, NB_TRANSECT);
-
- assertImportCommonData();
- }
-
-}
Deleted: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonDataImportServiceIT.java
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonDataImportServiceIT.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonDataImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,90 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.services.importdata;
-
-import fr.ifremer.echobase.csv.CsvFileImportResult;
-import fr.ifremer.echobase.entities.data.Transect;
-import fr.ifremer.echobase.entities.data.Transit;
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.services.FakeEchoBaseServiceContext;
-import org.junit.Test;
-
-import java.util.List;
-
-/**
- * Tests {@link CommonDataImportService} with {@link CommonDataImportMode#ALL} mode.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CommonDataImportServiceIT extends AbstractImportDataServiceIT {
-
- @Override
- protected FakeEchoBaseServiceContext initContext() {
- return new FakeEchoBaseServiceContext(
- IMPORT_DATA_ECHOBASE_NO_DATA);
- }
-
- protected String[] getImportPath(String filename) {
- return new String[]{"/import-data", "commonData", filename};
- }
-
- @Test
- public void doImport() throws Exception {
-
- // no data in db
-
- assertNoEntities(Voyage.class, Transit.class, Transect.class);
-
- // import with mode all (voyage / transit / transect)
-
- CommonDataImportConfiguration conf =
- new CommonDataImportConfiguration(getLocale());
-
- conf.setAreaOfOperationId(AREA_OF_OPERATION_ID);
- conf.setDatum("datum");
- conf.setMissionId(MISSION_ID);
- conf.setTransectBinUnitsPingAxis("transectBinUnitsPingAxis");
- conf.setTransectGeospatialVerticalPositive("transectGeospatialVerticalPositive");
- conf.setTransectLicence("transectLicence");
- conf.setTransitRelatedActivity("transitRelatedActivity");
- conf.setVoyageDescription("voyageDescription");
-
- prepareInputFile(conf.getVoyageFile(), getImportPath("voyage.csv.gz"));
- prepareInputFile(conf.getTransitFile(), getImportPath("transit.csv.gz"));
- prepareInputFile(conf.getTransectFile(), getImportPath("transect.csv.gz"));
-
- conf.setImportMode(CommonDataImportMode.ALL);
-
- List<CsvFileImportResult> result;
- result = doImport(conf, CommonDataImportService.class, 3);
-
- assertCsvImportResult(result, 0, Voyage.class, NB_VOYAGE);
- assertCsvImportResult(result, 1, Transit.class, NB_TRANSIT);
- assertCsvImportResult(result, 2, Transect.class, NB_TRANSECT);
-
- assertImportCommonData();
- }
-
-}
Copied: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonImportServiceIT.java (from rev 458, trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonDataImportServiceIT.java)
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonImportServiceIT.java (rev 0)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,90 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.services.importdata;
+
+import fr.ifremer.echobase.csv.CsvFileImportResult;
+import fr.ifremer.echobase.entities.data.Transect;
+import fr.ifremer.echobase.entities.data.Transit;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.services.FakeEchoBaseServiceContext;
+import org.junit.Test;
+
+import java.util.List;
+
+/**
+ * Tests {@link CommonImportService} with {@link CommonImportMode#ALL} mode.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class CommonImportServiceIT extends AbstractImportDataServiceIT {
+
+ @Override
+ protected FakeEchoBaseServiceContext initContext() {
+ return new FakeEchoBaseServiceContext(
+ IMPORT_DATA_ECHOBASE_NO_DATA);
+ }
+
+ protected String[] getImportPath(String filename) {
+ return new String[]{"/import-data", "common", filename};
+ }
+
+ @Test
+ public void doImport() throws Exception {
+
+ // no data in db
+
+ assertNoEntities(Voyage.class, Transit.class, Transect.class);
+
+ // import with mode all (voyage / transit / transect)
+
+ CommonImportConfiguration conf =
+ new CommonImportConfiguration(getLocale());
+
+ conf.setAreaOfOperationId(AREA_OF_OPERATION_ID);
+ conf.setDatum("datum");
+ conf.setMissionId(MISSION_ID);
+ conf.setTransectBinUnitsPingAxis("transectBinUnitsPingAxis");
+ conf.setTransectGeospatialVerticalPositive("transectGeospatialVerticalPositive");
+ conf.setTransectLicence("transectLicence");
+ conf.setTransitRelatedActivity("transitRelatedActivity");
+ conf.setVoyageDescription("voyageDescription");
+
+ prepareInputFile(conf.getVoyageFile(), getImportPath("voyage.csv.gz"));
+ prepareInputFile(conf.getTransitFile(), getImportPath("transit.csv.gz"));
+ prepareInputFile(conf.getTransectFile(), getImportPath("transect.csv.gz"));
+
+ conf.setImportMode(CommonImportMode.ALL);
+
+ List<CsvFileImportResult> result;
+ result = doImport(conf, CommonImportService.class, 3);
+
+ assertCsvImportResult(result, 0, Voyage.class, NB_VOYAGE);
+ assertCsvImportResult(result, 1, Transit.class, NB_TRANSIT);
+ assertCsvImportResult(result, 2, Transect.class, NB_TRANSECT);
+
+ assertImportCommonData();
+ }
+
+}
Property changes on: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonImportServiceIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-services/src/test/resources/log4j.properties
===================================================================
--- trunk/echobase-services/src/test/resources/log4j.properties 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/src/test/resources/log4j.properties 2012-03-30 16:46:14 UTC (rev 460)
@@ -31,4 +31,4 @@
# package level
log4j.logger.fr.ifremer.echobase=INFO
#log4j.logger.fr.ifremer.echobase.services.ReplicateEntityVisitor=DEBUG
-#log4j.logger.fr.ifremer.echobase.services.importdata.AcousticDataImportService=DEBUG
+#log4j.logger.fr.ifremer.echobase.services.importdata.AcousticImportServiceUG
Modified: trunk/echobase-services/update-import-data-db.sh
===================================================================
--- trunk/echobase-services/update-import-data-db.sh 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-services/update-import-data-db.sh 2012-03-30 16:46:14 UTC (rev 460)
@@ -38,15 +38,15 @@
executeMaven fr.ifremer.echobase.services.ImportDbServiceTest nodata
-executeMaven fr.ifremer.echobase.services.importdata.CommonDataImportServiceIT commonData
+executeMaven fr.ifremer.echobase.services.importdata.CommonImportServiceIT commonData
executeMaven fr.ifremer.echobase.services.importdata.OperationImportServiceIT operation
-executeMaven fr.ifremer.echobase.services.importdata.CatchesDataImportServiceIT catches
+executeMaven fr.ifremer.echobase.services.importdata.CatchesImportServiceIT catches
executeMaven fr.ifremer.echobase.services.importdata.ResultsVoyageImportServiceIT catches-and-voyage-result
-#executeMaven fr.ifremer.echobase.services.importdata.AcousticDataImportServiceIT catches-and-acoustic-and-voyage-result
+#executeMaven fr.ifremer.echobase.services.importdata.AcousticImportServiceIT catches-and-acoustic-and-voyage-result
#executeMaven fr.ifremer.echobase.services.importdata.ResultsEsduCellImportServiceIT
Modified: trunk/echobase-ui/pom.xml
===================================================================
--- trunk/echobase-ui/pom.xml 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/pom.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -328,20 +328,6 @@
</configuration>
</plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jspc-maven-plugin</artifactId>
- <version>1.4.6</version>
- <executions>
- <execution>
- <id>jspc</id>
- <goals>
- <goal>compile</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
</plugins>
</pluginManagement>
</build>
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -23,16 +23,14 @@
*/
package fr.ifremer.echobase.ui.actions.importData;
-import fr.ifremer.echobase.csv.CsvFileImportResult;
import fr.ifremer.echobase.services.ImportException;
import fr.ifremer.echobase.services.importdata.AbstractImportConfiguration;
import fr.ifremer.echobase.services.importdata.AbstractImportDataService;
import fr.ifremer.echobase.ui.actions.AbstractWaitAndExecAction;
+import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.List;
-
/**
* TODO
*
@@ -54,7 +52,7 @@
protected transient Exception error;
- protected List<CsvFileImportResult> result;
+ protected String result;
protected AbstractLaunchImport(Class<M> modelType, Class<S> serviceType) {
this.modelType = modelType;
@@ -66,7 +64,7 @@
return getEchoBaseSession().getImportDataConfiguration(modelType);
}
- public List<CsvFileImportResult> getResult() {
+ public String getResult() {
return result;
}
@@ -74,6 +72,17 @@
return error;
}
+ public String getErrorStack() {
+
+ String errorStack = null;
+ if (error != null) {
+
+ errorStack = ExceptionUtils.getStackTrace(error);
+ }
+
+ return errorStack;
+ }
+
@Override
public void prepare() throws Exception {
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,96 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.ui.actions.importData;
-
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.services.EchoBaseServiceSupport;
-import fr.ifremer.echobase.services.importdata.AcousticDataImportConfiguration;
-import fr.ifremer.echobase.services.importdata.CellPositionReference;
-
-import java.io.File;
-import java.util.Map;
-
-/**
- * Configure a accoustic data import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class ConfigureAcousticData extends AbstractConfigureImport<AcousticDataImportConfiguration> {
-
- private static final long serialVersionUID = 1L;
-
- /** Universe of existing voyages. */
- protected Map<String, String> voyages;
-
- protected Map<String, String> cellPositionReferences;
-
- public ConfigureAcousticData() {
- super(AcousticDataImportConfiguration.class);
- }
-
- @Override
- protected AcousticDataImportConfiguration createModel() {
- return new AcousticDataImportConfiguration(getLocale());
- }
-
- @Override
- public String input() throws Exception {
-
- super.input();
-
- EchoBaseServiceSupport service =
- newService(EchoBaseServiceSupport.class);
-
- voyages = loadSortAndDecorate(service, Voyage.class);
- cellPositionReferences = decorateEnums(CellPositionReference.values());
-
- if (getModel().getCellPositionReference() == null) {
-
- getModel().setCellPositionReference(CellPositionReference.START);
- }
-
- return INPUT;
- }
-
- public Map<String, String> getVoyages() {
- return voyages;
- }
-
- public Map<String, String> getCellPositionReferences() {
- return cellPositionReferences;
- }
-
- public void setMoviesFile(File file) {
- getModel().getMoviesFile().setFile(file);
- }
-
- public void setMoviesFileContentType(String contentType) {
- getModel().getMoviesFile().setContentType(contentType);
- }
-
- public void setMoviesFileFileName(String fileName) {
- getModel().getMoviesFile().setFileName(fileName);
- }
-}
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport.java (from rev 458, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,96 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.ui.actions.importData;
+
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.services.EchoBaseServiceSupport;
+import fr.ifremer.echobase.services.importdata.AcousticImportConfiguration;
+import fr.ifremer.echobase.services.importdata.CellPositionReference;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ * Configure a accoustic data import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class ConfigureAcousticImport extends AbstractConfigureImport<AcousticImportConfiguration> {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Universe of existing voyages. */
+ protected Map<String, String> voyages;
+
+ protected Map<String, String> cellPositionReferences;
+
+ public ConfigureAcousticImport() {
+ super(AcousticImportConfiguration.class);
+ }
+
+ @Override
+ protected AcousticImportConfiguration createModel() {
+ return new AcousticImportConfiguration(getLocale());
+ }
+
+ @Override
+ public String input() throws Exception {
+
+ super.input();
+
+ EchoBaseServiceSupport service =
+ newService(EchoBaseServiceSupport.class);
+
+ voyages = loadSortAndDecorate(service, Voyage.class);
+ cellPositionReferences = decorateEnums(CellPositionReference.values());
+
+ if (getModel().getCellPositionReference() == null) {
+
+ getModel().setCellPositionReference(CellPositionReference.START);
+ }
+
+ return INPUT;
+ }
+
+ public Map<String, String> getVoyages() {
+ return voyages;
+ }
+
+ public Map<String, String> getCellPositionReferences() {
+ return cellPositionReferences;
+ }
+
+ public void setMoviesFile(File file) {
+ getModel().getMoviesFile().setFile(file);
+ }
+
+ public void setMoviesFileContentType(String contentType) {
+ getModel().getMoviesFile().setContentType(contentType);
+ }
+
+ public void setMoviesFileFileName(String fileName) {
+ getModel().getMoviesFile().setFileName(fileName);
+ }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,107 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.ui.actions.importData;
-
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.services.EchoBaseServiceSupport;
-import fr.ifremer.echobase.services.importdata.CatchesDataImportConfiguration;
-
-import java.io.File;
-import java.util.Map;
-
-/**
- * Configure a "catches data" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class ConfigureCatchesData extends AbstractConfigureImport<CatchesDataImportConfiguration> {
-
- private static final long serialVersionUID = 1L;
-
- /** Universe of existing voyages. */
- protected Map<String, String> voyages;
-
- public ConfigureCatchesData() {
- super(CatchesDataImportConfiguration.class);
- }
-
- @Override
- protected CatchesDataImportConfiguration createModel() {
- return new CatchesDataImportConfiguration(getLocale());
- }
-
- @Override
- public String input() throws Exception {
-
- super.input();
-
- EchoBaseServiceSupport service =
- newService(EchoBaseServiceSupport.class);
-
- voyages = loadSortAndDecorate(service, Voyage.class);
-
- return INPUT;
- }
-
- public Map<String, String> getVoyages() {
- return voyages;
- }
-
- public void setTotalSampleFile(File file) {
- getModel().getTotalSampleFile().setFile(file);
- }
-
- public void setTotalSampleFileContentType(String contentType) {
- getModel().getTotalSampleFile().setContentType(contentType);
- }
-
- public void setTotalSampleFileFileName(String fileName) {
- getModel().getTotalSampleFile().setFileName(fileName);
- }
-
- public void setSubSampleFile(File file) {
- getModel().getSubSampleFile().setFile(file);
- }
-
- public void setSubSampleFileContentType(String contentType) {
- getModel().getSubSampleFile().setContentType(contentType);
- }
-
- public void setSubSampleFileFileName(String fileName) {
- getModel().getSubSampleFile().setFileName(fileName);
- }
-
- public void setBiometrySampleFile(File file) {
- getModel().getBiometrySampleFile().setFile(file);
- }
-
- public void setBiometrySampleFileContentType(String contentType) {
- getModel().getBiometrySampleFile().setContentType(contentType);
- }
-
- public void setBiometrySampleFileFileName(String fileName) {
- getModel().getBiometrySampleFile().setFileName(fileName);
- }
-}
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport.java (from rev 458, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,107 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.ui.actions.importData;
+
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.services.EchoBaseServiceSupport;
+import fr.ifremer.echobase.services.importdata.CatchesImportConfiguration;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ * Configure a "catches data" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class ConfigureCatchesImport extends AbstractConfigureImport<CatchesImportConfiguration> {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Universe of existing voyages. */
+ protected Map<String, String> voyages;
+
+ public ConfigureCatchesImport() {
+ super(CatchesImportConfiguration.class);
+ }
+
+ @Override
+ protected CatchesImportConfiguration createModel() {
+ return new CatchesImportConfiguration(getLocale());
+ }
+
+ @Override
+ public String input() throws Exception {
+
+ super.input();
+
+ EchoBaseServiceSupport service =
+ newService(EchoBaseServiceSupport.class);
+
+ voyages = loadSortAndDecorate(service, Voyage.class);
+
+ return INPUT;
+ }
+
+ public Map<String, String> getVoyages() {
+ return voyages;
+ }
+
+ public void setTotalSampleFile(File file) {
+ getModel().getTotalSampleFile().setFile(file);
+ }
+
+ public void setTotalSampleFileContentType(String contentType) {
+ getModel().getTotalSampleFile().setContentType(contentType);
+ }
+
+ public void setTotalSampleFileFileName(String fileName) {
+ getModel().getTotalSampleFile().setFileName(fileName);
+ }
+
+ public void setSubSampleFile(File file) {
+ getModel().getSubSampleFile().setFile(file);
+ }
+
+ public void setSubSampleFileContentType(String contentType) {
+ getModel().getSubSampleFile().setContentType(contentType);
+ }
+
+ public void setSubSampleFileFileName(String fileName) {
+ getModel().getSubSampleFile().setFileName(fileName);
+ }
+
+ public void setBiometrySampleFile(File file) {
+ getModel().getBiometrySampleFile().setFile(file);
+ }
+
+ public void setBiometrySampleFileContentType(String contentType) {
+ getModel().getBiometrySampleFile().setContentType(contentType);
+ }
+
+ public void setBiometrySampleFileFileName(String fileName) {
+ getModel().getBiometrySampleFile().setFileName(fileName);
+ }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,153 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.ui.actions.importData;
-
-import com.opensymphony.xwork2.interceptor.annotations.InputConfig;
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.entities.references.AreaOfOperation;
-import fr.ifremer.echobase.entities.references.Mission;
-import fr.ifremer.echobase.services.EchoBaseServiceSupport;
-import fr.ifremer.echobase.services.importdata.CommonDataImportConfiguration;
-import fr.ifremer.echobase.services.importdata.CommonDataImportMode;
-
-import java.io.File;
-import java.util.Map;
-
-/**
- * Configure a accoustic data import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class ConfigureCommonData extends AbstractConfigureImport<CommonDataImportConfiguration> {
-
- private static final long serialVersionUID = 1L;
-
- /** Universe of existing missions. */
- protected Map<String, String> missions;
-
- /** Universe of existing voyages. */
- protected Map<String, String> voyages;
-
- /** Universe of existing area of operations. */
- protected Map<String, String> areaOfOperations;
-
- /** Universe of possible import modes. */
- protected Map<String, String> importModes;
-
- public ConfigureCommonData() {
- super(CommonDataImportConfiguration.class);
- }
-
- @Override
- protected CommonDataImportConfiguration createModel() {
- return new CommonDataImportConfiguration(getLocale());
- }
-
- @Override
- public String input() throws Exception {
-
- super.input();
-
- EchoBaseServiceSupport service =
- newService(EchoBaseServiceSupport.class);
-
- missions = loadSortAndDecorate(service, Mission.class);
- voyages = loadSortAndDecorate(service, Voyage.class);
- areaOfOperations = loadSortAndDecorate(service, AreaOfOperation.class);
- importModes = decorateEnums(CommonDataImportMode.values());
-
- if (getModel().getImportMode() == null) {
-
- getModel().setImportMode(CommonDataImportMode.ALL);
- }
-
- return INPUT;
- }
-
- @InputConfig(methodName = "input")
- public String modeAll() throws Exception {
-
- return execute();
- }
-
- @InputConfig(methodName = "input")
- public String modeTransect() throws Exception {
-
- return execute();
- }
-
- public Map<String, String> getMissions() {
- return missions;
- }
-
- public Map<String, String> getVoyages() {
- return voyages;
- }
-
- public Map<String, String> getAreaOfOperations() {
- return areaOfOperations;
- }
-
- public Map<String, String> getImportModes() {
- return importModes;
- }
-
- public void setVoyageFile(File file) {
- getModel().getVoyageFile().setFile(file);
- }
-
- public void setVoyageFileContentType(String contentType) {
- getModel().getVoyageFile().setContentType(contentType);
- }
-
- public void setVoyageFileFileName(String fileName) {
- getModel().getVoyageFile().setFileName(fileName);
- }
-
- public void setTransitFile(File file) {
- getModel().getTransitFile().setFile(file);
- }
-
- public void setTransitFileContentType(String contentType) {
- getModel().getTransitFile().setContentType(contentType);
- }
-
- public void setTransitFileFileName(String fileName) {
- getModel().getTransitFile().setFileName(fileName);
- }
-
- public void setTransectFile(File file) {
- getModel().getTransectFile().setFile(file);
- }
-
- public void setTransectFileContentType(String contentType) {
- getModel().getTransectFile().setContentType(contentType);
- }
-
- public void setTransectFileFileName(String fileName) {
- getModel().getTransectFile().setFileName(fileName);
- }
-
-}
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport.java (from rev 458, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,153 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.ui.actions.importData;
+
+import com.opensymphony.xwork2.interceptor.annotations.InputConfig;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.AreaOfOperation;
+import fr.ifremer.echobase.entities.references.Mission;
+import fr.ifremer.echobase.services.EchoBaseServiceSupport;
+import fr.ifremer.echobase.services.importdata.CommonImportConfiguration;
+import fr.ifremer.echobase.services.importdata.CommonImportMode;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ * Configure a common data (voyage / transit / transect) import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class ConfigureCommonImport extends AbstractConfigureImport<CommonImportConfiguration> {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Universe of existing missions. */
+ protected Map<String, String> missions;
+
+ /** Universe of existing voyages. */
+ protected Map<String, String> voyages;
+
+ /** Universe of existing area of operations. */
+ protected Map<String, String> areaOfOperations;
+
+ /** Universe of possible import modes. */
+ protected Map<String, String> importModes;
+
+ public ConfigureCommonImport() {
+ super(CommonImportConfiguration.class);
+ }
+
+ @Override
+ protected CommonImportConfiguration createModel() {
+ return new CommonImportConfiguration(getLocale());
+ }
+
+ @Override
+ public String input() throws Exception {
+
+ super.input();
+
+ EchoBaseServiceSupport service =
+ newService(EchoBaseServiceSupport.class);
+
+ missions = loadSortAndDecorate(service, Mission.class);
+ voyages = loadSortAndDecorate(service, Voyage.class);
+ areaOfOperations = loadSortAndDecorate(service, AreaOfOperation.class);
+ importModes = decorateEnums(CommonImportMode.values());
+
+ if (getModel().getImportMode() == null) {
+
+ getModel().setImportMode(CommonImportMode.ALL);
+ }
+
+ return INPUT;
+ }
+
+ @InputConfig(methodName = "input")
+ public String modeAll() throws Exception {
+
+ return execute();
+ }
+
+ @InputConfig(methodName = "input")
+ public String modeTransect() throws Exception {
+
+ return execute();
+ }
+
+ public Map<String, String> getMissions() {
+ return missions;
+ }
+
+ public Map<String, String> getVoyages() {
+ return voyages;
+ }
+
+ public Map<String, String> getAreaOfOperations() {
+ return areaOfOperations;
+ }
+
+ public Map<String, String> getImportModes() {
+ return importModes;
+ }
+
+ public void setVoyageFile(File file) {
+ getModel().getVoyageFile().setFile(file);
+ }
+
+ public void setVoyageFileContentType(String contentType) {
+ getModel().getVoyageFile().setContentType(contentType);
+ }
+
+ public void setVoyageFileFileName(String fileName) {
+ getModel().getVoyageFile().setFileName(fileName);
+ }
+
+ public void setTransitFile(File file) {
+ getModel().getTransitFile().setFile(file);
+ }
+
+ public void setTransitFileContentType(String contentType) {
+ getModel().getTransitFile().setContentType(contentType);
+ }
+
+ public void setTransitFileFileName(String fileName) {
+ getModel().getTransitFile().setFileName(fileName);
+ }
+
+ public void setTransectFile(File file) {
+ getModel().getTransectFile().setFile(file);
+ }
+
+ public void setTransectFileContentType(String contentType) {
+ getModel().getTransectFile().setContentType(contentType);
+ }
+
+ public void setTransectFileFileName(String fileName) {
+ getModel().getTransectFile().setFileName(fileName);
+ }
+
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,106 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.ui.actions.importData;
-
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.services.EchoBaseServiceSupport;
-import fr.ifremer.echobase.services.importdata.OperationImportConfiguration;
-
-import java.io.File;
-import java.util.Map;
-
-/**
- * TODO
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class ConfigureOperation extends AbstractConfigureImport<OperationImportConfiguration> {
-
- private static final long serialVersionUID = 1L;
-
- /** Universe of existing voyages. */
- protected Map<String, String> voyages;
-
- public ConfigureOperation() {
- super(OperationImportConfiguration.class);
- }
-
- @Override
- protected OperationImportConfiguration createModel() {
- return new OperationImportConfiguration(getLocale());
- }
-
- @Override
- public String input() throws Exception {
-
- super.input();
-
- EchoBaseServiceSupport service =
- newService(EchoBaseServiceSupport.class);
-
- voyages = loadSortAndDecorate(service, Voyage.class);
- return INPUT;
- }
-
- public Map<String, String> getVoyages() {
- return voyages;
- }
-
- public void setOperationFile(File file) {
- getModel().getOperationFile().setFile(file);
- }
-
- public void setOperationFileContentType(String contentType) {
- getModel().getOperationFile().setContentType(contentType);
- }
-
- public void setOperationFileFileName(String fileName) {
- getModel().getOperationFile().setFileName(fileName);
- }
-
- public void setOperationMetadataFile(File file) {
- getModel().getOperationMetadataFile().setFile(file);
- }
-
- public void setOperationMetadataFileContentType(String contentType) {
- getModel().getOperationMetadataFile().setContentType(contentType);
- }
-
- public void setOperationMetadataFileFileName(String fileName) {
- getModel().getOperationMetadataFile().setFileName(fileName);
- }
-
- public void setGearMetadataFile(File file) {
- getModel().getGearMetadataFile().setFile(file);
- }
-
- public void setGearMetadataFileContentType(String contentType) {
- getModel().getGearMetadataFile().setContentType(contentType);
- }
-
- public void setGearMetadataFileFileName(String fileName) {
- getModel().getGearMetadataFile().setFileName(fileName);
- }
-}
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport.java (from rev 458, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,106 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.ui.actions.importData;
+
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.services.EchoBaseServiceSupport;
+import fr.ifremer.echobase.services.importdata.OperationImportConfiguration;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ * Configure a "Operation" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class ConfigureOperationImport extends AbstractConfigureImport<OperationImportConfiguration> {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Universe of existing voyages. */
+ protected Map<String, String> voyages;
+
+ public ConfigureOperationImport() {
+ super(OperationImportConfiguration.class);
+ }
+
+ @Override
+ protected OperationImportConfiguration createModel() {
+ return new OperationImportConfiguration(getLocale());
+ }
+
+ @Override
+ public String input() throws Exception {
+
+ super.input();
+
+ EchoBaseServiceSupport service =
+ newService(EchoBaseServiceSupport.class);
+
+ voyages = loadSortAndDecorate(service, Voyage.class);
+ return INPUT;
+ }
+
+ public Map<String, String> getVoyages() {
+ return voyages;
+ }
+
+ public void setOperationFile(File file) {
+ getModel().getOperationFile().setFile(file);
+ }
+
+ public void setOperationFileContentType(String contentType) {
+ getModel().getOperationFile().setContentType(contentType);
+ }
+
+ public void setOperationFileFileName(String fileName) {
+ getModel().getOperationFile().setFileName(fileName);
+ }
+
+ public void setOperationMetadataFile(File file) {
+ getModel().getOperationMetadataFile().setFile(file);
+ }
+
+ public void setOperationMetadataFileContentType(String contentType) {
+ getModel().getOperationMetadataFile().setContentType(contentType);
+ }
+
+ public void setOperationMetadataFileFileName(String fileName) {
+ getModel().getOperationMetadataFile().setFileName(fileName);
+ }
+
+ public void setGearMetadataFile(File file) {
+ getModel().getGearMetadataFile().setFile(file);
+ }
+
+ public void setGearMetadataFileContentType(String contentType) {
+ getModel().getGearMetadataFile().setContentType(contentType);
+ }
+
+ public void setGearMetadataFileFileName(String fileName) {
+ getModel().getGearMetadataFile().setFileName(fileName);
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,261 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.ui.actions.importData;
-
-import com.opensymphony.xwork2.interceptor.annotations.InputConfig;
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.entities.references.Vessel;
-import fr.ifremer.echobase.services.EchoBaseServiceSupport;
-import fr.ifremer.echobase.services.importdata.ResultsImportConfiguration;
-import fr.ifremer.echobase.services.importdata.ResultsImportMode;
-
-import java.io.File;
-import java.util.Map;
-
-/**
- * Configure a "accoustic region data" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class ConfigureResults extends AbstractConfigureImport<ResultsImportConfiguration> {
-
- private static final long serialVersionUID = 1L;
-
- /** Universe of existing voyages. */
- protected Map<String, String> voyages;
-
- /** Universe of existing vessels. */
- protected Map<String, String> vessels;
-
- /** Universe of possible import modes. */
- protected Map<String, String> importModes;
-
- protected String resultLabel;
-
- public ConfigureResults() {
- super(ResultsImportConfiguration.class);
- }
-
- @Override
- protected ResultsImportConfiguration createModel() {
- return new ResultsImportConfiguration(getLocale());
- }
-
- @Override
- public String input() throws Exception {
-
- super.input();
-
- EchoBaseServiceSupport service =
- newService(EchoBaseServiceSupport.class);
-
- voyages = loadSortAndDecorate(service, Voyage.class);
- vessels = loadSortAndDecorate(service, Vessel.class);
- importModes = decorateEnums(ResultsImportMode.values());
-
- if (getModel().getImportMode() == null) {
-
- getModel().setImportMode(ResultsImportMode.VOYAGE);
- }
- return INPUT;
- }
-
- @InputConfig(methodName = "input")
- public String modeVoyage() throws Exception {
-
- return execute();
- }
-
- @InputConfig(methodName = "input")
- public String modeEsdu() throws Exception {
-
- return execute();
- }
-
- @InputConfig(methodName = "input")
- public String modeRegion() throws Exception {
-
- return execute();
- }
-
- @InputConfig(methodName = "input")
- public String modeMap() throws Exception {
-
- return execute();
- }
-
- public Map<String, String> getVoyages() {
- return voyages;
- }
-
- public Map<String, String> getVessels() {
- return vessels;
- }
-
- public Map<String, String> getImportModes() {
- return importModes;
- }
-
-
- public String getResultLabel() {
- return resultLabel;
- }
-
- public void setResultLabel(String resultLabel) {
- this.resultLabel = resultLabel;
- }
-
- public void setRegionsFile(File file) {
- getModel().getRegionsFile().setFile(file);
- }
-
- public void setRegionsFileContentType(String contentType) {
- getModel().getRegionsFile().setContentType(contentType);
- }
-
- public void setRegionsFileFileName(String fileName) {
- getModel().getRegionsFile().setFileName(fileName);
- }
-
- public void setRegionAssociationFile(File file) {
- getModel().getRegionAssociationFile().setFile(file);
- }
-
- public void setRegionAssociationFileContentType(String contentType) {
- getModel().getRegionAssociationFile().setContentType(contentType);
- }
-
- public void setRegionAssociationFileFileName(String fileName) {
- getModel().getRegionAssociationFile().setFileName(fileName);
- }
-
- public void setRegionResultFile(File file) {
- getModel().getRegionResultFile().setFile(file);
- }
-
- public void setRegionResultFileContentType(String contentType) {
- getModel().getRegionResultFile().setContentType(contentType);
- }
-
- public void setRegionResultFileFileName(String fileName) {
- getModel().getRegionResultFile().setFileName(fileName);
- }
-
- public void setMapsFile(File file) {
- getModel().getMapsFile().setFile(file);
- }
-
- public void setMapsFileContentType(String contentType) {
- getModel().getMapsFile().setContentType(contentType);
- }
-
- public void setMapsFileFileName(String fileName) {
- getModel().getMapsFile().setFileName(fileName);
- }
-
- public void setLengthAgeKeyFile(File file) {
- getModel().getLengthAgeKeyFile().setFile(file);
- }
-
- public void setLengthAgeKeyFileContentType(String contentType) {
- getModel().getLengthAgeKeyFile().setContentType(contentType);
- }
-
- public void setLengthAgeKeyFileFileName(String fileName) {
- getModel().getLengthAgeKeyFile().setFileName(fileName);
- }
-
- public void setLengthWeightKeyFile(File file) {
- getModel().getLengthWeightKeyFile().setFile(file);
- }
-
- public void setLengthWeightKeyFileContentType(String contentType) {
- getModel().getLengthWeightKeyFile().setContentType(contentType);
- }
-
- public void setLengthWeightKeyFileFileName(String fileName) {
- getModel().getLengthWeightKeyFile().setFileName(fileName);
- }
-
- public void setEchotypeFile(File file) {
- getModel().getEchotypeFile().setFile(file);
- }
-
- public void setEchotypeFileContentType(String contentType) {
- getModel().getEchotypeFile().setContentType(contentType);
- }
-
- public void setEchotypeFileFileName(String fileName) {
- getModel().getEchotypeFile().setFileName(fileName);
- }
-
- public void setEsduByEchotypeFile(File file) {
- getModel().getEsduByEchotypeFile().setFile(file);
- }
-
- public void setEsduByEchotypeFileContentType(String contentType) {
- getModel().getEsduByEchotypeFile().setContentType(contentType);
- }
-
- public void setEsduByEchotypeFileName(String fileName) {
- getModel().getEsduByEchotypeFile().setFileName(fileName);
- }
-
- public void setEsduByEchotypeAndSpeciesCategoryFileFile(File file) {
- getModel().getEsduByEchotypeAndSpeciesCategoryFile().setFile(file);
- }
-
- public void setEsduByEchotypeAndSpeciesCategoryFileContentType(String contentType) {
- getModel().getEsduByEchotypeAndSpeciesCategoryFile().setContentType(contentType);
- }
-
- public void setEsduByEchotypeAndSpeciesCategoryFileName(String fileName) {
- getModel().getEsduByEchotypeAndSpeciesCategoryFile().setFileName(fileName);
- }
-
- public void setEsduBySpeciesAndSizeCategoryFile(File file) {
- getModel().getEsduBySpeciesAndSizeCategoryFile().setFile(file);
- }
-
- public void setEsduBySpeciesAndSizeCategoryFileContentType(String contentType) {
- getModel().getEsduBySpeciesAndSizeCategoryFile().setContentType(contentType);
- }
-
- public void setEsduBySpeciesAndSizeCategoryFileName(String fileName) {
- getModel().getEsduBySpeciesAndSizeCategoryFile().setFileName(fileName);
- }
-
- public void setEsduBySpeciesAndAgeCategoryFile(File file) {
- getModel().getEsduBySpeciesAndAgeCategoryFile().setFile(file);
- }
-
- public void setEsduBySpeciesAndAgeCategoryFileContentType(String contentType) {
- getModel().getEsduBySpeciesAndAgeCategoryFile().setContentType(contentType);
- }
-
- public void setEsduBySpeciesAndAgeCategoryFileName(String fileName) {
- getModel().getEsduBySpeciesAndAgeCategoryFile().setFileName(fileName);
- }
-}
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport.java (from rev 458, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,261 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.ui.actions.importData;
+
+import com.opensymphony.xwork2.interceptor.annotations.InputConfig;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.Vessel;
+import fr.ifremer.echobase.services.EchoBaseServiceSupport;
+import fr.ifremer.echobase.services.importdata.ResultsImportConfiguration;
+import fr.ifremer.echobase.services.importdata.ResultsImportMode;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ * Configure a "results" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class ConfigureResultsImport extends AbstractConfigureImport<ResultsImportConfiguration> {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Universe of existing voyages. */
+ protected Map<String, String> voyages;
+
+ /** Universe of existing vessels. */
+ protected Map<String, String> vessels;
+
+ /** Universe of possible import modes. */
+ protected Map<String, String> importModes;
+
+ protected String resultLabel;
+
+ public ConfigureResultsImport() {
+ super(ResultsImportConfiguration.class);
+ }
+
+ @Override
+ protected ResultsImportConfiguration createModel() {
+ return new ResultsImportConfiguration(getLocale());
+ }
+
+ @Override
+ public String input() throws Exception {
+
+ super.input();
+
+ EchoBaseServiceSupport service =
+ newService(EchoBaseServiceSupport.class);
+
+ voyages = loadSortAndDecorate(service, Voyage.class);
+ vessels = loadSortAndDecorate(service, Vessel.class);
+ importModes = decorateEnums(ResultsImportMode.values());
+
+ if (getModel().getImportMode() == null) {
+
+ getModel().setImportMode(ResultsImportMode.VOYAGE);
+ }
+ return INPUT;
+ }
+
+ @InputConfig(methodName = "input")
+ public String modeVoyage() throws Exception {
+
+ return execute();
+ }
+
+ @InputConfig(methodName = "input")
+ public String modeEsdu() throws Exception {
+
+ return execute();
+ }
+
+ @InputConfig(methodName = "input")
+ public String modeRegion() throws Exception {
+
+ return execute();
+ }
+
+ @InputConfig(methodName = "input")
+ public String modeMap() throws Exception {
+
+ return execute();
+ }
+
+ public Map<String, String> getVoyages() {
+ return voyages;
+ }
+
+ public Map<String, String> getVessels() {
+ return vessels;
+ }
+
+ public Map<String, String> getImportModes() {
+ return importModes;
+ }
+
+
+ public String getResultLabel() {
+ return resultLabel;
+ }
+
+ public void setResultLabel(String resultLabel) {
+ this.resultLabel = resultLabel;
+ }
+
+ public void setRegionsFile(File file) {
+ getModel().getRegionsFile().setFile(file);
+ }
+
+ public void setRegionsFileContentType(String contentType) {
+ getModel().getRegionsFile().setContentType(contentType);
+ }
+
+ public void setRegionsFileFileName(String fileName) {
+ getModel().getRegionsFile().setFileName(fileName);
+ }
+
+ public void setRegionAssociationFile(File file) {
+ getModel().getRegionAssociationFile().setFile(file);
+ }
+
+ public void setRegionAssociationFileContentType(String contentType) {
+ getModel().getRegionAssociationFile().setContentType(contentType);
+ }
+
+ public void setRegionAssociationFileFileName(String fileName) {
+ getModel().getRegionAssociationFile().setFileName(fileName);
+ }
+
+ public void setRegionResultFile(File file) {
+ getModel().getRegionResultFile().setFile(file);
+ }
+
+ public void setRegionResultFileContentType(String contentType) {
+ getModel().getRegionResultFile().setContentType(contentType);
+ }
+
+ public void setRegionResultFileFileName(String fileName) {
+ getModel().getRegionResultFile().setFileName(fileName);
+ }
+
+ public void setMapsFile(File file) {
+ getModel().getMapsFile().setFile(file);
+ }
+
+ public void setMapsFileContentType(String contentType) {
+ getModel().getMapsFile().setContentType(contentType);
+ }
+
+ public void setMapsFileFileName(String fileName) {
+ getModel().getMapsFile().setFileName(fileName);
+ }
+
+ public void setLengthAgeKeyFile(File file) {
+ getModel().getLengthAgeKeyFile().setFile(file);
+ }
+
+ public void setLengthAgeKeyFileContentType(String contentType) {
+ getModel().getLengthAgeKeyFile().setContentType(contentType);
+ }
+
+ public void setLengthAgeKeyFileFileName(String fileName) {
+ getModel().getLengthAgeKeyFile().setFileName(fileName);
+ }
+
+ public void setLengthWeightKeyFile(File file) {
+ getModel().getLengthWeightKeyFile().setFile(file);
+ }
+
+ public void setLengthWeightKeyFileContentType(String contentType) {
+ getModel().getLengthWeightKeyFile().setContentType(contentType);
+ }
+
+ public void setLengthWeightKeyFileFileName(String fileName) {
+ getModel().getLengthWeightKeyFile().setFileName(fileName);
+ }
+
+ public void setEchotypeFile(File file) {
+ getModel().getEchotypeFile().setFile(file);
+ }
+
+ public void setEchotypeFileContentType(String contentType) {
+ getModel().getEchotypeFile().setContentType(contentType);
+ }
+
+ public void setEchotypeFileFileName(String fileName) {
+ getModel().getEchotypeFile().setFileName(fileName);
+ }
+
+ public void setEsduByEchotypeFile(File file) {
+ getModel().getEsduByEchotypeFile().setFile(file);
+ }
+
+ public void setEsduByEchotypeFileContentType(String contentType) {
+ getModel().getEsduByEchotypeFile().setContentType(contentType);
+ }
+
+ public void setEsduByEchotypeFileName(String fileName) {
+ getModel().getEsduByEchotypeFile().setFileName(fileName);
+ }
+
+ public void setEsduByEchotypeAndSpeciesCategoryFileFile(File file) {
+ getModel().getEsduByEchotypeAndSpeciesCategoryFile().setFile(file);
+ }
+
+ public void setEsduByEchotypeAndSpeciesCategoryFileContentType(String contentType) {
+ getModel().getEsduByEchotypeAndSpeciesCategoryFile().setContentType(contentType);
+ }
+
+ public void setEsduByEchotypeAndSpeciesCategoryFileName(String fileName) {
+ getModel().getEsduByEchotypeAndSpeciesCategoryFile().setFileName(fileName);
+ }
+
+ public void setEsduBySpeciesAndSizeCategoryFile(File file) {
+ getModel().getEsduBySpeciesAndSizeCategoryFile().setFile(file);
+ }
+
+ public void setEsduBySpeciesAndSizeCategoryFileContentType(String contentType) {
+ getModel().getEsduBySpeciesAndSizeCategoryFile().setContentType(contentType);
+ }
+
+ public void setEsduBySpeciesAndSizeCategoryFileName(String fileName) {
+ getModel().getEsduBySpeciesAndSizeCategoryFile().setFileName(fileName);
+ }
+
+ public void setEsduBySpeciesAndAgeCategoryFile(File file) {
+ getModel().getEsduBySpeciesAndAgeCategoryFile().setFile(file);
+ }
+
+ public void setEsduBySpeciesAndAgeCategoryFileContentType(String contentType) {
+ getModel().getEsduBySpeciesAndAgeCategoryFile().setContentType(contentType);
+ }
+
+ public void setEsduBySpeciesAndAgeCategoryFileName(String fileName) {
+ getModel().getEsduBySpeciesAndAgeCategoryFile().setFileName(fileName);
+ }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/CreateMission.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/CreateMission.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/CreateMission.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -27,7 +27,7 @@
import fr.ifremer.echobase.entities.references.Mission;
import fr.ifremer.echobase.entities.references.MissionImpl;
import fr.ifremer.echobase.services.exceptions.MissionNameAlreadyExistException;
-import fr.ifremer.echobase.services.importdata.CommonDataImportService;
+import fr.ifremer.echobase.services.importdata.CommonImportService;
import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -63,8 +63,8 @@
String result = INPUT;
try {
- CommonDataImportService service =
- newService(CommonDataImportService.class);
+ CommonImportService service =
+ newService(CommonImportService.class);
Mission missionSaved = service.createMission(mission);
if (log.isInfoEnabled()) {
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticData.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticData.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticData.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,43 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.ui.actions.importData;
-
-import fr.ifremer.echobase.services.importdata.AcousticDataImportConfiguration;
-import fr.ifremer.echobase.services.importdata.AcousticDataImportService;
-
-/**
- * Configure a accoustic data import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class LaunchAccousticData extends AbstractLaunchImport<AcousticDataImportConfiguration, AcousticDataImportService> {
-
- private static final long serialVersionUID = 1L;
-
- public LaunchAccousticData() {
- super(AcousticDataImportConfiguration.class, AcousticDataImportService.class);
- }
-
-}
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java (from rev 458, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticData.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,43 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.ui.actions.importData;
+
+import fr.ifremer.echobase.services.importdata.AcousticImportConfiguration;
+import fr.ifremer.echobase.services.importdata.AcousticImportService;
+
+/**
+ * Configure a accoustic data import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class LaunchAccousticImport extends AbstractLaunchImport<AcousticImportConfiguration, AcousticImportService> {
+
+ private static final long serialVersionUID = 1L;
+
+ public LaunchAccousticImport() {
+ super(AcousticImportConfiguration.class, AcousticImportService.class);
+ }
+
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesData.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesData.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesData.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,43 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.ui.actions.importData;
-
-import fr.ifremer.echobase.services.importdata.CatchesDataImportConfiguration;
-import fr.ifremer.echobase.services.importdata.CatchesDataImportService;
-
-/**
- * Configure a accoustic data import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class LaunchCatchesData extends AbstractLaunchImport<CatchesDataImportConfiguration, CatchesDataImportService> {
-
- private static final long serialVersionUID = 1L;
-
- public LaunchCatchesData() {
- super(CatchesDataImportConfiguration.class, CatchesDataImportService.class);
- }
-
-}
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesImport.java (from rev 458, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesData.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesImport.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesImport.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,43 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.ui.actions.importData;
+
+import fr.ifremer.echobase.services.importdata.CatchesImportConfiguration;
+import fr.ifremer.echobase.services.importdata.CatchesImportService;
+
+/**
+ * Configure a accoustic data import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class LaunchCatchesImport extends AbstractLaunchImport<CatchesImportConfiguration, CatchesImportService> {
+
+ private static final long serialVersionUID = 1L;
+
+ public LaunchCatchesImport() {
+ super(CatchesImportConfiguration.class, CatchesImportService.class);
+ }
+
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesImport.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,43 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.ui.actions.importData;
-
-import fr.ifremer.echobase.services.importdata.CommonDataImportConfiguration;
-import fr.ifremer.echobase.services.importdata.CommonDataImportService;
-
-/**
- * Configure a accoustic data import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class LaunchCommonData extends AbstractLaunchImport<CommonDataImportConfiguration, CommonDataImportService> {
-
- private static final long serialVersionUID = 1L;
-
- public LaunchCommonData() {
- super(CommonDataImportConfiguration.class, CommonDataImportService.class);
- }
-
-}
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonImport.java (from rev 458, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonImport.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonImport.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,43 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.ui.actions.importData;
+
+import fr.ifremer.echobase.services.importdata.CommonImportConfiguration;
+import fr.ifremer.echobase.services.importdata.CommonImportService;
+
+/**
+ * Configure a accoustic data import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class LaunchCommonImport extends AbstractLaunchImport<CommonImportConfiguration, CommonImportService> {
+
+ private static final long serialVersionUID = 1L;
+
+ public LaunchCommonImport() {
+ super(CommonImportConfiguration.class, CommonImportService.class);
+ }
+
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonImport.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,44 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.ui.actions.importData;
-
-import fr.ifremer.echobase.services.importdata.OperationImportConfiguration;
-import fr.ifremer.echobase.services.importdata.OperationImportService;
-
-/**
- * TODO
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class LaunchOperation extends AbstractLaunchImport<OperationImportConfiguration, OperationImportService> {
-
- private static final long serialVersionUID = 1L;
-
- public LaunchOperation() {
- super(OperationImportConfiguration.class,
- OperationImportService.class);
- }
-
-}
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperationImport.java (from rev 458, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperationImport.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperationImport.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,44 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.ui.actions.importData;
+
+import fr.ifremer.echobase.services.importdata.OperationImportConfiguration;
+import fr.ifremer.echobase.services.importdata.OperationImportService;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class LaunchOperationImport extends AbstractLaunchImport<OperationImportConfiguration, OperationImportService> {
+
+ private static final long serialVersionUID = 1L;
+
+ public LaunchOperationImport() {
+ super(OperationImportConfiguration.class,
+ OperationImportService.class);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperationImport.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,43 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.ui.actions.importData;
-
-import fr.ifremer.echobase.services.importdata.ResultsImportConfiguration;
-import fr.ifremer.echobase.services.importdata.ResultsImportService;
-
-/**
- * Configure a "result" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class LaunchResults extends AbstractLaunchImport<ResultsImportConfiguration, ResultsImportService> {
-
- private static final long serialVersionUID = 1L;
-
- public LaunchResults() {
- super(ResultsImportConfiguration.class, ResultsImportService.class);
- }
-
-}
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResultsImport.java (from rev 458, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResultsImport.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResultsImport.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,43 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.ui.actions.importData;
+
+import fr.ifremer.echobase.services.importdata.ResultsImportConfiguration;
+import fr.ifremer.echobase.services.importdata.ResultsImportService;
+
+/**
+ * Configure a "result" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class LaunchResultsImport extends AbstractLaunchImport<ResultsImportConfiguration, ResultsImportService> {
+
+ private static final long serialVersionUID = 1L;
+
+ public LaunchResultsImport() {
+ super(ResultsImportConfiguration.class, ResultsImportService.class);
+ }
+
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResultsImport.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectImportType.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectImportType.java 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectImportType.java 2012-03-30 16:46:14 UTC (rev 460)
@@ -23,7 +23,7 @@
*/
package fr.ifremer.echobase.ui.actions.importData;
-import fr.ifremer.echobase.services.importdata.ImportDataMode;
+import fr.ifremer.echobase.services.importdata.ImportMode;
import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
import java.util.Map;
@@ -38,7 +38,7 @@
private static final long serialVersionUID = 1L;
- protected ImportDataMode mode;
+ protected ImportMode mode;
/** Universe of possible import modes. */
protected Map<String, String> modes;
@@ -48,20 +48,20 @@
return modes;
}
- public ImportDataMode getMode() {
+ public ImportMode getMode() {
return mode;
}
- public void setMode(ImportDataMode mode) {
+ public void setMode(ImportMode mode) {
this.mode = mode;
}
@Override
public String input() throws Exception {
- modes = decorateEnums(ImportDataMode.values());
+ modes = decorateEnums(ImportMode.values());
if (mode == null) {
- mode = ImportDataMode.CommonData;
+ mode = ImportMode.Common;
}
return INPUT;
}
Modified: trunk/echobase-ui/src/main/resources/config/struts-importData.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/config/struts-importData.xml 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/resources/config/struts-importData.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -35,7 +35,7 @@
<!-- Select import type -->
<action name="selectImportType"
class="fr.ifremer.echobase.ui.actions.importData.SelectImportType">
- <interceptor-ref name="paramsPrepareParamsStackLoggued"/>
+ <interceptor-ref name="prepareParamsStackLoggued"/>
<result name="input">/WEB-INF/jsp/importData/selectImportType.jsp</result>
<result type="redirectAction">
<param name="namespace">/importData</param>
@@ -45,21 +45,21 @@
</action>
<!-- Configure import -->
- <action name="Configure*-*" method="{2}"
+ <!--action name="Configure*-*" method="{2}"
class="fr.ifremer.echobase.ui.actions.importData.Configure{1}">
- <interceptor-ref name="paramsPrepareParamsStackLoggued"/>
- <result name="input">/WEB-INF/jsp/importData/configure{1}.jsp</result>
+ <interceptor-ref name="prepareParamsStackLoggued"/>
+ <result name="input">/WEB-INF/jsp/importData/configure{1}Import.jsp</result>
<result type="redirectAction">
<param name="namespace">/importData</param>
<param name="actionName">import{1}</param>
</result>
- </action>
+ </action-->
<!-- Configure import -->
- <action name="configure*"
- class="fr.ifremer.echobase.ui.actions.importData.Configure{1}">
+ <action name="configure*-*" method="{2}"
+ class="fr.ifremer.echobase.ui.actions.importData.Configure{1}Import">
<interceptor-ref name="paramsPrepareParamsStackLoggued"/>
- <result name="input">/WEB-INF/jsp/importData/configure{1}.jsp</result>
+ <result name="input">/WEB-INF/jsp/importData/configure{1}Import.jsp</result>
<result type="redirectAction">
<param name="namespace">/importData</param>
<param name="actionName">import{1}</param>
@@ -68,11 +68,11 @@
<!-- Starts import -->
<action name="import*"
- class="fr.ifremer.echobase.ui.actions.importData.Launch{1}">
+ class="fr.ifremer.echobase.ui.actions.importData.Launch{1}Import">
<interceptor-ref name="basicStackLoggued"/>
<interceptor-ref name="execAndWait"/>
- <result name="wait">/WEB-INF/jsp/importData/progress{1}.jsp</result>
- <result>/WEB-INF/jsp/importData/result{1}.jsp</result>
+ <result name="wait">/WEB-INF/jsp/importData/progress{1}Import.jsp</result>
+ <result>/WEB-INF/jsp/importData/result{1}Import.jsp</result>
</action>
<!-- Get all vessels used by any transects of a voyage -->
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData-validation.xml 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,156 +0,0 @@
-<!--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
-<validators>
-
- <field name="model.voyageId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.voyage.required"/>
- </field-validator>
- </field>
-
- <field name="model.transitId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transit.required"/>
- </field-validator>
- </field>
-
- <field name="model.vesselId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.vessel.required"/>
- </field-validator>
- </field>
-
- <field name="model.cellPositionReference">
- <field-validator type="nrequired">
- <message key="echobase.error.import.cellPositionReference.required"/>
- </field-validator>
- </field>
-
- <field name="model.transceiverAcquisitionAbsorptionDescription">
- <field-validator type="nrequiredstring">
- <message
- key="echobase.error.import.transceiverAcquisitionAbsorptionDescription.required"/>
- </field-validator>
- </field>
-
- <field name="model.acquisitionSoftwareVersionER60">
- <field-validator type="nrequiredstring">
- <message
- key="echobase.error.import.acquisitionSoftwareVersionER60.required"/>
- </field-validator>
- </field>
-
- <field name="model.acquisitionSoftwareVersionME70">
- <field-validator type="nrequiredstring">
- <message
- key="echobase.error.import.acquisitionSoftwareVersionME70.required"/>
- </field-validator>
- </field>
-
- <field name="model.echosounderSoundSpeed">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.echosounderSoundSpeed.required"/>
- </field-validator>
- </field>
-
- <field name="model.loggedDataFormat">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.loggedDataFormat.required"/>
- </field-validator>
- </field>
-
- <field name="model.loggedDataDatatype">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.loggedDataDatatype.required"/>
- </field-validator>
- </field>
-
- <field name="model.pingDutyCycle">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.pingDutyCycle.required"/>
- </field-validator>
- </field>
-
- <field name="model.soundSpeedCalculationsER60">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.soundSpeedCalculationsER60.required"/>
- </field-validator>
- </field>
-
- <field name="model.soundSpeedCalculationsME70">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.soundSpeedCalculationsME70.required"/>
- </field-validator>
- </field>
-
- <field name="model.sounderConstant">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.sounderConstant.required"/>
- </field-validator>
- </field>
-
- <field name="model.processingTemplate">
- <field-validator type="nrequiredstring">
- <message
- key="echobase.error.import.processingTemplate.required"/>
- </field-validator>
- </field>
-
- <field name="model.processingDescription">
- <field-validator type="nrequiredstring">
- <message
- key="echobase.error.import.processingDescription.required"/>
- </field-validator>
- </field>
-
- <field name="model.digitThreshold">
- <field-validator type="nrequiredstring">
- <message
- key="echobase.error.import.digitThreshold.required"/>
- </field-validator>
- </field>
-
- <field name="model.acousticDensityUnit">
- <field-validator type="nrequiredstring">
- <message
- key="echobase.error.import.acousticDensityUnit.required"/>
- </field-validator>
- </field>
-
- <field name="model.notes">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.notes.required"/>
- </field-validator>
- </field>
-
- <field name="moviesFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.moviesFile.file!=null</param>
- <message key="echobase.error.import.moviesFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData-validation.xml)
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,156 @@
+<!--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
+<validators>
+
+ <field name="model.voyageId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyage.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transitId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transit.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.vesselId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.vessel.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.cellPositionReference">
+ <field-validator type="nrequired">
+ <message key="echobase.error.import.cellPositionReference.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transceiverAcquisitionAbsorptionDescription">
+ <field-validator type="nrequiredstring">
+ <message
+ key="echobase.error.import.transceiverAcquisitionAbsorptionDescription.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.acquisitionSoftwareVersionER60">
+ <field-validator type="nrequiredstring">
+ <message
+ key="echobase.error.import.acquisitionSoftwareVersionER60.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.acquisitionSoftwareVersionME70">
+ <field-validator type="nrequiredstring">
+ <message
+ key="echobase.error.import.acquisitionSoftwareVersionME70.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.echosounderSoundSpeed">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.echosounderSoundSpeed.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.loggedDataFormat">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.loggedDataFormat.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.loggedDataDatatype">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.loggedDataDatatype.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.pingDutyCycle">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.pingDutyCycle.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.soundSpeedCalculationsER60">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.soundSpeedCalculationsER60.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.soundSpeedCalculationsME70">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.soundSpeedCalculationsME70.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.sounderConstant">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.sounderConstant.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.processingTemplate">
+ <field-validator type="nrequiredstring">
+ <message
+ key="echobase.error.import.processingTemplate.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.processingDescription">
+ <field-validator type="nrequiredstring">
+ <message
+ key="echobase.error.import.processingDescription.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.digitThreshold">
+ <field-validator type="nrequiredstring">
+ <message
+ key="echobase.error.import.digitThreshold.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.acousticDensityUnit">
+ <field-validator type="nrequiredstring">
+ <message
+ key="echobase.error.import.acousticDensityUnit.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.notes">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.notes.required"/>
+ </field-validator>
+ </field>
+
+ <field name="moviesFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.moviesFile.file!=null</param>
+ <message key="echobase.error.import.moviesFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData-validation.xml 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,55 +0,0 @@
-<!--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
-<validators>
-
- <field name="model.voyageId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.voyage.required"/>
- </field-validator>
- </field>
-
- <field name="totalSampleFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.totalSampleFile.file!=null</param>
- <message key="echobase.error.import.totalSampleFile.required"/>
- </field-validator>
- </field>
-
- <field name="subSampleFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.subSampleFile.file!=null</param>
- <message key="echobase.error.import.subSampleFile.required"/>
- </field-validator>
- </field>
-
- <field name="biometrySampleFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.biometrySampleFile.file!=null</param>
- <message key="echobase.error.import.biometrySampleFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData-validation.xml)
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,55 @@
+<!--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
+<validators>
+
+ <field name="model.voyageId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyage.required"/>
+ </field-validator>
+ </field>
+
+ <field name="totalSampleFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.totalSampleFile.file!=null</param>
+ <message key="echobase.error.import.totalSampleFile.required"/>
+ </field-validator>
+ </field>
+
+ <field name="subSampleFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.subSampleFile.file!=null</param>
+ <message key="echobase.error.import.subSampleFile.required"/>
+ </field-validator>
+ </field>
+
+ <field name="biometrySampleFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.biometrySampleFile.file!=null</param>
+ <message key="echobase.error.import.biometrySampleFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,104 +0,0 @@
-<!--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
-<validators>
-
- <field name="model.missionId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.mission.required"/>
- </field-validator>
- </field>
-
- <field name="model.areaOfOperationId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.areaOfOperation.required"/>
- </field-validator>
- </field>
-
- <field name="model.vesselId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.vessel.required"/>
- </field-validator>
- </field>
-
- <field name="model.voyageDescription">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.voyageDescription.required"/>
- </field-validator>
- </field>
-
- <field name="model.transitRelatedActivity">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transitRelatedActivity.required"/>
- </field-validator>
- </field>
-
- <field name="model.transectLicence">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transectLicence.required"/>
- </field-validator>
- </field>
-
- <field name="model.transectGeospatialVerticalPositive">
- <field-validator type="nrequiredstring">
- <message
- key="echobase.error.import.transectGeospatialVerticalPositive.required"/>
- </field-validator>
- </field>
-
- <field name="model.transectBinUnitsPingAxis">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transectBinUnitsPingAxis.required"/>
- </field-validator>
- </field>
-
- <field name="model.datum">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.datum.required"/>
- </field-validator>
- </field>
-
- <field name="voyageFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.voyageFile.file!=null</param>
- <message key="echobase.error.import.voyageFile.required"/>
- </field-validator>
- </field>
-
- <field name="transitFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.transitFile.file!=null</param>
- <message key="echobase.error.import.transitFile.required"/>
- </field-validator>
- </field>
-
- <field name="transectFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.transectFile.file!=null</param>
- <message key="echobase.error.import.transectFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,72 +0,0 @@
-<!--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
-<validators>
-
- <field name="model.voyageId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.voyage.required"/>
- </field-validator>
- </field>
-
- <field name="model.vesselId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.vessel.required"/>
- </field-validator>
- </field>
-
- <field name="model.transectLicence">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transectLicence.required"/>
- </field-validator>
- </field>
-
- <field name="model.transectGeospatialVerticalPositive">
- <field-validator type="nrequiredstring">
- <message
- key="echobase.error.import.transectGeospatialVerticalPositive.required"/>
- </field-validator>
- </field>
-
- <field name="model.transectBinUnitsPingAxis">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transectBinUnitsPingAxis.required"/>
- </field-validator>
- </field>
-
- <field name="model.datum">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.datum.required"/>
- </field-validator>
- </field>
-
- <field name="transectFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.transectFile.file!=null</param>
- <message key="echobase.error.import.transectFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeAll-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml)
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeAll-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeAll-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,98 @@
+<!--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
+<validators>
+
+ <field name="model.missionId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.mission.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.areaOfOperationId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.areaOfOperation.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.voyageDescription">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyageDescription.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transitRelatedActivity">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transitRelatedActivity.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transectLicence">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transectLicence.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transectGeospatialVerticalPositive">
+ <field-validator type="nrequiredstring">
+ <message
+ key="echobase.error.import.transectGeospatialVerticalPositive.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transectBinUnitsPingAxis">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transectBinUnitsPingAxis.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.datum">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.datum.required"/>
+ </field-validator>
+ </field>
+
+ <field name="voyageFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.voyageFile.file!=null</param>
+ <message key="echobase.error.import.voyageFile.required"/>
+ </field-validator>
+ </field>
+
+ <field name="transitFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.transitFile.file!=null</param>
+ <message key="echobase.error.import.transitFile.required"/>
+ </field-validator>
+ </field>
+
+ <field name="transectFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.transectFile.file!=null</param>
+ <message key="echobase.error.import.transectFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeAll-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeTransect-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml)
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeTransect-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeTransect-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,66 @@
+<!--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
+<validators>
+
+ <field name="model.voyageId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyage.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transectLicence">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transectLicence.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transectGeospatialVerticalPositive">
+ <field-validator type="nrequiredstring">
+ <message
+ key="echobase.error.import.transectGeospatialVerticalPositive.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transectBinUnitsPingAxis">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transectBinUnitsPingAxis.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.datum">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.datum.required"/>
+ </field-validator>
+ </field>
+
+ <field name="transectFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.transectFile.file!=null</param>
+ <message key="echobase.error.import.transectFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeTransect-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 - 2012 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-
-
-<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
-
-<validators>
-
- <field name="model.voyageId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.voyage.required"/>
- </field-validator>
- </field>
-
- <field name="model.transitId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transit.required"/>
- </field-validator>
- </field>
-
- <field name="model.vesselId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.vessel.required"/>
- </field-validator>
- </field>
-
- <field name="operationFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.operationFile.file!=null</param>
- <message key="echobase.error.import.operationFile.required"/>
- </field-validator>
- </field>
-
- <field name="operationMetadataFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.operationMetadataFile.file!=null</param>
- <message key="echobase.error.import.operationMetadataFile.required"/>
- </field-validator>
- </field>
-
- <field name="gearMetadataFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.gearMetadataFile.file!=null</param>
- <message key="echobase.error.import.gearMetadataFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml)
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+
+
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
+
+<validators>
+
+ <field name="model.voyageId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyage.required"/>
+ </field-validator>
+ </field>
+
+ <field name="operationFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.operationFile.file!=null</param>
+ <message key="echobase.error.import.operationFile.required"/>
+ </field-validator>
+ </field>
+
+ <field name="operationMetadataFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.operationMetadataFile.file!=null</param>
+ <message key="echobase.error.import.operationMetadataFile.required"/>
+ </field-validator>
+ </field>
+
+ <field name="gearMetadataFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.gearMetadataFile.file!=null</param>
+ <message key="echobase.error.import.gearMetadataFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsdu-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsdu-validation.xml 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsdu-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,53 +0,0 @@
-<!--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
-<validators>
-
- <field name="model.voyageId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.voyage.required"/>
- </field-validator>
- </field>
-
- <field name="model.dataProcessingId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.dataProcessing.required"/>
- </field-validator>
- </field>
-
- <field name="model.resultLabel">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.resultLabel.required"/>
- </field-validator>
- </field>
-
- <field name="esduByEchotypeFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.oneEsduImportFile</param>
- <message key="echobase.error.import.resultImportFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeMap-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeMap-validation.xml 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeMap-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,47 +0,0 @@
-<!--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
-<validators>
-
- <field name="model.voyageId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.voyage.required"/>
- </field-validator>
- </field>
-
- <field name="model.resultLabel">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.resultLabel.required"/>
- </field-validator>
- </field>
-
- <field name="mapsFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.mapsFile.file!=null</param>
- <message key="echobase.error.import.mapsFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeRegion-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeRegion-validation.xml 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeRegion-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,61 +0,0 @@
-<!--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
-<validators>
-
- <field name="model.voyageId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.voyage.required"/>
- </field-validator>
- </field>
-
- <field name="model.resultLabel">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.resultLabel.required"/>
- </field-validator>
- </field>
-
- <field name="regionsFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.regionsFile.file!=null</param>
- <message key="echobase.error.import.regionsFile.required"/>
- </field-validator>
- </field>
-
- <field name="regionAssociationFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.regionAssociationFile.file!=null</param>
- <message key="echobase.error.import.regionAssociationFile.required"/>
- </field-validator>
- </field>
-
- <field name="regionResultFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.regionResultFile.file!=null</param>
- <message key="echobase.error.import.regionResultFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,41 +0,0 @@
-<!--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
-<validators>
-
- <field name="model.voyageId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.voyage.required"/>
- </field-validator>
- </field>
-
- <field name="lengthAgeKeyFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.oneVoyageImportFile</param>
- <message key="echobase.error.import.resultImportFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeEsdu-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsdu-validation.xml)
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeEsdu-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeEsdu-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,53 @@
+<!--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
+<validators>
+
+ <field name="model.voyageId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyage.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.dataProcessingId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.dataProcessing.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.resultLabel">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.resultLabel.required"/>
+ </field-validator>
+ </field>
+
+ <field name="esduByEchotypeFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.oneEsduImportFile</param>
+ <message key="echobase.error.import.resultImportFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeEsdu-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeMap-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeMap-validation.xml)
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeMap-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeMap-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,47 @@
+<!--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
+<validators>
+
+ <field name="model.voyageId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyage.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.resultLabel">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.resultLabel.required"/>
+ </field-validator>
+ </field>
+
+ <field name="mapsFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.mapsFile.file!=null</param>
+ <message key="echobase.error.import.mapsFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeMap-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeRegion-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeRegion-validation.xml)
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeRegion-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeRegion-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,61 @@
+<!--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
+<validators>
+
+ <field name="model.voyageId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyage.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.resultLabel">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.resultLabel.required"/>
+ </field-validator>
+ </field>
+
+ <field name="regionsFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.regionsFile.file!=null</param>
+ <message key="echobase.error.import.regionsFile.required"/>
+ </field-validator>
+ </field>
+
+ <field name="regionAssociationFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.regionAssociationFile.file!=null</param>
+ <message key="echobase.error.import.regionAssociationFile.required"/>
+ </field-validator>
+ </field>
+
+ <field name="regionResultFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.regionResultFile.file!=null</param>
+ <message key="echobase.error.import.regionResultFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeRegion-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeVoyage-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml)
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeVoyage-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeVoyage-validation.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,41 @@
+<!--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
+<validators>
+
+ <field name="model.voyageId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyage.required"/>
+ </field-validator>
+ </field>
+
+ <field name="lengthAgeKeyFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.oneVoyageImportFile</param>
+ <message key="echobase.error.import.resultImportFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeVoyage-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
===================================================================
--- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-03-30 16:46:14 UTC (rev 460)
@@ -39,14 +39,16 @@
echobase.common.addDataAcquisition=Toujours créer des DataAcqusitions
echobase.common.admin=Administrateur
echobase.common.cellPositionReference=cellPositionReference
+echobase.common.dataProcessingNotes=dataProcessingNotes
echobase.common.digitThreshold=digitThreshold
echobase.common.echosounderSoundSpeed=echosounderSoundSpeed
echobase.common.email=Email
echobase.common.entityType=Type d'entité
echobase.common.importDataMode=Type d'import
-echobase.common.importError=Message d'erreur
+echobase.common.importError=Un erreur est survenue pendant l'import \:
echobase.common.importFileName=Nom du fichier importé
echobase.common.importMode=Type d'import
+echobase.common.importNotes=Remarques sur l'import
echobase.common.importResult=Résultat de l'import
echobase.common.inProgress=en cours...
echobase.common.jdbcLogin=Login de connexion
@@ -55,7 +57,6 @@
echobase.common.loggedDataDatatype=loggedDataDatatype
echobase.common.loggedDataFormat=loggedDataFormat
echobase.common.nbCreatedObjects=Nombre d'objets crées
-echobase.common.notes=notes
echobase.common.password=Mot de passe
echobase.common.pingDutyCycle=pingDutyCycle
echobase.common.processingDescription=processingDescription
Modified: trunk/echobase-ui/src/main/resources/struts.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/struts.xml 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/resources/struts.xml 2012-03-30 16:46:14 UTC (rev 460)
@@ -114,6 +114,13 @@
<interceptor-ref name="paramsPrepareParamsStack"/>
</interceptor-stack>
+ <!-- authenticated stack with params-->
+ <interceptor-stack name="prepareParamsStackLoggued">
+ <interceptor-ref name="i18n"/>
+ <interceptor-ref name="checkUserLoggued"/>
+ <interceptor-ref name="defaultStack"/>
+ </interceptor-stack>
+
</interceptors>
<!-- must be authenticated to perform any actions -->
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/importDataResults.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/includes/importDataResults.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/importDataResults.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -25,29 +25,24 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<br/>
-<s:if test="hasActionErrors()">
- <s:text name="echobase.common.importError"/>
- <pre>
- <s:property value="error.message"/>
- </pre>
-</s:if>
-<s:else>
- <table>
- <thead>
- <tr>
- <th><s:text name="echobase.common.importFileName"/></th>
- <th><s:text name="echobase.common.entityType"/></th>
- <th><s:text name="echobase.common.nbCreatedObjects"/></th>
- </tr>
- </thead>
- <s:iterator value="result" var="fileResult">
- <s:iterator value="%{#fileResult.entityTypes}" var="entityType">
- <tr>
- <td><s:property value="%{#importFileName}"/></td>
- <td><s:property value="%{#entityType}"/></td>
- <td><s:property value="%{#fileResult.getNumberCreated(#entityType)}"/></td>
- </tr>
- </s:iterator>
- </s:iterator>
- </table>
-</s:else>
+<fieldset>
+ <legend><s:text name="echobase.legend.importData.result.resume"/></legend>
+
+ <s:if test="hasActionErrors()">
+ <s:text name="echobase.common.importError"/>
+ <strong>
+ <s:property value="error.message"/>
+ </strong>
+ <pre id="errorStack">
+ <code>
+ <s:property value="errorStack"/>
+ </code>
+ </pre>
+ </s:if>
+ <s:else>
+ <pre>
+ <s:property value="result"/>
+ </pre>
+ </s:else>
+</fieldset>
+
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticData.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticData.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,127 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<title>
- Configuration <s:text name="echobase.common.importDataMode.accousticData"/>
-</title>
-
-<script type="text/javascript"
- src="<s:url value='/js/gridHelper.js' />"></script>
-
-<script type="text/javascript">
-
- jQuery(document).ready(function () {
-
- $.autoSelectVoyageAndVessel(
- $('[name="model.voyageId"]'),
- $('[name="model.vesselId"]'),
- '<s:url action="getVesselsForVoyage" namespace="/importData"/>',
- '<s:property value="model.voyageId"/>',
- '<s:property value="model.vesselId"/>'
- );
- });
-</script>
-
-<s:form namespace="/importData" method="POST" enctype="multipart/form-data">
-
- <fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configure"/>
- </legend>
-
- <s:select key="model.voyageId" required="true"
- label='%{getText("echobase.common.voyage")}'
- list="voyages" headerKey="" headerValue=""/>
-
- <sj:select key="model.vesselId" required="true"
- label='%{getText("echobase.common.vessel")}'/>
-
- <s:select key="model.cellPositionReference" required="true"
- label='%{getText("echobase.common.cellPositionReference")}'
- list="cellPositionReferences" headerKey="" headerValue=""/>
-
- <s:checkbox key="model.addDataAcquisition" required="true"
- label='%{getText("echobase.common.addDataAcquisition")}'/>
-
- <s:textfield key="model.transceiverAcquisitionAbsorptionDescription"
- size="100" required="true"
- label='%{getText("echobase.common.transceiverAcquisitionAbsorptionDescription")}'/>
-
- <s:textfield key="model.acquisitionSoftwareVersionER60" size="100"
- required="true"
- label='%{getText("echobase.common.acquisitionSoftwareVersionER60")}'/>
-
- <s:textfield key="model.acquisitionSoftwareVersionME70" size="100"
- required="true"
- label='%{getText("echobase.common.acquisitionSoftwareVersionME70")}'/>
-
- <s:textfield key="model.loggedDataFormat" size="100" required="true"
- label='%{getText("echobase.common.loggedDataFormat")}'/>
-
- <s:textfield key="model.loggedDataDatatype" size="100" required="true"
- label='%{getText("echobase.common.loggedDataDatatype")}'/>
-
- <s:textfield key="model.pingDutyCycle" size="100" required="true"
- label='%{getText("echobase.common.pingDutyCycle")}'/>
-
- <%--<s:textfield key="model.echosounderSoundSpeed" size="100" required="true"--%>
- <%--label='%{getText("echobase.common.echosounderSoundSpeed")}'/>--%>
-
- <s:textfield key="model.soundSpeedCalculationsER60" size="100"
- required="true"
- label='%{getText("echobase.common.soundSpeedCalculationsER60")}'/>
-
- <s:textfield key="model.soundSpeedCalculationsME70" size="100"
- required="true"
- label='%{getText("echobase.common.soundSpeedCalculationsME70")}'/>
-
- <s:textfield key="model.sounderConstant" size="100" required="true"
- label='%{getText("echobase.common.sounderConstant")}'/>
-
- <s:textfield key="model.processingTemplate" size="100" required="true"
- label='%{getText("echobase.common.processingTemplate")}'/>
-
- <s:textfield key="model.processingDescription" size="100" required="true"
- label='%{getText("echobase.common.processingDescription")}'/>
-
- <s:textfield key="model.digitThreshold" size="100" required="true"
- label='%{getText("echobase.common.digitThreshold")}'/>
-
- <s:textfield key="model.acousticDensityUnit" size="100" required="true"
- label='%{getText("echobase.common.acousticDensityUnit")}'/>
-
- <s:textfield key="model.notes" size="100" required="true"
- label='%{getText("echobase.common.notes")}'/>
-
- <s:file key="moviesFile" required="true"
- label='%{getText("echobase.common.moviesFile")}'/>
-
- </fieldset>
- <br/>
- <s:submit action="configureAccousticData" key='echobase.action.import'/>
-
-</s:form>
-
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticData.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,126 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+<title>
+ Configuration <s:text name="echobase.common.importMode.acoustic"/>
+</title>
+
+<script type="text/javascript"
+ src="<s:url value='/js/gridHelper.js' />"></script>
+
+<script type="text/javascript">
+
+ jQuery(document).ready(function () {
+
+ $.autoSelectVoyageAndVessel(
+ $('[name="model.voyageId"]'),
+ $('[name="model.vesselId"]'),
+ '<s:url action="getVesselsForVoyage" namespace="/importData"/>',
+ '<s:property value="model.voyageId"/>',
+ '<s:property value="model.vesselId"/>'
+ );
+ });
+</script>
+
+<s:form namespace="/importData" method="POST" enctype="multipart/form-data">
+
+ <fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:select key="model.voyageId" required="true"
+ label='%{getText("echobase.common.voyage")}'
+ list="voyages" headerKey="" headerValue=""/>
+
+ <sj:select key="model.vesselId" required="true"
+ label='%{getText("echobase.common.vessel")}'/>
+
+ <s:select key="model.cellPositionReference" required="true"
+ label='%{getText("echobase.common.cellPositionReference")}'
+ list="cellPositionReferences" headerKey="" headerValue=""/>
+
+ <s:checkbox key="model.addDataAcquisition"
+ label='%{getText("echobase.common.addDataAcquisition")}'/>
+
+ <s:textfield key="model.transceiverAcquisitionAbsorptionDescription"
+ size="80" required="true"
+ label='%{getText("echobase.common.transceiverAcquisitionAbsorptionDescription")}'/>
+
+ <s:textfield key="model.acquisitionSoftwareVersionER60" size="80"
+ required="true"
+ label='%{getText("echobase.common.acquisitionSoftwareVersionER60")}'/>
+
+ <s:textfield key="model.acquisitionSoftwareVersionME70" size="80"
+ required="true"
+ label='%{getText("echobase.common.acquisitionSoftwareVersionME70")}'/>
+
+ <s:textfield key="model.loggedDataFormat" size="80" required="true"
+ label='%{getText("echobase.common.loggedDataFormat")}'/>
+
+ <s:textfield key="model.loggedDataDatatype" size="80" required="true"
+ label='%{getText("echobase.common.loggedDataDatatype")}'/>
+
+ <s:textfield key="model.pingDutyCycle" size="80" required="true"
+ label='%{getText("echobase.common.pingDutyCycle")}'/>
+
+ <s:textfield key="model.soundSpeedCalculationsER60" size="80"
+ required="true"
+ label='%{getText("echobase.common.soundSpeedCalculationsER60")}'/>
+
+ <s:textfield key="model.soundSpeedCalculationsME70" size="80"
+ required="true"
+ label='%{getText("echobase.common.soundSpeedCalculationsME70")}'/>
+
+ <s:textfield key="model.sounderConstant" size="80" required="true"
+ label='%{getText("echobase.common.sounderConstant")}'/>
+
+ <s:textfield key="model.processingTemplate" size="80" required="true"
+ label='%{getText("echobase.common.processingTemplate")}'/>
+
+ <s:textfield key="model.processingDescription" size="80" required="true"
+ label='%{getText("echobase.common.processingDescription")}'/>
+
+ <s:textfield key="model.digitThreshold" size="80" required="true"
+ label='%{getText("echobase.common.digitThreshold")}'/>
+
+ <s:textfield key="model.acousticDensityUnit" size="80" required="true"
+ label='%{getText("echobase.common.acousticDensityUnit")}'/>
+
+ <s:textfield key="model.notes" size="80" required="true"
+ label='%{getText("echobase.common.dataProcessingNotes")}'/>
+
+ <s:file key="moviesFile" required="true"
+ label='%{getText("echobase.common.moviesFile")}'/>
+
+ <s:textarea key="model.importNotes" cols="80" rows="5"
+ label='%{getText("echobase.common.importNotes")}'/>
+ </fieldset>
+ <br/>
+ <s:submit action="configureAcoustic-execute" key='echobase.action.import'/>
+
+</s:form>
+
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,66 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<script type="text/javascript"
- src="<s:url value='/js/gridHelper.js' />"></script>
-
-<title>
- Configuration <s:text name="echobase.common.importDataMode.catchesData"/>
-</title>
-
-<script type="text/javascript">
-
- jQuery(document).ready(function () {
-
- });
-</script>
-
-<s:form namespace="/importData" method="POST" enctype="multipart/form-data">
-
- <fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configure"/>
- </legend>
-
- <s:select key="model.voyageId" required="true"
- label='%{getText("echobase.common.voyage")}'
- list="voyages" headerKey="" headerValue=""/>
-
- <s:file key="totalSampleFile" required="true"
- label='%{getText("echobase.common.totalSampleFile")}'/>
-
- <s:file key="subSampleFile" required="true"
- label='%{getText("echobase.common.subSampleFile")}'/>
-
- <s:file key="biometrySampleFile" required="true"
- label='%{getText("echobase.common.biometrySampleFile")}'/>
- </fieldset>
-
- <br/>
- <s:submit action="configureCatchesData" key='echobase.action.import'/>
-
-
-</s:form>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,69 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+<script type="text/javascript"
+ src="<s:url value='/js/gridHelper.js' />"></script>
+
+<title>
+ Configuration <s:text name="echobase.common.importMode.catches"/>
+</title>
+
+<script type="text/javascript">
+
+ jQuery(document).ready(function () {
+
+ });
+</script>
+
+<s:form namespace="/importData" method="POST" enctype="multipart/form-data">
+
+ <fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:select key="model.voyageId" required="true"
+ label='%{getText("echobase.common.voyage")}'
+ list="voyages" headerKey="" headerValue=""/>
+
+ <s:file key="totalSampleFile" required="true"
+ label='%{getText("echobase.common.totalSampleFile")}'/>
+
+ <s:file key="subSampleFile" required="true"
+ label='%{getText("echobase.common.subSampleFile")}'/>
+
+ <s:file key="biometrySampleFile" required="true"
+ label='%{getText("echobase.common.biometrySampleFile")}'/>
+
+ <s:textarea key="model.importNotes" cols="80" rows="5"
+ label='%{getText("echobase.common.importNotes")}'/>
+ </fieldset>
+
+ <br/>
+ <s:submit action="configureCatches-execute" key='echobase.action.import'/>
+
+
+</s:form>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,149 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title>
- Configuration <s:text name="echobase.common.importDataMode.commonData"/>
-</title>
-
-<script type="text/javascript">
-
- jQuery(document).ready(function () {
-
- $('[name="model.importMode"]').change(function (event) {
- $('[class~="importMode"]').hide();
- $('#' + this.value).show();
- $('#' + this.value + ' .errorMessage').hide();
- });
-
- var incomingVal = $('[name="model.importMode"][checked="checked"]').val();
- $('#' + incomingVal).show();
-
- });
-</script>
-
-<s:radio id='mode' key='model.importMode' list="importModes"
- cssClass="cleanBoth"
- label='%{getText("echobase.common.importMode")}'
- required="true" template="myradiomap"/>
-
-<hr/>
-
-<%--Import mode = ALL--%>
-
-<s:form id="ALL" namespace="/importData" method="POST"
- enctype="multipart/form-data" cssClass="hidden importMode">
-
- <fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configure"/>
- </legend>
-
- <s:select key="model.missionId" required="true"
- label='%{getText("echobase.common.mission")}'
- list="missions" headerKey="" headerValue=""/>
- <br/>
-
- <s:hidden key="model.importMode" value="ALL" label=''/>
-
- <s:select key="model.areaOfOperationId" required="true"
- label='%{getText("echobase.common.areaOfOperation")}'
- list="areaOfOperations" headerKey="" headerValue=""/>
-
- <s:textfield key="model.voyageDescription" size="40" required="true"
- label='%{getText("echobase.common.voyageDescription")}'/>
-
- <s:textfield key="model.datum" size="40" required="true"
- label='%{getText("echobase.common.datum")}'/>
-
- <s:textfield key="model.transitRelatedActivity" size="40" required="true"
- label='%{getText("echobase.common.transitRelatedActivity")}'/>
-
- <s:textfield key="model.transectLicence" size="40" required="true"
- label='%{getText("echobase.common.transectLicence")}'/>
-
- <s:textfield key="model.transectGeospatialVerticalPositive" size="40"
- required="true"
- label='%{getText("echobase.common.transectGeospatialVerticalPositive")}'/>
-
- <s:textfield key="model.transectBinUnitsPingAxis" size="40" required="true"
- label='%{getText("echobase.common.transectBinUnitsPingAxis")}'/>
-
- <s:file key="voyageFile" required="true"
- label='%{getText("echobase.common.voyageFile")}'/>
-
- <s:file key="transitFile" required="true"
- label='%{getText("echobase.common.transitFile")}'/>
-
- <s:file key="transectFile" required="true"
- label='%{getText("echobase.common.transectFile")}'/>
-
- </fieldset>
-
- <br/>
- <s:submit action="ConfigureCommonData-modeAll" key='echobase.action.import'/>
-
-</s:form>
-
-<%--Import mode = TRANSECT --%>
-
-<s:form id='TRANSECT' namespace="/importData" method="POST"
- enctype="multipart/form-data" cssClass="hidden importMode">
-
- <fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configure"/>
- </legend>
-
- <s:hidden key="model.importMode" value="TRANSECT" label=''/>
-
- <s:select key="model.voyageId" required="true"
- label='%{getText("echobase.common.voyage")}'
- list="voyages" headerKey="" headerValue=""/>
-
- <s:textfield key="model.datum" size="40" required="true"
- label='%{getText("echobase.common.datum")}'/>
-
- <s:textfield key="model.transectLicence" size="40" required="true"
- label='%{getText("echobase.common.transectLicence")}'/>
-
- <s:textfield key="model.transectGeospatialVerticalPositive" size="40"
- required="true"
- label='%{getText("echobase.common.transectGeospatialVerticalPositive")}'/>
-
- <s:textfield key="model.transectBinUnitsPingAxis" size="40" required="true"
- label='%{getText("echobase.common.transectBinUnitsPingAxis")}'/>
-
- <s:file key="transectFile" required="true"
- label='%{getText("echobase.common.transectFile")}'/>
-
- </fieldset>
-
- <br/>
- <s:submit action="ConfigureCommonData-modeTransect"
- key='echobase.action.import'/>
-
-
-</s:form>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,154 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<title>
+ Configuration <s:text name="echobase.common.importMode.common"/>
+</title>
+
+<script type="text/javascript">
+
+ jQuery(document).ready(function () {
+
+ $('[name="model.importMode"]').change(function (event) {
+ $('[class~="importMode"]').hide();
+ $('#' + this.value).show();
+ $('#' + this.value + ' .errorMessage').hide();
+ });
+
+ var incomingVal = $('[name="model.importMode"][checked="checked"]').val();
+ $('#' + incomingVal).show();
+
+ });
+</script>
+
+<s:radio id='mode' key='model.importMode' list="importModes"
+ cssClass="cleanBoth"
+ label='%{getText("echobase.common.importMode")}'
+ required="true" template="myradiomap"/>
+
+<hr/>
+
+<%--Import mode = ALL--%>
+
+<s:form id="ALL" namespace="/importData" method="POST"
+ enctype="multipart/form-data" cssClass="hidden importMode">
+
+ <fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:select key="model.missionId" required="true"
+ label='%{getText("echobase.common.mission")}'
+ list="missions" headerKey="" headerValue=""/>
+ <br/>
+
+ <s:hidden key="model.importMode" value="ALL" label=''/>
+
+ <s:select key="model.areaOfOperationId" required="true"
+ label='%{getText("echobase.common.areaOfOperation")}'
+ list="areaOfOperations" headerKey="" headerValue=""/>
+
+ <s:textfield key="model.voyageDescription" size="80" required="true"
+ label='%{getText("echobase.common.voyageDescription")}'/>
+
+ <s:textfield key="model.datum" size="80" required="true"
+ label='%{getText("echobase.common.datum")}'/>
+
+ <s:textfield key="model.transitRelatedActivity" size="80" required="true"
+ label='%{getText("echobase.common.transitRelatedActivity")}'/>
+
+ <s:textfield key="model.transectLicence" size="80" required="true"
+ label='%{getText("echobase.common.transectLicence")}'/>
+
+ <s:textfield key="model.transectGeospatialVerticalPositive" size="80"
+ required="true"
+ label='%{getText("echobase.common.transectGeospatialVerticalPositive")}'/>
+
+ <s:textfield key="model.transectBinUnitsPingAxis" size="80" required="true"
+ label='%{getText("echobase.common.transectBinUnitsPingAxis")}'/>
+
+ <s:file key="voyageFile" required="true"
+ label='%{getText("echobase.common.voyageFile")}'/>
+
+ <s:file key="transitFile" required="true"
+ label='%{getText("echobase.common.transitFile")}'/>
+
+ <s:file key="transectFile" required="true"
+ label='%{getText("echobase.common.transectFile")}'/>
+
+ <s:textarea key="model.importNotes" cols="80" rows="5"
+ label='%{getText("echobase.common.importNotes")}'/>
+
+ </fieldset>
+
+ <br/>
+ <s:submit action="configureCommon-modeAll" key='echobase.action.import'/>
+
+</s:form>
+
+<%--Import mode = TRANSECT --%>
+
+<s:form id='TRANSECT' namespace="/importData" method="POST"
+ enctype="multipart/form-data" cssClass="hidden importMode">
+
+ <fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:hidden key="model.importMode" value="TRANSECT" label=''/>
+
+ <s:select key="model.voyageId" required="true"
+ label='%{getText("echobase.common.voyage")}'
+ list="voyages" headerKey="" headerValue=""/>
+
+ <s:textfield key="model.datum" size="80" required="true"
+ label='%{getText("echobase.common.datum")}'/>
+
+ <s:textfield key="model.transectLicence" size="80" required="true"
+ label='%{getText("echobase.common.transectLicence")}'/>
+
+ <s:textfield key="model.transectGeospatialVerticalPositive" size="80"
+ required="true"
+ label='%{getText("echobase.common.transectGeospatialVerticalPositive")}'/>
+
+ <s:textfield key="model.transectBinUnitsPingAxis" size="80" required="true"
+ label='%{getText("echobase.common.transectBinUnitsPingAxis")}'/>
+
+ <s:file key="transectFile" required="true"
+ label='%{getText("echobase.common.transectFile")}'/>
+
+ <s:textarea key="model.importNotes" cols="80" rows="5"
+ label='%{getText("echobase.common.importNotes")}'/>
+
+ </fieldset>
+
+ <br/>
+ <s:submit action="configureCommon-modeTransect" key='echobase.action.import'/>
+
+
+</s:form>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,60 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<script type="text/javascript"
- src="<s:url value='/js/gridHelper.js' />"></script>
-
-<title>
- Configuration <s:text name="echobase.common.importDataMode.operation"/>
-</title>
-
-<s:form namespace="/importData" method="POST" enctype="multipart/form-data">
-
- <fieldset>
- <legend>
- <s:text
- name="echobase.legend.importData.configure"/>
- </legend>
-
- <s:select key="model.voyageId" required="true"
- label='%{getText("echobase.common.voyage")}'
- list="voyages" headerKey="" headerValue=""/>
-
- <s:file key="operationFile" required="true"
- label='%{getText("echobase.common.operationFile")}'/>
-
- <s:file key="operationMetadataFile" required="true"
- label='%{getText("echobase.common.operationMetadataFile")}'/>
-
- <s:file key="gearMetadataFile" required="true"
- label='%{getText("echobase.common.gearMetadataFile")}'/>
-
- </fieldset>
-
- <br/>
- <s:submit action="configureOperation" key='echobase.action.import'/>
-
-</s:form>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,63 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+<script type="text/javascript"
+ src="<s:url value='/js/gridHelper.js' />"></script>
+
+<title>
+ Configuration <s:text name="echobase.common.importMode.operation"/>
+</title>
+
+<s:form namespace="/importData" method="POST" enctype="multipart/form-data">
+
+ <fieldset>
+ <legend>
+ <s:text
+ name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:select key="model.voyageId" required="true"
+ label='%{getText("echobase.common.voyage")}'
+ list="voyages" headerKey="" headerValue=""/>
+
+ <s:file key="operationFile" required="true"
+ label='%{getText("echobase.common.operationFile")}'/>
+
+ <s:file key="operationMetadataFile" required="true"
+ label='%{getText("echobase.common.operationMetadataFile")}'/>
+
+ <s:file key="gearMetadataFile" required="true"
+ label='%{getText("echobase.common.gearMetadataFile")}'/>
+
+ <s:textarea key="model.importNotes" cols="80" rows="5"
+ label='%{getText("echobase.common.importNotes")}'/>
+
+ </fieldset>
+
+ <br/>
+ <s:submit action="configureOperation-execute" key='echobase.action.import'/>
+
+</s:form>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,180 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<title>
- Configuration <s:text name="echobase.common.importDataMode.results"/>
-</title>
-
-<script type="text/javascript"
- src="<s:url value='/js/gridHelper.js' />"></script>
-
-<script type="text/javascript">
-
- jQuery(document).ready(function () {
-
- // to change form when mode is changed
- $('[name="model.importMode"]').change(function (event) {
- $('[class~="importMode"]').hide();
- $('#' + this.value).show();
- $('#' + this.value + ' .errorMessage').hide();
- });
-
- // show incoming mode
- var incomingVal = $('[name="model.importMode"][checked="checked"]').val();
- $('#' + incomingVal).show();
-
- $.autoSelectVoyageAndDataProcessing(
- $('#voyageSelectBox'),
- $('#dataProcessingSelectBox'),
- '<s:url action="getDataProcessingsForVoyage" namespace="/importData"/>',
- '<s:property value="model.voyageId"/>',
- '<s:property value="model.dataProcessingId"/>'
- );
- });
-</script>
-
-<s:radio id='mode' key='model.importMode' list="importModes"
- cssClass="cleanBoth"
- label='%{getText("echobase.common.importMode")}'
- required="true" template="myradiomap"/>
-
-<s:form id="VOYAGE" namespace="/importData" method="POST"
- enctype="multipart/form-data" cssClass="hidden importMode">
-
- <fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configure"/>
- </legend>
-
- <s:hidden key="model.importMode" value="VOYAGE" label=''/>
-
- <s:select key="model.voyageId" required="true"
- label='%{getText("echobase.common.voyage")}'
- list="voyages" headerKey="" headerValue=""/>
-
- <s:file key="lengthAgeKeyFile" required="true"
- label='%{getText("echobase.common.lengthAgeKeyFile")}'/>
-
- <s:file key="lengthWeightKeyFile" required="true"
- label='%{getText("echobase.common.lengthWeightKeyFile")}'/>
-
- <s:file key="echotypeFile" required="true"
- label='%{getText("echobase.common.echotypeFile")}'/>
- </fieldset>
- <br/>
- <s:submit action="ConfigureResults-modeVoyage" key='echobase.action.import'/>
-</s:form>
-
-<s:form id="ESDU" namespace="/importData" method="POST"
- enctype="multipart/form-data" cssClass="hidden importMode">
-
- <fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configure"/>
- </legend>
-
- <s:hidden key="model.importMode" value="ESDU" label=''/>
-
- <s:select id='voyageSelectBox' key="model.voyageId" required="true"
- label='%{getText("echobase.common.voyage")}'
- list="voyages" headerKey="" headerValue=""/>
-
- <sj:select id='dataProcessingSelectBox' key="model.dataProcessingId"
- required="true"
- label='%{getText("echobase.common.dataProcessing")}'/>
-
- <s:textfield key="model.resultLabel" size="40" required="true"
- label='%{getText("echobase.common.resultLabel")}'/>
-
- <s:file key="esduByEchotypeFile" required="true"
- label='%{getText("echobase.common.esduByEchotypeFile")}'/>
-
- <s:file key="esduByEchotypeAndSpeciesCategoryFile" required="true"
- label='%{getText("echobase.common.esduByEchotypeAndSpeciesCategoryFile")}'/>
-
- <s:file key="esduBySpeciesAndSizeCategoryFile" required="true"
- label='%{getText("echobase.common.esduBySpeciesAndSizeCategoryFile")}'/>
-
- <s:file key="esduBySpeciesAndAgeCategoryFile" required="true"
- label='%{getText("echobase.common.esduBySpeciesAndAgeCategoryFile")}'/>
- </fieldset>
- <br/>
- <s:submit action="ConfigureResults-modeEsdu" key='echobase.action.import'/>
-</s:form>
-
-<s:form id="REGION" namespace="/importData" method="POST"
- enctype="multipart/form-data" cssClass="hidden importMode">
-
- <fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configure"/>
- </legend>
-
- <s:hidden key="model.importMode" value="REGION" label=''/>
-
- <s:select key="model.voyageId" required="true"
- label='%{getText("echobase.common.voyage")}'
- list="voyages" headerKey="" headerValue=""/>
-
- <s:textfield key="model.resultLabel" size="40" required="true"
- label='%{getText("echobase.common.resultLabel")}'/>
-
- <s:file key="regionsFile" required="true"
- label='%{getText("echobase.common.cellRegionsFile")}'/>
-
- <s:file key="regionAssociationFile" required="true"
- label='%{getText("echobase.common.cellRegionAssociationFile")}'/>
-
- <s:file key="regionResultFile" required="true"
- label='%{getText("echobase.common.cellRegionResultFile")}'/>
- </fieldset>
- <br/>
- <s:submit action="ConfigureResults-modeRegion" key='echobase.action.import'/>
-</s:form>
-
-<s:form id="MAP" namespace="/importData" method="POST"
- enctype="multipart/form-data" cssClass="hidden importMode">
-
- <fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configure"/>
- </legend>
-
- <s:hidden key="model.importMode" value="MAP" label=''/>
-
- <s:select key="model.voyageId" required="true"
- label='%{getText("echobase.common.voyage")}'
- list="voyages" headerKey="" headerValue=""/>
-
- <s:textfield key="model.resultLabel" size="40" required="true"
- label='%{getText("echobase.common.resultLabel")}'/>
-
- <s:file key="mapsFile" required="true"
- label='%{getText("echobase.common.cellMapsFile")}'/>
- </fieldset>
- <br/>
- <s:submit action="ConfigureResults-modeMap" key='echobase.action.import'/>
-</s:form>
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,192 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+<title>
+ Configuration <s:text name="echobase.common.importMode.results"/>
+</title>
+
+<script type="text/javascript"
+ src="<s:url value='/js/gridHelper.js' />"></script>
+
+<script type="text/javascript">
+
+ jQuery(document).ready(function () {
+
+ // to change form when mode is changed
+ $('[name="model.importMode"]').change(function (event) {
+ $('[class~="importMode"]').hide();
+ $('#' + this.value).show();
+ $('#' + this.value + ' .errorMessage').hide();
+ });
+
+ // show incoming mode
+ var incomingVal = $('[name="model.importMode"][checked="checked"]').val();
+ $('#' + incomingVal).show();
+
+ $.autoSelectVoyageAndDataProcessing(
+ $('#voyageSelectBox'),
+ $('#dataProcessingSelectBox'),
+ '<s:url action="getDataProcessingsForVoyage" namespace="/importData"/>',
+ '<s:property value="model.voyageId"/>',
+ '<s:property value="model.dataProcessingId"/>'
+ );
+ });
+</script>
+
+<s:radio id='mode' key='model.importMode' list="importModes"
+ cssClass="cleanBoth"
+ label='%{getText("echobase.common.importMode")}'
+ required="true" template="myradiomap"/>
+
+<s:form id="VOYAGE" namespace="/importData" method="POST"
+ enctype="multipart/form-data" cssClass="hidden importMode">
+
+ <fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:hidden key="model.importMode" value="VOYAGE" label=''/>
+
+ <s:select key="model.voyageId" required="true"
+ label='%{getText("echobase.common.voyage")}'
+ list="voyages" headerKey="" headerValue=""/>
+
+ <s:file key="lengthAgeKeyFile" required="true"
+ label='%{getText("echobase.common.lengthAgeKeyFile")}'/>
+
+ <s:file key="lengthWeightKeyFile" required="true"
+ label='%{getText("echobase.common.lengthWeightKeyFile")}'/>
+
+ <s:file key="echotypeFile" required="true"
+ label='%{getText("echobase.common.echotypeFile")}'/>
+
+ <s:textarea key="model.importNotes" cols="80" rows="5"
+ label='%{getText("echobase.common.importNotes")}'/>
+ </fieldset>
+ <br/>
+ <s:submit action="configureResults-modeVoyage" key='echobase.action.import'/>
+</s:form>
+
+<s:form id="ESDU" namespace="/importData" method="POST"
+ enctype="multipart/form-data" cssClass="hidden importMode">
+
+ <fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:hidden key="model.importMode" value="ESDU" label=''/>
+
+ <s:select id='voyageSelectBox' key="model.voyageId" required="true"
+ label='%{getText("echobase.common.voyage")}'
+ list="voyages" headerKey="" headerValue=""/>
+
+ <sj:select id='dataProcessingSelectBox' key="model.dataProcessingId"
+ required="true"
+ label='%{getText("echobase.common.dataProcessing")}'/>
+
+ <s:textfield key="model.resultLabel" size="40" required="true"
+ label='%{getText("echobase.common.resultLabel")}'/>
+
+ <s:file key="esduByEchotypeFile" required="true"
+ label='%{getText("echobase.common.esduByEchotypeFile")}'/>
+
+ <s:file key="esduByEchotypeAndSpeciesCategoryFile" required="true"
+ label='%{getText("echobase.common.esduByEchotypeAndSpeciesCategoryFile")}'/>
+
+ <s:file key="esduBySpeciesAndSizeCategoryFile" required="true"
+ label='%{getText("echobase.common.esduBySpeciesAndSizeCategoryFile")}'/>
+
+ <s:file key="esduBySpeciesAndAgeCategoryFile" required="true"
+ label='%{getText("echobase.common.esduBySpeciesAndAgeCategoryFile")}'/>
+
+ <s:textarea key="model.importNotes" cols="80" rows="5"
+ label='%{getText("echobase.common.importNotes")}'/>
+ </fieldset>
+ <br/>
+ <s:submit action="configureResults-modeEsdu" key='echobase.action.import'/>
+</s:form>
+
+<s:form id="REGION" namespace="/importData" method="POST"
+ enctype="multipart/form-data" cssClass="hidden importMode">
+
+ <fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:hidden key="model.importMode" value="REGION" label=''/>
+
+ <s:select key="model.voyageId" required="true"
+ label='%{getText("echobase.common.voyage")}'
+ list="voyages" headerKey="" headerValue=""/>
+
+ <s:textfield key="model.resultLabel" size="40" required="true"
+ label='%{getText("echobase.common.resultLabel")}'/>
+
+ <s:file key="regionsFile" required="true"
+ label='%{getText("echobase.common.cellRegionsFile")}'/>
+
+ <s:file key="regionAssociationFile" required="true"
+ label='%{getText("echobase.common.cellRegionAssociationFile")}'/>
+
+ <s:file key="regionResultFile" required="true"
+ label='%{getText("echobase.common.cellRegionResultFile")}'/>
+
+ <s:textarea key="model.importNotes" cols="80" rows="5"
+ label='%{getText("echobase.common.importNotes")}'/>
+ </fieldset>
+ <br/>
+ <s:submit action="configureResults-modeRegion" key='echobase.action.import'/>
+</s:form>
+
+<s:form id="MAP" namespace="/importData" method="POST"
+ enctype="multipart/form-data" cssClass="hidden importMode">
+
+ <fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:hidden key="model.importMode" value="MAP" label=''/>
+
+ <s:select key="model.voyageId" required="true"
+ label='%{getText("echobase.common.voyage")}'
+ list="voyages" headerKey="" headerValue=""/>
+
+ <s:textfield key="model.resultLabel" size="40" required="true"
+ label='%{getText("echobase.common.resultLabel")}'/>
+
+ <s:file key="mapsFile" required="true"
+ label='%{getText("echobase.common.cellMapsFile")}'/>
+
+ <s:textarea key="model.importNotes" cols="80" rows="5"
+ label='%{getText("echobase.common.importNotes")}'/>
+ </fieldset>
+ <br/>
+ <s:submit action="configureResults-modeMap" key='echobase.action.import'/>
+</s:form>
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,43 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 - 2012 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-
-<s:url id="url" action="importAccousticData" namespace="/importData"/>
-<meta http-equiv="refresh" content="1;url=${url}"/>
-
-<title>
- <s:text name="echobase.common.importDataMode.accousticData"/>
- <s:text name="echobase.common.inProgress"/>
-</title>
-
-<%-- TODO letellier 20111104 : Add warn icon --%>
-<p><s:text name="echobase.message.warnImportInProgress"/></p>
-
-<br/>
-
-<div>
- <sj:progressbar value="%{model.progression}"/>
-</div>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,43 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+
+<s:url id="url" action="importAccoustic" namespace="/importData"/>
+<meta http-equiv="refresh" content="1;url=${url}"/>
+
+<title>
+ <s:text name="echobase.common.importMode.acoustic"/>
+ <s:text name="echobase.common.inProgress"/>
+</title>
+
+<%-- TODO letellier 20111104 : Add warn icon --%>
+<p><s:text name="echobase.message.warnImportInProgress"/></p>
+
+<br/>
+
+<div>
+ <sj:progressbar value="%{model.progression}"/>
+</div>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,43 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 - 2012 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-
-<s:url id="url" action="importCatchesData" namespace="/importData"/>
-<meta http-equiv="refresh" content="1;url=${url}"/>
-
-<title>
- <s:text name="echobase.common.importDataMode.catchesData"/>
- <s:text name="echobase.common.inProgress"/>
-</title>
-
-<%-- TODO letellier 20111104 : Add warn icon --%>
-<p><s:text name="echobase.message.warnImportInProgress"/></p>
-
-<br/>
-
-<div>
- <sj:progressbar value="%{model.progression}"/>
-</div>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,43 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+
+<s:url id="url" action="importCatches" namespace="/importData"/>
+<meta http-equiv="refresh" content="1;url=${url}"/>
+
+<title>
+ <s:text name="echobase.common.importMode.catches"/>
+ <s:text name="echobase.common.inProgress"/>
+</title>
+
+<%-- TODO letellier 20111104 : Add warn icon --%>
+<p><s:text name="echobase.message.warnImportInProgress"/></p>
+
+<br/>
+
+<div>
+ <sj:progressbar value="%{model.progression}"/>
+</div>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,43 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 - 2012 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-
-<s:url id="url" action="importCommonData" namespace="/importData"/>
-<meta http-equiv="refresh" content="1;url=${url}"/>
-
-<title>
- <s:text name="echobase.common.importDataMode.commonData"/>
- <s:text name="echobase.common.inProgress"/>
-</title>
-
-<%-- TODO letellier 20111104 : Add warn icon --%>
-<p><s:text name="echobase.message.warnImportInProgress"/></p>
-
-<br/>
-
-<div>
- <sj:progressbar value="%{model.progression}"/>
-</div>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,43 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+
+<s:url id="url" action="importCommon" namespace="/importData"/>
+<meta http-equiv="refresh" content="1;url=${url}"/>
+
+<title>
+ <s:text name="echobase.common.importMode.common"/>
+ <s:text name="echobase.common.inProgress"/>
+</title>
+
+<%-- TODO letellier 20111104 : Add warn icon --%>
+<p><s:text name="echobase.message.warnImportInProgress"/></p>
+
+<br/>
+
+<div>
+ <sj:progressbar value="%{model.progression}"/>
+</div>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,43 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 - 2012 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-
-<s:url id="url" action="importOperation" namespace="/importData"/>
-<meta http-equiv="refresh" content="1;url=${url}"/>
-
-<title>
- <s:text name="echobase.common.importDataMode.operation"/>
- <s:text name="echobase.common.inProgress"/>
-</title>
-
-<%-- TODO letellier 20111104 : Add warn icon --%>
-<p><s:text name="echobase.message.warnImportInProgress"/></p>
-
-<br/>
-
-<div>
- <sj:progressbar value="%{model.progression}"/>
-</div>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperationImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperationImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperationImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,43 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+
+<s:url id="url" action="importOperation" namespace="/importData"/>
+<meta http-equiv="refresh" content="1;url=${url}"/>
+
+<title>
+ <s:text name="echobase.common.importMode.operation"/>
+ <s:text name="echobase.common.inProgress"/>
+</title>
+
+<%-- TODO letellier 20111104 : Add warn icon --%>
+<p><s:text name="echobase.message.warnImportInProgress"/></p>
+
+<br/>
+
+<div>
+ <sj:progressbar value="%{model.progression}"/>
+</div>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperationImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,43 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 - 2012 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-
-<s:url id="url" action="importResults" namespace="/importData"/>
-<meta http-equiv="refresh" content="1;url=${url}"/>
-
-<title>
- <s:text name="echobase.common.importDataMode.results"/>
- <s:text name="echobase.common.inProgress"/>
-</title>
-
-<%-- TODO letellier 20111104 : Add warn icon --%>
-<p><s:text name="echobase.message.warnImportInProgress"/></p>
-
-<br/>
-
-<div>
- <sj:progressbar value="%{model.progression}"/>
-</div>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResultsImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResultsImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResultsImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,43 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+
+<s:url id="url" action="importResults" namespace="/importData"/>
+<meta http-equiv="refresh" content="1;url=${url}"/>
+
+<title>
+ <s:text name="echobase.common.importMode.results"/>
+ <s:text name="echobase.common.inProgress"/>
+</title>
+
+<%-- TODO letellier 20111104 : Add warn icon --%>
+<p><s:text name="echobase.message.warnImportInProgress"/></p>
+
+<br/>
+
+<div>
+ <sj:progressbar value="%{model.progression}"/>
+</div>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResultsImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,32 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title>
- <s:text name="echobase.common.importResult"/>
- <s:text name="echobase.common.importDataMode.accousticData"/>
-</title>
-
-<%@ include file="/WEB-INF/includes/importDataResults.jsp" %>
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAcousticImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAcousticImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAcousticImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,32 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<title>
+ <s:text name="echobase.common.importResult"/>
+ <s:text name="echobase.common.importMode.acoustic"/>
+</title>
+
+<%@ include file="/WEB-INF/includes/importDataResults.jsp" %>
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAcousticImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,32 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title>
- <s:text name="echobase.common.importResult"/>
- <s:text name="echobase.common.importDataMode.catchesData"/>
-</title>
-
-<%@ include file="/WEB-INF/includes/importDataResults.jsp" %>
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,32 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<title>
+ <s:text name="echobase.common.importResult"/>
+ <s:text name="echobase.common.importMode.catches"/>
+</title>
+
+<%@ include file="/WEB-INF/includes/importDataResults.jsp" %>
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,32 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title>
- <s:text name="echobase.common.importResult"/>
- <s:text name="echobase.common.importDataMode.commonData"/>
-</title>
-
-<%@ include file="/WEB-INF/includes/importDataResults.jsp" %>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,31 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<title>
+ <s:text name="echobase.common.importMode.common"/>
+</title>
+
+<%@ include file="/WEB-INF/includes/importDataResults.jsp" %>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,32 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title>
- <s:text name="echobase.common.importResult"/>
- <s:text name="echobase.common.importDataMode.operation"/>
-</title>
-
-<%@ include file="/WEB-INF/includes/importDataResults.jsp" %>
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperationImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperationImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperationImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,32 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<title>
+ <s:text name="echobase.common.importResult"/>
+ <s:text name="echobase.common.importMode.operation"/>
+</title>
+
+<%@ include file="/WEB-INF/includes/importDataResults.jsp" %>
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperationImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -1,36 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title>
- <s:text name="echobase.common.importResult"/>
-</title>
-
-<h4>
- <s:text name="echobase.common.importDataMode.results"/>
- ( <s:property value="%{getText(model.importMode.i18nKey)}"/> )
-</h4>
-
-<%@ include file="/WEB-INF/includes/importDataResults.jsp" %>
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResultsImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResultsImport.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResultsImport.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -0,0 +1,36 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<title>
+ <s:text name="echobase.common.importResult"/>
+</title>
+
+<h4>
+ <s:text name="echobase.common.importMode.results"/>
+ ( <s:property value="%{getText(model.importMode.i18nKey)}"/> )
+</h4>
+
+<%@ include file="/WEB-INF/includes/importDataResults.jsp" %>
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResultsImport.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/selectImportType.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/selectImportType.jsp 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/selectImportType.jsp 2012-03-30 16:46:14 UTC (rev 460)
@@ -32,7 +32,7 @@
// change the action target
$('#selectImportType_configure').attr(
'name',
- 'action:configure-' + newValue + '!input');
+ 'action:configure' + newValue + '-input');
}
jQuery(document).ready(function () {
Modified: trunk/echobase-ui/src/main/webapp/css/screen.css
===================================================================
--- trunk/echobase-ui/src/main/webapp/css/screen.css 2012-03-30 16:43:51 UTC (rev 459)
+++ trunk/echobase-ui/src/main/webapp/css/screen.css 2012-03-30 16:46:14 UTC (rev 460)
@@ -86,6 +86,11 @@
hr{
border:none;
}
+
+fieldset pre,#errorStack {
+ font-size: larger;
+}
+
#footer {
clear: both;
text-align: center;
@@ -202,7 +207,7 @@
.wwlbl {
clear: both;
float: left;
- width: 250px;
+ width: 350px;
margin:5px 0;
}
.wwctrl {
@@ -221,8 +226,9 @@
margin:10px 0;
}
.required {
- color: #880000;
+ color: #ffe600;
font-style: italic;
+ font-size: large;
}
.clearfix {
display: inline-block;
@@ -239,7 +245,7 @@
margin-left: 6em;
margin-right: auto;
margin-top: 0;
- width: 615px;
+ /*width: 615px;*/
}
div#headerRight {
float: right;
@@ -468,7 +474,28 @@
height:41px;
}
input[type="file"]{
+ color: black;
background-color: #FFF;
+ font-size: 120%;
+ /*height: 35px;*/
+ /*border-style: inset;*/
+ /*border-width: 2px;*/
+ /*overflow: hidden;*/
+ /*padding: 1px;*/
+ /*zoom: 1;*/
+ /*border-radius:0px;*/
+ /*-moz-border-radius:0px;*/
+ /*-webkit-border-radius:0px;*/
+ width:600px;
+ /*max-width:300px !important;*/
+ cursor:pointer;
+ /*float:right;*/
+ /*display:block;*/
+ /*clear:both;*/
+}
+
+/*input[type="file"]{
+ background-color: #FFF;
border-style: inset;
border-width: 2px;
overflow: hidden;
@@ -477,14 +504,14 @@
border-radius:0px;
-moz-border-radius:0px;
-webkit-border-radius:0px;
- width:auto !important;
- max-width:none !important;
+ width:300px !important;
+ max-width:300px !important;
cursor:pointer;
float:right;
display:block;
clear:both;
-
-}
+}*/
+
#wwctrl_configure_model_voyageIds{
margin-bottom:20px;
}
@@ -681,4 +708,6 @@
.top a.i18nActive {
border: 2px solid white;
-}
\ No newline at end of file
+}
+
+#errorStack { padding:5px; width:80%; overflow:auto; }
\ No newline at end of file
1
0
r459 - in trunk/echobase-ui/src/main: java/fr/ifremer/echobase/ui/actions webapp/WEB-INF/jsp webapp/WEB-INF/jsp/dbeditor
by tchemit@users.forge.codelutin.com 30 Mar '12
by tchemit@users.forge.codelutin.com 30 Mar '12
30 Mar '12
Author: tchemit
Date: 2012-03-30 18:43:51 +0200 (Fri, 30 Mar 2012)
New Revision: 459
Url: http://forge.codelutin.com/repositories/revision/echobase/459
Log:
fixes #1053: Ajouter le filtre de recherche sur le table de journal de la base
Modified:
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/AbstractJSONPaginedAction.java
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/modificationLogs.jsp
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/AbstractJSONPaginedAction.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/AbstractJSONPaginedAction.java 2012-03-29 22:54:10 UTC (rev 458)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/AbstractJSONPaginedAction.java 2012-03-30 16:43:51 UTC (rev 459)
@@ -23,6 +23,7 @@
*/
package fr.ifremer.echobase.ui.actions;
+import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;
import org.apache.struts2.json.JSONException;
import org.apache.struts2.json.JSONUtil;
@@ -59,6 +60,12 @@
protected String filters;
+ protected String searchField;
+
+ protected String searchString;
+
+ protected String searchOper;
+
public void setRows(Integer rows) {
pager.setPageSize(rows);
}
@@ -91,6 +98,18 @@
this.filters = filters;
}
+ public void setSearchField(String searchField) {
+ this.searchField = searchField;
+ }
+
+ public void setSearchString(String searchString) {
+ this.searchString = searchString;
+ }
+
+ public void setSearchOper(String searchOper) {
+ this.searchOper = searchOper;
+ }
+
protected String getSortColumn() {
String result = null;
if (useSort()) {
@@ -124,6 +143,22 @@
FilterPagerUtil.newFilterPagerBeanBuilder(groupOp).
addOperations(rules).
flush(pager);
+ } else {
+
+ // could be a single search
+
+ if (StringUtils.isNotEmpty(searchField)) {
+
+ Map<String, String> rule = Maps.newTreeMap();
+ rule.put("op", searchOper);
+ rule.put("field", searchField);
+ rule.put("data", searchString);
+ FilterPagerUtil.newFilterPagerBeanBuilder("AND").
+ addRule(rule).
+ flush(pager);
+ }
}
+
+
}
}
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2012-03-29 22:54:10 UTC (rev 458)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2012-03-30 16:43:51 UTC (rev 459)
@@ -28,7 +28,6 @@
<script type="text/javascript"
src="<s:url value='/js/gridHelper.js' />"></script>
-<s:url id="reloadUrl" action="dbeditor" namespace="/dbeditor"/>
<s:url id="getTableData" action="getTableData" namespace="/dbeditor"/>
<s:set name="tableSelected" value="%{entityType != null}"/>
@@ -52,8 +51,8 @@
// on table name change, let's reload reload this page
$('[name="entityType"]').change(function (event) {
- var url = "${reloadUrl}?" + $.param({entityType:this.value});
- window.location = url;
+ window.location = '<s:url action="dbeditor" namespace="/dbeditor"/>?' +
+ $.param({entityType:this.value});
});
// on reset let's just reload the selected row
@@ -247,7 +246,6 @@
value="%{getText('echobase.common.tableDatas', entityTypes[entityType])}"/>
<sjg:grid id="datas" dataType="json" href="%{loadUrl}" gridModel="datas"
- caption="%{tableI18nName}"
pager="true" pagerButtons="true" pagerInput="true" navigator="true"
autowidth="true" rownumbers="false" viewrecords="true"
navigatorEdit="false" navigatorSearch="true"
@@ -377,3 +375,15 @@
</s:if>
+<script type="text/javascript">
+
+ jQuery(document).ready(function () {
+
+ <s:if test="admin">
+ $('#tab_importForm > a').click();
+ </s:if>
+ <s:else>
+ $('#tab_exportForm > a').click();
+ </s:else>
+ });
+</script>
\ No newline at end of file
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/modificationLogs.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/modificationLogs.jsp 2012-03-29 22:54:10 UTC (rev 458)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/modificationLogs.jsp 2012-03-30 16:43:51 UTC (rev 459)
@@ -26,17 +26,16 @@
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %>
<script type="text/javascript"
src="<s:url value='/js/gridHelper.js' />"></script>
-<s:set var="emptySelection"><s:text name="echobase.message.noEntrySelection"/></s:set>
+<s:set var="emptySelection"><s:text
+ name="echobase.message.noEntrySelection"/></s:set>
<script type="text/javascript">
jQuery(document).ready(function () {
- $.addRowSelectTopic('datas', function(event){
+ $.addRowSelectTopic('datas', function (event) {
var text = $("tr[aria-selected=true] td[aria-describedby='datas_modificationText']").text();
- console.info("New selection = "+text);
$('#modificationTextContainter').html(text);
});
- $.addClearSelectTopic('datas', function(event){
- console.info("Clear selection = ");
+ $.addClearSelectTopic('datas', function (event) {
$('#modificationTextContainter').html("${emptySelection}");
});
$.addEvenAndOddClasses('datas');
@@ -48,14 +47,14 @@
escapeAmp="false"/>
<sjg:grid id="datas" dataType="json" href="%{loadUrl}" gridModel="datas"
- caption="%{getText('echobase.common.entityModificationLog')}"
pager="true" pagerButtons="true" pagerInput="true" navigator="true"
autowidth="true" rownumbers="false" viewrecords="true"
- navigatorEdit="false" navigatorSearch="false"
+ navigatorEdit="false" navigatorSearch="true"
navigatorDelete="false" navigatorAdd="false"
rowList="10,15,20,50,100,250,500" rowNum="10"
onSelectRowTopics='datas-rowSelect'
- onCompleteTopics="datas-clearSelect,datas-CompleteTopics">
+ onCompleteTopics="datas-clearSelect,datas-CompleteTopics"
+ navigatorSearchOptions="{multipleGroup:false,multipleSearch:false,sopt:['eq','ne','cn','nc','bw','bn','ew','en','lt','le','gt','ge','nu','nn']}">
<sjg:gridColumn name="entityType" sortable="true"
title="%{getText('echobase.common.entityType')}"/>
1
0
r458 - in trunk: echobase-entities/src/main/java/fr/ifremer/echobase/csv echobase-services/src/main/java/fr/ifremer/echobase/services/importdata echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv echobase-services/src/test/java/fr/ifremer/echobase/services echobase-services/src/test/java/fr/ifremer/echobase/services/importdata
by tchemit@users.forge.codelutin.com 29 Mar '12
by tchemit@users.forge.codelutin.com 29 Mar '12
29 Mar '12
Author: tchemit
Date: 2012-03-30 00:54:10 +0200 (Fri, 30 Mar 2012)
New Revision: 458
Url: http://forge.codelutin.com/repositories/revision/echobase/458
Log:
fixes #1059: S?\195?\169lectionner un dataProcessing pour l'import des r?\195?\169sultats esdu + mise en commun du code de cr?\195?\169ation de rResult
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/CellValueParser.java
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/EchobaseCsvUtil.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportModel.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EchoBaseTestServiceSupport.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportServiceIT.java
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/CellValueParser.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/CellValueParser.java 2012-03-29 21:57:23 UTC (rev 457)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/CellValueParser.java 2012-03-29 22:54:10 UTC (rev 458)
@@ -40,16 +40,21 @@
final Voyage voyage;
- private final CellDAO cellDAO;
+ private final Map<String, Cell> esduCellMap;
- private final Map<String, Cell> esduCells;
+ private CellDAO cellDAO;
protected CellValueParser(Voyage voyage, CellDAO cellDAO) {
this.voyage = voyage;
+ this.esduCellMap = Maps.newTreeMap();
this.cellDAO = cellDAO;
- esduCells = Maps.newTreeMap();
}
+ protected CellValueParser(Voyage voyage, Map<String, Cell> esduCellMap) {
+ this.voyage = voyage;
+ this.esduCellMap = esduCellMap;
+ }
+
@Override
public Cell parse(String value) throws ParseException {
@@ -97,9 +102,9 @@
protected Cell getEsduCell(String esduCellId) throws ParseException {
- Cell result = esduCells.get(esduCellId);
+ Cell result = esduCellMap.get(esduCellId);
- if (result == null) {
+ if (result == null && cellDAO != null) {
try {
List<Cell> cells = cellDAO.findAllByName(esduCellId);
@@ -112,7 +117,7 @@
result = cells.get(0);
// store it in cache
- esduCells.put(esduCellId, result);
+ esduCellMap.put(esduCellId, result);
} catch (TopiaException e) {
throw new ImportRuntimeException(
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/EchobaseCsvUtil.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/EchobaseCsvUtil.java 2012-03-29 21:57:23 UTC (rev 457)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/EchobaseCsvUtil.java 2012-03-29 22:54:10 UTC (rev 458)
@@ -39,6 +39,7 @@
import java.text.ParseException;
import java.util.Collection;
import java.util.Date;
+import java.util.List;
import java.util.Map;
/**
@@ -131,8 +132,15 @@
return new CellValueParser(voyage, cellDAO);
}
+ public static ValueParser<Cell> newCellValueParser(Voyage voyage,
+ Map<String, Cell> esduCellMap) {
+ return new CellValueParser(voyage, esduCellMap);
+ }
+
public static interface ResultAble {
void addResult(Result value);
+
+ List<Result> getResult();
}
public static <B extends ResultAble> ValueSetter<B, Result> newResultValueSetter() {
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java 2012-03-29 21:57:23 UTC (rev 457)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java 2012-03-29 22:54:10 UTC (rev 458)
@@ -30,6 +30,7 @@
import fr.ifremer.echobase.EchoBaseTechnicalException;
import fr.ifremer.echobase.InputFile;
import fr.ifremer.echobase.csv.CsvFileImportResult;
+import fr.ifremer.echobase.csv.EchobaseCsvUtil;
import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
import fr.ifremer.echobase.entities.EchoBaseUser;
import fr.ifremer.echobase.entities.EntityModificationLog;
@@ -39,6 +40,8 @@
import fr.ifremer.echobase.entities.data.Data;
import fr.ifremer.echobase.entities.data.DataDAO;
import fr.ifremer.echobase.entities.data.Echotype;
+import fr.ifremer.echobase.entities.data.Result;
+import fr.ifremer.echobase.entities.data.ResultDAO;
import fr.ifremer.echobase.entities.references.AgeCategory;
import fr.ifremer.echobase.entities.references.DataMetadata;
import fr.ifremer.echobase.entities.references.SexCategory;
@@ -247,12 +250,13 @@
protected Map<String, SpeciesCategory> speciesCategories = Maps.newTreeMap();
- protected SpeciesCategory getSpeciesCategory(SpeciesCategoryDAO speciesCategoryDAO,
- Species species,
- SizeCategory sizeCategory,
- AgeCategory ageCategory,
- SexCategory sexCategory,
- CsvFileImportResult importResult) {
+ protected SpeciesCategory getSpeciesCategory(
+ SpeciesCategoryDAO speciesCategoryDAO,
+ Species species,
+ SizeCategory sizeCategory,
+ AgeCategory ageCategory,
+ SexCategory sexCategory,
+ CsvFileImportResult importResult) {
String key = species == null ? "" : species.getBaracoudaCode();
key += "#" + (ageCategory == null ? "" : ageCategory.getName());
@@ -293,13 +297,14 @@
protected Map<String, Category> categories = Maps.newTreeMap();
- protected Category getResultCategory(CategoryDAO categoryDAO,
- SpeciesCategoryDAO speciesCategoryDAO,
- Echotype echotype,
- Species species,
- SizeCategory sizeCategory,
- AgeCategory ageCategory,
- CsvFileImportResult importResult) {
+ protected Category getResultCategory(
+ CategoryDAO categoryDAO,
+ SpeciesCategoryDAO speciesCategoryDAO,
+ Echotype echotype,
+ Species species,
+ SizeCategory sizeCategory,
+ AgeCategory ageCategory,
+ CsvFileImportResult importResult) {
// get species categorie first
@@ -318,10 +323,11 @@
return category;
}
- protected Category getResultCategory(CategoryDAO categoryDAO,
- Echotype echotype,
- SpeciesCategory speciesCategory,
- CsvFileImportResult importResult) {
+ protected Category getResultCategory(
+ CategoryDAO categoryDAO,
+ Echotype echotype,
+ SpeciesCategory speciesCategory,
+ CsvFileImportResult importResult) {
String key = speciesCategory == null ? "" : speciesCategory.getTopiaId();
key += "#" + (echotype == null ? "" : echotype.getName());
@@ -355,9 +361,10 @@
return category;
}
- protected List<DataMetadata> getMetas(String[] columnNamesToExclude,
- Map<String, DataMetadata> dataMetadataMap,
- String... headers) {
+ protected List<DataMetadata> getMetas(
+ String[] columnNamesToExclude,
+ Map<String, DataMetadata> dataMetadataMap,
+ String... headers) {
List<String> metadataNames = Lists.newArrayList(headers);
for (String columnToExclude : columnNamesToExclude) {
@@ -400,4 +407,23 @@
importResult.incrementsNumberCreated(EchoBaseEntityEnum.Data);
}
+
+ protected void addResults(EchobaseCsvUtil.ResultAble row,
+ Cell cell,
+ Category category,
+ String resultLabel,
+ ResultDAO dao,
+ CsvFileImportResult importResult) {
+ List<Result> results = row.getResult();
+
+ for (Result result : results) {
+
+ result.setCategory(category);
+ result.setResultLabel(resultLabel);
+
+ Result resultCreated = create(dao, result);
+ cell.addResult(resultCreated);
+ importResult.incrementsNumberCreated(EchoBaseEntityEnum.Result);
+ }
+ }
}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java 2012-03-29 21:57:23 UTC (rev 457)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java 2012-03-29 22:54:10 UTC (rev 458)
@@ -34,7 +34,6 @@
import fr.ifremer.echobase.entities.data.Category;
import fr.ifremer.echobase.entities.data.CategoryDAO;
import fr.ifremer.echobase.entities.data.Cell;
-import fr.ifremer.echobase.entities.data.CellDAO;
import fr.ifremer.echobase.entities.data.DataProcessing;
import fr.ifremer.echobase.entities.data.Echotype;
import fr.ifremer.echobase.entities.data.Result;
@@ -48,7 +47,6 @@
import fr.ifremer.echobase.entities.references.Species;
import fr.ifremer.echobase.entities.references.SpeciesCategory;
import fr.ifremer.echobase.entities.references.SpeciesCategoryDAO;
-import fr.ifremer.echobase.services.DecoratorService;
import fr.ifremer.echobase.services.ImportException;
import fr.ifremer.echobase.services.importdata.csv.EsduResultByEchotypeAndSpeciesCategoryImportModel;
import fr.ifremer.echobase.services.importdata.csv.EsduResultByEchotypeAndSpeciesCategoryImportRow;
@@ -60,10 +58,8 @@
import fr.ifremer.echobase.services.importdata.csv.EsduResultBySpeciesAndSizeCategoryImportRow;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.persistence.TopiaDAO;
import org.nuiton.util.csv.Import;
import org.nuiton.util.csv.ImportRuntimeException;
-import org.nuiton.util.decorator.Decorator;
import java.io.Reader;
import java.util.List;
@@ -115,6 +111,10 @@
DataProcessing dataProcessing = getEntityById(DataProcessing.class,
configuration.getDataProcessingId());
+ // get esdu cells usables
+ Map<String, Cell> esduCellMap = Maps.uniqueIndex(
+ dataProcessing.getCell(), EchoBaseFunctions.CELL_BY_NAME);
+
// index all echotypes of thi voyage
Map<String, Echotype> echotypeMap = Maps.uniqueIndex(
voyage.getEchotype(), EchoBaseFunctions.ECHOTYPE_NAME);
@@ -130,7 +130,8 @@
inputFile,
voyage,
echotypeMap,
- dataMetadataMap
+ dataMetadataMap,
+ esduCellMap
);
addResultAndLog(result, inputFile, importResult, user);
}
@@ -144,7 +145,8 @@
echotypeMap,
dataMetadataMap,
speciesMap,
- sizeCategoryMap
+ sizeCategoryMap,
+ esduCellMap
);
addResultAndLog(result, inputFile, importResult, user);
}
@@ -157,7 +159,8 @@
voyage,
dataMetadataMap,
speciesMap,
- sizeCategoryMap
+ sizeCategoryMap,
+ esduCellMap
);
addResultAndLog(result, inputFile, importResult, user);
}
@@ -171,7 +174,8 @@
voyage,
dataMetadataMap,
speciesMap,
- ageCategoryMap
+ ageCategoryMap,
+ esduCellMap
);
addResultAndLog(result, inputFile, importResult, user);
}
@@ -183,7 +187,8 @@
InputFile inputFile,
Voyage voyage,
Map<String, Echotype> echotypeMap,
- Map<String, DataMetadata> dataMetadataMap) throws ImportException {
+ Map<String, DataMetadata> dataMetadataMap,
+ Map<String, Cell> esduCellMap) throws ImportException {
if (log.isInfoEnabled()) {
log.info("Starts import of esdu result by echotype from file " +
@@ -202,35 +207,27 @@
dataMetadataMap,
header);
- CellDAO cellDAO = (CellDAO) getDAO(Cell.class);
-
EsduResultByEchotypeImportModel csvModel = new EsduResultByEchotypeImportModel(
serviceContext.getConfiguration().getCsvSeparator(),
echotypeMap,
voyage,
- cellDAO,
+ esduCellMap,
metas);
CategoryDAO categoryDAO = (CategoryDAO) getDAO(Category.class);
- SpeciesCategoryDAO speciesCategoryDAO =
- getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class);
+ ResultDAO dao = getDAO(Result.class, ResultDAO.class);
String resultLabel = configuration.getResultLabel();
- DecoratorService decoratorService = getService(DecoratorService.class);
- Decorator<Category> categoryDecorator = decoratorService.getDecorator(getLocale(), Category.class, null);
Reader reader = getInputFileReader(inputFile);
try {
Import<EsduResultByEchotypeImportRow> importer =
EchoBaseImport.newImport(csvModel, reader);
- int rowNumber = 0;
-
configuration.incrementsProgression();
for (EsduResultByEchotypeImportRow row : importer) {
configuration.incrementsProgression();
- rowNumber++;
Cell cell = row.getCell();
@@ -239,28 +236,7 @@
null,
importResult);
- if (rowNumber % 100 == 0) {
- if (log.isInfoEnabled()) {
- log.info("Treat row " + rowNumber + " for esdu cell " +
- cell.getName() + " and category " +
- categoryDecorator.toString(category));
- }
- }
- List<Result> results = row.getResult();
-
- TopiaDAO<Result> dao = getDAO(Result.class);
-
- for (Result result : results) {
-
- result.setCategory(category);
- result.setResultLabel(resultLabel);
-
- Result resultCreated = create(dao, result);
-
- cell.addResult(resultCreated);
-
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.Result);
- }
+ addResults(row, cell, category, resultLabel, dao, importResult);
}
return importResult;
@@ -278,7 +254,8 @@
Map<String, Echotype> echotypeMap,
Map<String, DataMetadata> dataMetadataMap,
Map<String, Species> speciesMap,
- Map<String, SizeCategory> sizeCategoryMap) throws ImportException {
+ Map<String, SizeCategory> sizeCategoryMap,
+ Map<String, Cell> esduCellMap) throws ImportException {
if (log.isInfoEnabled()) {
log.info("Starts import of acoustic result by echotype " +
@@ -299,8 +276,6 @@
dataMetadataMap,
header);
- CellDAO cellDAO = getDAO(Cell.class, CellDAO.class);
-
SpeciesCategoryDAO speciesCategoryDAO =
getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class);
@@ -314,13 +289,9 @@
speciesMap,
sizeCategoryMap,
voyage,
- cellDAO,
+ esduCellMap,
metas);
-
- DecoratorService decoratorService = getService(DecoratorService.class);
- Decorator<Category> categoryDecorator = decoratorService.getDecorator(getLocale(), Category.class, null);
-
String resultLabel = configuration.getResultLabel();
Reader reader = getInputFileReader(inputFile);
@@ -328,13 +299,10 @@
EchoBaseImport<EsduResultByEchotypeAndSpeciesCategoryImportRow> importer =
EchoBaseImport.newImport(csvModel, reader);
- int rowNumber = 0;
-
configuration.incrementsProgression();
for (EsduResultByEchotypeAndSpeciesCategoryImportRow row : importer) {
configuration.incrementsProgression();
- rowNumber++;
Cell cell = row.getCell();
@@ -346,27 +314,7 @@
null,
importResult);
- if (rowNumber % 100 == 0) {
- if (log.isInfoEnabled()) {
- log.info("Treat row " + rowNumber + " for esdu cell " +
- cell.getName() + " and category " +
- categoryDecorator.toString(category));
- }
- }
-
- List<Result> results = row.getResult();
-
- for (Result result : results) {
-
- result.setCategory(category);
- result.setResultLabel(resultLabel);
-
- Result resultCreated = create(dao, result);
-
- cell.addResult(resultCreated);
-
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.Result);
- }
+ addResults(row, cell, category, resultLabel, dao, importResult);
}
return importResult;
@@ -382,7 +330,8 @@
Voyage voyage,
Map<String, DataMetadata> dataMetadataMap,
Map<String, Species> speciesMap,
- Map<String, SizeCategory> sizeCategoryMap) throws ImportException {
+ Map<String, SizeCategory> sizeCategoryMap,
+ Map<String, Cell> esduCellMap) throws ImportException {
if (log.isInfoEnabled()) {
log.info("Starts import of acoustic result by speices and size category from file " +
@@ -403,26 +352,23 @@
dataMetadataMap,
header);
- CellDAO cellDAO = (CellDAO) getDAO(Cell.class);
-
SpeciesCategoryDAO speciesCategoryDAO =
getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class);
SizeCategoryDAO sizeCategoryDAO =
getDAO(SizeCategory.class, SizeCategoryDAO.class);
+ ResultDAO dao = getDAO(Result.class, ResultDAO.class);
+
EsduResultBySpeciesAndSizeCategoryImportModel csvModel = new EsduResultBySpeciesAndSizeCategoryImportModel(
serviceContext.getConfiguration().getCsvSeparator(),
speciesMap,
voyage,
- cellDAO,
+ esduCellMap,
metas);
CategoryDAO categoryDAO = (CategoryDAO) getDAO(Category.class);
- DecoratorService decoratorService = getService(DecoratorService.class);
- Decorator<Category> categoryDecorator = decoratorService.getDecorator(getLocale(), Category.class, null);
-
String resultLabel = configuration.getResultLabel();
Reader reader = getInputFileReader(inputFile);
@@ -430,13 +376,10 @@
EchoBaseImport<EsduResultBySpeciesAndSizeCategoryImportRow> importer =
EchoBaseImport.newImport(csvModel, reader);
- int rowNumber = 0;
-
configuration.incrementsProgression();
for (EsduResultBySpeciesAndSizeCategoryImportRow row : importer) {
configuration.incrementsProgression();
- rowNumber++;
Cell cell = row.getCell();
@@ -469,27 +412,7 @@
null,
importResult);
- if (rowNumber % 100 == 0) {
- if (log.isInfoEnabled()) {
- log.info("Treat row " + rowNumber + " for esdu cell " +
- cell.getName() + " and category " +
- categoryDecorator.toString(category));
- }
- }
-
- List<Result> results = row.getResult();
-
- TopiaDAO<Result> dao = getDAO(Result.class);
-
- for (Result result : results) {
-
- result.setCategory(category);
- result.setResultLabel(resultLabel);
-
- Result resultCreated = create(dao, result);
- cell.addResult(resultCreated);
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.Result);
- }
+ addResults(row, cell, category, resultLabel, dao, importResult);
}
return importResult;
@@ -506,7 +429,8 @@
Voyage voyage,
Map<String, DataMetadata> dataMetadataMap,
Map<String, Species> speciesMap,
- Map<String, AgeCategory> ageCategoryMap) throws ImportException {
+ Map<String, AgeCategory> ageCategoryMap,
+ Map<String, Cell> esduCellMap) throws ImportException {
if (log.isInfoEnabled()) {
log.info("Starts import of acoustic result by species and age category from file " +
@@ -527,24 +451,21 @@
dataMetadataMap,
header);
- CellDAO cellDAO = (CellDAO) getDAO(Cell.class);
SpeciesCategoryDAO speciesCategoryDAO =
getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class);
AgeCategoryDAO ageCategoryDAO =
getDAO(AgeCategory.class, AgeCategoryDAO.class);
CategoryDAO categoryDAO = (CategoryDAO) getDAO(Category.class);
+ ResultDAO dao = getDAO(Result.class, ResultDAO.class);
+
EsduResultBySpeciesAndAgeCategoryImportModel csvModel = new EsduResultBySpeciesAndAgeCategoryImportModel(
serviceContext.getConfiguration().getCsvSeparator(),
speciesMap,
voyage,
- cellDAO,
+ esduCellMap,
metas);
-
- DecoratorService decoratorService = getService(DecoratorService.class);
- Decorator<Category> categoryDecorator = decoratorService.getDecorator(getLocale(), Category.class, null);
-
String resultLabel = configuration.getResultLabel();
Reader reader = getInputFileReader(inputFile);
@@ -552,13 +473,10 @@
EchoBaseImport<EsduResultBySpeciesAndAgeCategoryImportRow> importer =
EchoBaseImport.newImport(csvModel, reader);
- int rowNumber = 0;
-
configuration.incrementsProgression();
for (EsduResultBySpeciesAndAgeCategoryImportRow row : importer) {
configuration.incrementsProgression();
- rowNumber++;
Cell cell = row.getCell();
@@ -591,27 +509,7 @@
ageCategory,
importResult);
- if (rowNumber % 100 == 0) {
- if (log.isInfoEnabled()) {
- log.info("Treat row " + rowNumber + " for esdu cell " +
- cell.getName() + " and category " +
- categoryDecorator.toString(category));
- }
- }
-
- List<Result> results = row.getResult();
-
- TopiaDAO<Result> dao = getDAO(Result.class);
-
- for (Result result : results) {
-
- result.setCategory(category);
- result.setResultLabel(resultLabel);
-
- Result resultCreated = create(dao, result);
- cell.addResult(resultCreated);
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.Result);
- }
+ addResults(row, cell, category, resultLabel, dao, importResult);
}
return importResult;
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java 2012-03-29 21:57:23 UTC (rev 457)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java 2012-03-29 22:54:10 UTC (rev 458)
@@ -80,8 +80,9 @@
}
@Override
- public List<CsvFileImportResult> startImport(ResultsImportConfiguration configuration,
- EchoBaseUser user) throws ImportException {
+ public List<CsvFileImportResult> startImport(
+ ResultsImportConfiguration configuration,
+ EchoBaseUser user) throws ImportException {
// get selected voyage
Voyage voyage = getEntityById(Voyage.class,
@@ -97,9 +98,10 @@
return result;
}
- protected CsvFileImportResult importMapFile(ResultsImportConfiguration configuration,
- InputFile inputFile,
- Voyage voyage) throws ImportException {
+ protected CsvFileImportResult importMapFile(
+ ResultsImportConfiguration configuration,
+ InputFile inputFile,
+ Voyage voyage) throws ImportException {
String resultLabel = configuration.getResultLabel();
@@ -245,8 +247,6 @@
importResult
);
- List<Result> results = row.getResult();
-
Category category = getResultCategory(categoryDAO,
speciesCategoryDAO,
null,
@@ -255,15 +255,7 @@
row.getAgeCategory(),
importResult);
- for (Result result : results) {
-
- result.setCategory(category);
- result.setResultLabel(resultLabel);
-
- Result resultCreated = create(resultDao, result);
- cell.addResult(resultCreated);
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.Result);
- }
+ addResults(row, cell, category, resultLabel, resultDao, importResult);
}
return importResult;
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java 2012-03-29 21:57:23 UTC (rev 457)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java 2012-03-29 22:54:10 UTC (rev 458)
@@ -84,8 +84,9 @@
}
@Override
- public List<CsvFileImportResult> startImport(ResultsImportConfiguration configuration,
- EchoBaseUser user) throws ImportException {
+ public List<CsvFileImportResult> startImport(
+ ResultsImportConfiguration configuration,
+ EchoBaseUser user) throws ImportException {
List<CsvFileImportResult> result = Lists.newLinkedList();
@@ -117,9 +118,10 @@
return result;
}
- protected CsvFileImportResult importRegionFile(ResultsImportConfiguration configuration,
- InputFile inputFile,
- Voyage voyage) throws ImportException {
+ protected CsvFileImportResult importRegionFile(
+ ResultsImportConfiguration configuration,
+ InputFile inputFile,
+ Voyage voyage) throws ImportException {
CellType cellSurfaceType = getEntityByProperty(
CellType.class, CellType.PROPERTY_ID, "RegionSURF");
@@ -181,8 +183,6 @@
Cell.PROPERTY_CELL_TYPE, row.getCellType(),
Cell.PROPERTY_NAME, row.getName()
);
-// cell.setName(row.getName());
-// cell.setCellType(row.getCellType());
voyage.addPostCell(cell);
importResult.incrementsNumberCreated(EchoBaseEntityEnum.Cell);
@@ -244,26 +244,14 @@
EchoBaseImport<RegionCellAssociationImportRow> importer =
EchoBaseImport.newImport(csvModel, reader);
- int rowNumber = 0;
-
configuration.incrementsProgression();
for (RegionCellAssociationImportRow row : importer) {
- rowNumber++;
configuration.incrementsProgression();
Cell regionCell = row.getRegionCell();
Cell esduCell = row.getEsduCell();
regionCell.addChilds(esduCell);
-
- if (rowNumber % 100 == 0) {
- if (log.isInfoEnabled()) {
- log.info("Treat row " + rowNumber + " for esdu cell " +
- esduCell.getName());
- }
- }
-
-
importResult.incrementsNumberUpdated(EchoBaseEntityEnum.Cell);
}
@@ -356,19 +344,7 @@
null,
importResult);
- List<Result> results = row.getResult();
-
- for (Result result : results) {
-
- result.setCategory(category);
- result.setResultLabel(resultLabel);
-
- Result resultCreated = create(dao, result);
-
- cell.addResult(resultCreated);
-
- importResult.incrementsNumberCreated(EchoBaseEntityEnum.Result);
- }
+ addResults(row, cell, category, resultLabel, dao, importResult);
}
return importResult;
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportModel.java 2012-03-29 21:57:23 UTC (rev 457)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportModel.java 2012-03-29 22:54:10 UTC (rev 458)
@@ -25,7 +25,7 @@
import fr.ifremer.echobase.csv.AbstractImportModel;
import fr.ifremer.echobase.csv.EchobaseCsvUtil;
-import fr.ifremer.echobase.entities.data.CellDAO;
+import fr.ifremer.echobase.entities.data.Cell;
import fr.ifremer.echobase.entities.data.Echotype;
import fr.ifremer.echobase.entities.data.Result;
import fr.ifremer.echobase.entities.data.Voyage;
@@ -57,14 +57,14 @@
Map<String, Species> speciesMap,
Map<String, SizeCategory> sizeCategoryMap,
Voyage voyage,
- CellDAO cellDAO,
+ Map<String, Cell> esduCellMap,
List<DataMetadata> dataMetadatas) {
super(separator);
newForeignKeyColumn(EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_ECHOTYPE, Echotype.class, Echotype.PROPERTY_NAME, echotypeMap);
newForeignKeyColumn("baracoudaCode", EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap);
newForeignKeyColumn(EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_SIZE_CATEGORY, SizeCategory.class, SizeCategory.PROPERTY_NAME, sizeCategoryMap);
- newMandatoryColumn("name", EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, cellDAO));
+ newMandatoryColumn("name", EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, esduCellMap));
for (DataMetadata metadata : dataMetadatas) {
String name = metadata.getName();
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportModel.java 2012-03-29 21:57:23 UTC (rev 457)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportModel.java 2012-03-29 22:54:10 UTC (rev 458)
@@ -25,7 +25,7 @@
import fr.ifremer.echobase.csv.AbstractImportModel;
import fr.ifremer.echobase.csv.EchobaseCsvUtil;
-import fr.ifremer.echobase.entities.data.CellDAO;
+import fr.ifremer.echobase.entities.data.Cell;
import fr.ifremer.echobase.entities.data.Echotype;
import fr.ifremer.echobase.entities.data.Result;
import fr.ifremer.echobase.entities.data.Voyage;
@@ -51,12 +51,12 @@
char separator,
Map<String, Echotype> echotypeMap,
Voyage voyage,
- CellDAO cellDAO,
+ Map<String, Cell> esduCellMap,
List<DataMetadata> dataMetadatas) {
super(separator);
newForeignKeyColumn(EsduResultByEchotypeImportRow.PROPERTY_ECHOTYPE, Echotype.class, Echotype.PROPERTY_NAME, echotypeMap);
- newMandatoryColumn("name", EsduResultByEchotypeImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, cellDAO));
+ newMandatoryColumn("name", EsduResultByEchotypeImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, esduCellMap));
for (DataMetadata metadata : dataMetadatas) {
String name = metadata.getName();
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportModel.java 2012-03-29 21:57:23 UTC (rev 457)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportModel.java 2012-03-29 22:54:10 UTC (rev 458)
@@ -25,7 +25,7 @@
import fr.ifremer.echobase.csv.AbstractImportModel;
import fr.ifremer.echobase.csv.EchobaseCsvUtil;
-import fr.ifremer.echobase.entities.data.CellDAO;
+import fr.ifremer.echobase.entities.data.Cell;
import fr.ifremer.echobase.entities.data.Result;
import fr.ifremer.echobase.entities.data.Voyage;
import fr.ifremer.echobase.entities.references.DataMetadata;
@@ -53,11 +53,11 @@
char separator,
Map<String, Species> speciesMap,
Voyage voyage,
- CellDAO cellDAO,
+ Map<String, Cell> esduCellMap,
List<DataMetadata> dataMetadatas) {
super(separator);
- newMandatoryColumn("name", EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, cellDAO));
+ newMandatoryColumn("name", EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, esduCellMap));
newMandatoryColumn(EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_AGE_CATEGORY);
newMandatoryColumn(EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_AGE_CATEGORY_MEANING);
newForeignKeyColumn("baracoudaCode", EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap);
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportModel.java 2012-03-29 21:57:23 UTC (rev 457)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportModel.java 2012-03-29 22:54:10 UTC (rev 458)
@@ -25,7 +25,7 @@
import fr.ifremer.echobase.csv.AbstractImportModel;
import fr.ifremer.echobase.csv.EchobaseCsvUtil;
-import fr.ifremer.echobase.entities.data.CellDAO;
+import fr.ifremer.echobase.entities.data.Cell;
import fr.ifremer.echobase.entities.data.Result;
import fr.ifremer.echobase.entities.data.Voyage;
import fr.ifremer.echobase.entities.references.DataMetadata;
@@ -53,11 +53,11 @@
char separator,
Map<String, Species> speciesMap,
Voyage voyage,
- CellDAO cellDAO,
+ Map<String, Cell> esduCellMap,
List<DataMetadata> dataMetadatas) {
super(separator);
- newMandatoryColumn("name", EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, cellDAO));
+ newMandatoryColumn("name", EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, esduCellMap));
newMandatoryColumn(EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SIZE_CATEGORY);
newMandatoryColumn(EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SIZE_CATEGORY_MEANING);
newForeignKeyColumn("baracoudaCode", EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap);
Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EchoBaseTestServiceSupport.java
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EchoBaseTestServiceSupport.java 2012-03-29 21:57:23 UTC (rev 457)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EchoBaseTestServiceSupport.java 2012-03-29 22:54:10 UTC (rev 458)
@@ -29,6 +29,7 @@
import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
import fr.ifremer.echobase.entities.EchoBaseUser;
import fr.ifremer.echobase.entities.EchoBaseUserImpl;
+import fr.ifremer.echobase.entities.data.DataProcessing;
import fr.ifremer.echobase.entities.data.Voyage;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
@@ -208,4 +209,10 @@
Preconditions.checkNotNull(voyage);
return voyage.getTopiaId();
}
+
+ protected String getDataProcessingId() {
+ DataProcessing dataProcessing = getEntities(DataProcessing.class).get(0);
+ Preconditions.checkNotNull(dataProcessing);
+ return dataProcessing.getTopiaId();
+ }
}
Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java 2012-03-29 21:57:23 UTC (rev 457)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java 2012-03-29 22:54:10 UTC (rev 458)
@@ -201,11 +201,13 @@
int numberCreated = importResult.getNumberCreated(type);
int numberUpdated = importResult.getNumberUpdated(type);
if (numberCreated > 0) {
- resultBuffer.append(" ").append(numberCreated).append(" created");
+ resultBuffer.append(" (created ").append(numberCreated).append(')');
}
if (numberUpdated > 0) {
- resultBuffer.append(" ").append(numberUpdated).append(" updated");
+ resultBuffer.append(" (updated").append(numberUpdated).append(')');
}
+ long nbEntities = countEntities(type.getContract());
+ resultBuffer.append(" (total count ").append(nbEntities).append(')');
}
log.info(resultBuffer.toString());
}
Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportServiceIT.java
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportServiceIT.java 2012-03-29 21:57:23 UTC (rev 457)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportServiceIT.java 2012-03-29 22:54:10 UTC (rev 458)
@@ -74,6 +74,8 @@
addMissingEsduCells("name", conf.getVoyageId(), inputFile);
+ conf.setDataProcessingId(getDataProcessingId());
+
List<CsvFileImportResult> result;
result = doImport(conf, ResultsEsduCellImportService.class, 1);
@@ -104,10 +106,14 @@
addMissingEsduCells("name", conf.getVoyageId(), inputFile);
+ conf.setDataProcessingId(getDataProcessingId());
+
List<CsvFileImportResult> result;
result = doImport(conf, ResultsEsduCellImportService.class, 1);
- assertCsvImportResult(result, 0, Result.class, 396990);
+ assertCsvImportResult(result, 0, Result.class, 357291);
+ assertCsvImportResult(result, 0, Category.class, 27);
+ assertCsvImportResult(result, 0, SpeciesCategory.class, 1, 0, 457);
}
@Test
@@ -133,13 +139,15 @@
addMissingEsduCells("name", conf.getVoyageId(), intputFile);
+ conf.setDataProcessingId(getDataProcessingId());
+
List<CsvFileImportResult> result;
result = doImport(conf, ResultsEsduCellImportService.class, 1);
assertCsvImportResult(result, 0, Result.class, 68108);
assertCsvImportResult(result, 0, Category.class, 129);
assertCsvImportResult(result, 0, SpeciesCategory.class, 129, 0, 585);
- assertCsvImportResult(result, 0, SizeCategory.class, 62);
+ assertCsvImportResult(result, 0, SizeCategory.class, 62, 0, 69);
}
@Test
@@ -165,14 +173,15 @@
addMissingEsduCells("name", conf.getVoyageId(), inputFile);
+ conf.setDataProcessingId(getDataProcessingId());
+
List<CsvFileImportResult> result;
result = doImport(conf, ResultsEsduCellImportService.class, 1);
+ assertCsvImportResult(result, 0, Category.class, 14);
assertCsvImportResult(result, 0, Result.class, 10021);
- assertCsvImportResult(result, 0, AgeCategory.class, 6);
- assertCsvImportResult(result, 0, Category.class, 14);
+ assertCsvImportResult(result, 0, AgeCategory.class, 6, 0, 10);
assertCsvImportResult(result, 0, SpeciesCategory.class, 14, 0, 470);
}
-
}
\ No newline at end of file
1
0
Author: tchemit
Date: 2012-03-29 23:57:23 +0200 (Thu, 29 Mar 2012)
New Revision: 457
Url: http://forge.codelutin.com/repositories/revision/echobase/457
Log:
CR r?\195?\169union (refs #483)
Modified:
trunk/src/doc/reunions/reunion-2012-03-29.txt
Modified: trunk/src/doc/reunions/reunion-2012-03-29.txt
===================================================================
--- trunk/src/doc/reunions/reunion-2012-03-29.txt 2012-03-29 21:46:19 UTC (rev 456)
+++ trunk/src/doc/reunions/reunion-2012-03-29.txt 2012-03-29 21:57:23 UTC (rev 457)
@@ -5,13 +5,6 @@
Présents : Mathieu et Tony
-Planning
---------
-
-- valider tous les imports
-- lancer la phase de tests
-- discuter des contraintes en base
-
Référentiels
------------
@@ -20,89 +13,60 @@
CellType RegionCLAS
CellType RegionSURF
DataMetadata RegionEnvCoordinates
-
DataMetadata BiomMass dupliqué
+Il reste des référentiels à améliorer mais on fera ça plus tard (pas nécessaire
+pour valider les imports).
+
Imports
-------
-Import résultats de regions (utilisation de NASCVariance au lieu de VarianceNASC)
+- Ajouter un champs notes pour chaque import et l'utiliser dans le journal des modifications (#1054)
+- Ajouter une colonne dataQuality dans tous les imports de Data et Result (#1055)
+- Selectionner un dataProcessing pour les imports de résultats Esdu (#1059)
+- Avoir un seul import Résultat ESDU (#1060)
+- Utilisation de ageCategory dans les imports de cell Maps (#1061)
-On a pas utiliser les dataProcessing.id ?
-
-J'ai renommé les colonne des datas dans Map (minuscule sur première lettre)
-et ageCategory ? oubli ou pas a utiliser (map import)
-
Création base embarquée
-----------------------
-Optimiser la gestion mémoire car y'a des soucis (import des associations) :
+- On arrive pas à créer une base embarquée (#1050)
-Struts has detected an unhandled exception:
-Messages:
-Could not initialize class org.h2.message.DbException
-File: org/h2/command/Command.java
-Line number: 230
-Stacktraces
-java.lang.reflect.InvocationTargetException
- sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
- sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
- java.lang.reflect.Method.invoke(Method.java:597)
- com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
- com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
- org.apache.struts2.interceptor.BackgroundProcess$1.run(BackgroundProcess.java:57)
- java.lang.Thread.run(Thread.java:662)
-
-java.lang.NoClassDefFoundError: Could not initialize class org.h2.message.DbException
- org.h2.command.Command.executeUpdate(Command.java:230)
- org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:181)
- org.nuiton.topia.framework.TopiaContextImpl$SQLWork.execute(TopiaContextImpl.java:1597)
- org.hibernate.impl.SessionImpl.doWork(SessionImpl.java:1997)
- org.nuiton.topia.framework.TopiaContextImpl.executeSQL(TopiaContextImpl.java:952)
- fr.ifremer.echobase.services.ImportDbService.importAssociationfile(ImportDbService.java:316)
- fr.ifremer.echobase.services.ImportDbService.importFile(ImportDbService.java:216)
- fr.ifremer.echobase.services.ImportDbService.importDb(ImportDbService.java:125)
- fr.ifremer.echobase.services.EmbeddedApplicationService.importDb(EmbeddedApplicationService.java:322)
- fr.ifremer.echobase.services.EmbeddedApplicationService.createEmbeddedApplication(EmbeddedApplicationService.java:117)
- fr.ifremer.echobase.ui.actions.embeddedApplication.Build.startAction(Build.java:66)
- fr.ifremer.echobase.ui.actions.embeddedApplication.Build.startAction(Build.java:38)
- fr.ifremer.echobase.ui.actions.AbstractWaitAndExecAction.execute(AbstractWaitAndExecAction.java:91)
- sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
- sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
- java.lang.reflect.Method.invoke(Method.java:597)
- com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
- com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
- org.apache.struts2.interceptor.BackgroundProcess$1.run(BackgroundProcess.java:57)
- java.lang.Thread.run(Thread.java:662)
-
Suppression des résultats
-------------------------
-Chiffrer la fonctionnalité
+- Chiffrer la fonctionnalité
Modèle
------
-- Ajout des clef naturels
-- Ajout des contrainte de non nullité
+- Ajout des clef naturels (fait en 0.3)
+- Ajout des contrainte de non nullité (fait en 0.3)
Divers
------
-- i18n
-- finir le style
-- dbeditor (revoir la fenêtre de filtre)
-- doc
+- intégrer les traductiosn anglaises (#1046)
+- finir le style graphique (#1047)
+- dbeditor (revoir la fenêtre de filtre) (#1052)
+- ajouter un filtre sur le journal des modifications (#1053)
+- doc (#484)
Action
------
- Tony :
+- faire les tickets de la 0.4
+- fournir une base h2 ou un zip de données d'une campagne PELGAS2010 pour faire des tests le temps que je corrige
+- faire release 0.5 rapide avec tous les modification d'import
+- mettre en place un module svn pour mettre les scripts R (#1062)
+- phase de test (#499)
- Mathieu :
+- phase de test (#499)
+- fournir les scripts de création des fichiers (#1062)
+- préparer le requétage à faire
Prochaine réunion :
- - ?
\ No newline at end of file
+ - Vendredi 6 Avril à 10h00
\ No newline at end of file
1
0
29 Mar '12
Author: tchemit
Date: 2012-03-29 23:46:19 +0200 (Thu, 29 Mar 2012)
New Revision: 456
Url: http://forge.codelutin.com/repositories/revision/echobase/456
Log:
i18n
Modified:
trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
===================================================================
--- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-03-29 21:45:42 UTC (rev 455)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-03-29 21:46:19 UTC (rev 456)
@@ -89,6 +89,7 @@
echobase.error.import.areaOfOperation.required=La sélection d'une zone d'opération est obligatoire
echobase.error.import.biometrySampleFile.required=La sélection d'un fichier BiometrySample est obligatoire
echobase.error.import.cellPositionReference.required=La sélection d'un cellPositionReference est obligatoire
+echobase.error.import.dataProcessing.required=Data Processing non renseigné
echobase.error.import.datum.required=Datum de la campagne non rengeigné
echobase.error.import.digitThreshold.required=digitThreshold non renseigné
echobase.error.import.echosounderSoundSpeed.required=echosounderSoundSpeed non renseigné
1
0
r455 - in trunk/echobase-services/src: main/java/fr/ifremer/echobase/services/importdata main/java/fr/ifremer/echobase/services/importdata/csv test/resources/import-data/result/map
by tchemit@users.forge.codelutin.com 29 Mar '12
by tchemit@users.forge.codelutin.com 29 Mar '12
29 Mar '12
Author: tchemit
Date: 2012-03-29 23:45:42 +0200 (Thu, 29 Mar 2012)
New Revision: 455
Url: http://forge.codelutin.com/repositories/revision/echobase/455
Log:
fixes #1061: Utilisation de ageCategory dans les imports de cell Maps
Modified:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportRow.java
trunk/echobase-services/src/test/resources/import-data/result/map/maps.csv.gz
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java 2012-03-29 21:44:59 UTC (rev 454)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java 2012-03-29 21:45:42 UTC (rev 455)
@@ -41,6 +41,7 @@
import fr.ifremer.echobase.entities.data.Result;
import fr.ifremer.echobase.entities.data.ResultDAO;
import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.AgeCategory;
import fr.ifremer.echobase.entities.references.CellType;
import fr.ifremer.echobase.entities.references.DataMetadata;
import fr.ifremer.echobase.entities.references.SizeCategory;
@@ -141,6 +142,10 @@
sizeCategoryMap.putAll(getEntitiesMap(
SizeCategory.class, EchoBaseFunctions.SIZE_CATEGORY_NAME));
+ Map<String, AgeCategory> ageCategoryMap = Maps.newTreeMap();
+ ageCategoryMap.putAll(getEntitiesMap(
+ AgeCategory.class, EchoBaseFunctions.AGE_CATEGORY_NAME));
+
Map<String, DataMetadata> dataMetadataMap = getEntitiesMap(
DataMetadata.class, EchoBaseFunctions.DATA_METADATA_NAME);
@@ -159,6 +164,7 @@
voyageMap,
speciesMap,
sizeCategoryMap,
+ ageCategoryMap,
metas);
if (log.isInfoEnabled()) {
@@ -246,7 +252,7 @@
null,
row.getSpecies(),
row.getSizeCategory(),
- null,
+ row.getAgeCategory(),
importResult);
for (Result result : results) {
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportModel.java 2012-03-29 21:44:59 UTC (rev 454)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportModel.java 2012-03-29 21:45:42 UTC (rev 455)
@@ -26,6 +26,7 @@
import fr.ifremer.echobase.csv.AbstractImportModel;
import fr.ifremer.echobase.csv.EchobaseCsvUtil;
import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.AgeCategory;
import fr.ifremer.echobase.entities.references.CellType;
import fr.ifremer.echobase.entities.references.DataMetadata;
import fr.ifremer.echobase.entities.references.SizeCategory;
@@ -52,7 +53,8 @@
MapCellImportRow.PROPERTY_DATA_GRID_LATITUDE_LAG,
MapCellImportRow.PROPERTY_DATA_GRID_DEPTH_LAG,
MapCellImportRow.PROPERTY_VOYAGE,
- MapCellImportRow.PROPERTY_SIZE_CATEGORY
+ MapCellImportRow.PROPERTY_SIZE_CATEGORY,
+ MapCellImportRow.PROPERTY_AGE_CATEGORY
};
protected final CellType cellType;
@@ -62,6 +64,7 @@
Map<String, Voyage> voyageMap,
Map<String, Species> speciesMap,
Map<String, SizeCategory> sizeCategoryMap,
+ Map<String, AgeCategory> ageCategoryMap,
List<DataMetadata> dataMetadatas) {
super(separator);
this.cellType = cellType;
@@ -70,6 +73,7 @@
newMandatoryColumn(MapCellImportRow.PROPERTY_NAME);
newForeignKeyColumn("baracoudaCode", MapCellImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap);
newForeignKeyColumn(MapCellImportRow.PROPERTY_SIZE_CATEGORY, SizeCategory.class, SizeCategory.PROPERTY_NAME, sizeCategoryMap);
+ newForeignKeyColumn(MapCellImportRow.PROPERTY_AGE_CATEGORY, AgeCategory.class, SizeCategory.PROPERTY_NAME, ageCategoryMap);
newMandatoryColumn(MapCellImportRow.PROPERTY_DATA_GRID_CELL_LONGITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);
newMandatoryColumn(MapCellImportRow.PROPERTY_DATA_GRID_CELL_LATITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportRow.java 2012-03-29 21:44:59 UTC (rev 454)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportRow.java 2012-03-29 21:45:42 UTC (rev 455)
@@ -29,6 +29,7 @@
import fr.ifremer.echobase.entities.data.CellImpl;
import fr.ifremer.echobase.entities.data.Result;
import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.AgeCategory;
import fr.ifremer.echobase.entities.references.CellType;
import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.Species;
@@ -53,6 +54,8 @@
public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory";
+ public static final String PROPERTY_AGE_CATEGORY = "ageCategory";
+
public static final String PROPERTY_DATA_GRID_CELL_LONGITUDE = "gridCellLongitude";
public static final String PROPERTY_DATA_GRID_CELL_LATITUDE = "gridCellLatitude";
@@ -75,6 +78,8 @@
protected SizeCategory sizeCategory;
+ protected AgeCategory ageCategory;
+
protected float gridCellLongitude;
protected float gridCellLatitude;
@@ -108,6 +113,10 @@
return sizeCategory;
}
+ public AgeCategory getAgeCategory() {
+ return ageCategory;
+ }
+
public List<Result> getResult() {
return result;
}
@@ -152,6 +161,10 @@
this.sizeCategory = sizeCategory;
}
+ public void setAgeCategory(AgeCategory ageCategory) {
+ this.ageCategory = ageCategory;
+ }
+
public void setGridCellLongitude(float GridCellLongitude) {
this.gridCellLongitude = GridCellLongitude;
}
Modified: trunk/echobase-services/src/test/resources/import-data/result/map/maps.csv.gz
===================================================================
(Binary files differ)
1
0
r454 - in trunk: echobase-entities/src/main/java/fr/ifremer/echobase/csv echobase-services/src/main/java/fr/ifremer/echobase/services/importdata echobase-services/src/test/java/fr/ifremer/echobase/services/importdata
by tchemit@users.forge.codelutin.com 29 Mar '12
by tchemit@users.forge.codelutin.com 29 Mar '12
29 Mar '12
Author: tchemit
Date: 2012-03-29 23:44:59 +0200 (Thu, 29 Mar 2012)
New Revision: 454
Url: http://forge.codelutin.com/repositories/revision/echobase/454
Log:
compute stesp in import action from number of files lines
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/CsvFileImportResult.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/CsvFileImportResult.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/CsvFileImportResult.java 2012-03-29 21:25:22 UTC (rev 453)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/CsvFileImportResult.java 2012-03-29 21:44:59 UTC (rev 454)
@@ -72,6 +72,10 @@
return getInteger(numberUpdated, entityType);
}
+ public String getImportFileName() {
+ return importFileName;
+ }
+
public void incrementsNumberCreated(EchoBaseEntityEnum entityType) {
increments(numberCreated, entityType);
}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java 2012-03-29 21:25:22 UTC (rev 453)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java 2012-03-29 21:44:59 UTC (rev 454)
@@ -48,9 +48,12 @@
import fr.ifremer.echobase.entities.references.SpeciesCategoryDAO;
import fr.ifremer.echobase.services.EchoBaseServiceSupport;
import fr.ifremer.echobase.services.ImportException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.persistence.TopiaDAO;
import org.nuiton.topia.persistence.TopiaEntity;
+import org.nuiton.util.TimeLog;
import org.nuiton.util.csv.ImportRuntimeException;
import java.io.BufferedReader;
@@ -79,10 +82,27 @@
public static final Pattern REMOVE_DOUBLE_QUOTES_PATTERN =
Pattern.compile("\"(.+)\"");
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(AbstractImportDataService.class);
+
+ public static final TimeLog TIME_LOG =
+ new TimeLog(AbstractImportDataService.class);
+
+
public final List<CsvFileImportResult> doImport(M configuration,
EchoBaseUser user) throws ImportException {
+ long s0 = TimeLog.getTime();
+ long nbSteps = configuration.computeNbSteps();
+
+ if (log.isInfoEnabled()) {
+ log.info("Nb lines to import " + nbSteps);
+ }
+
+ TIME_LOG.log(s0, "computeNbSteps");
+
try {
List<CsvFileImportResult> result = startImport(configuration, user);
Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java 2012-03-29 21:25:22 UTC (rev 453)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java 2012-03-29 21:44:59 UTC (rev 454)
@@ -176,22 +176,12 @@
protected <M extends AbstractImportConfiguration, S extends AbstractImportDataService<M>>
List<CsvFileImportResult> doImport(M conf, Class<S> serviceType, int nbResults) throws ImportException {
- long s0 = TimeLog.getTime();
-
- long nbSteps = conf.computeNbSteps();
-
- if (log.isInfoEnabled()) {
- log.info("Nb lines to import " + nbSteps);
- }
-
- TIME_LOG.log(s0, "prepareConfigurationSteps");
-
- s0 = TimeLog.getTime();
-
S service = getService(serviceType);
EchoBaseUser fakeUser = createFakeUser();
+ long s0 = TimeLog.getTime();
+
List<CsvFileImportResult> result = service.doImport(conf, fakeUser);
TIME_LOG.log(s0, "doImport");
@@ -200,6 +190,27 @@
Assert.assertEquals(nbResults, result.size());
assertConfProgressionToEnd(conf);
+ if (log.isInfoEnabled()) {
+ int index = 0;
+ for (CsvFileImportResult importResult : result) {
+
+ StringBuilder resultBuffer =
+ new StringBuilder("Result " + (index++) + " for " + importResult.getImportFileName());
+ for (EchoBaseEntityEnum type : importResult.getEntityTypes()) {
+ resultBuffer.append("\n").append(type.name());
+ int numberCreated = importResult.getNumberCreated(type);
+ int numberUpdated = importResult.getNumberUpdated(type);
+ if (numberCreated > 0) {
+ resultBuffer.append(" ").append(numberCreated).append(" created");
+ }
+ if (numberUpdated > 0) {
+ resultBuffer.append(" ").append(numberUpdated).append(" updated");
+ }
+ }
+ log.info(resultBuffer.toString());
+ }
+ }
+
return result;
}
1
0