This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository echobase. See https://gitlab.nuiton.org/codelutin/echobase.git commit 6b64d24a5b8b50493db1957aac6d90b6e789b292 Author: Julien Ruchaud <julien.ruchaud@debux.org> Date: Thu Oct 20 18:29:51 2016 +0200 #8173 Add vocabulary table --- .../echobase/persistence/EchoBaseDbMeta.java | 4 +- echobase-domain/src/main/xmi/echobase.zargo | Bin 100263 -> 100253 bytes .../services/service/UserDbPersistenceService.java | 22 +- .../service/atlantos/ExportAtlantosService.java | 245 +------------------- .../service/atlantos/model/BiologyExportModel.java | 66 ------ .../atlantos/model/CalibrationExportModel.java | 83 ------- .../service/atlantos/model/CatchExportModel.java | 66 ------ .../service/atlantos/model/CruiseExportModel.java | 56 ----- .../atlantos/model/DataAcquisitionExportModel.java | 74 ------ .../service/atlantos/model/DataExportModel.java | 126 ----------- .../atlantos/model/DataProcessingExportModel.java | 92 -------- .../service/atlantos/model/HaulExportModel.java | 87 ------- .../atlantos/model/InstrumentExportModel.java | 89 -------- .../service/atlantos/row/BiologyExportRow.java | 141 ------------ .../service/atlantos/row/CalibrationExportRow.java | 84 ------- .../service/atlantos/row/CatchExportRow.java | 144 ------------ .../service/atlantos/row/CruiseExportRow.java | 85 ------- .../atlantos/row/DataAcquisitionExportRow.java | 79 ------- .../service/atlantos/row/DataExportRow.java | 223 ------------------ .../atlantos/row/DataProcessingExportRow.java | 139 ------------ .../service/atlantos/row/HaulExportRow.java | 251 --------------------- .../service/atlantos/row/InstrumentExportRow.java | 134 ----------- .../service/atlantos/xml/VocabularyExport.java | 61 +++++ .../service/atlantos/xml/XmlAccousticExport.java | 61 ++--- .../service/atlantos/xml/XmlBioticExport.java | 5 +- .../atlantos/ExportAtlantosServiceTest.java | 33 --- 26 files changed, 105 insertions(+), 2345 deletions(-) diff --git a/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBaseDbMeta.java b/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBaseDbMeta.java index 241d6d5..0a7c479 100644 --- a/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBaseDbMeta.java +++ b/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBaseDbMeta.java @@ -87,7 +87,9 @@ public class EchoBaseDbMeta extends DbMeta<EchoBaseUserEntityEnum> { EchoBaseUserEntityEnum.DataMetadata, EchoBaseUserEntityEnum.CategoryRef, EchoBaseUserEntityEnum.Impacte, - EchoBaseUserEntityEnum.DataProtocol)); + EchoBaseUserEntityEnum.DataProtocol, + + EchoBaseUserEntityEnum.VocabularyCIEM)); private static final List<EchoBaseUserEntityEnum> DATA_TYPES = ImmutableList.copyOf(Arrays.asList( EchoBaseUserEntityEnum.SampleData, diff --git a/echobase-domain/src/main/xmi/echobase.zargo b/echobase-domain/src/main/xmi/echobase.zargo index 07304da..fbdca85 100644 Binary files a/echobase-domain/src/main/xmi/echobase.zargo and b/echobase-domain/src/main/xmi/echobase.zargo differ diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java index 1845e15..76ba176 100644 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java @@ -46,7 +46,6 @@ import fr.ifremer.echobase.entities.data.Category; import fr.ifremer.echobase.entities.data.Cell; import fr.ifremer.echobase.entities.data.CellTopiaDao; import fr.ifremer.echobase.entities.data.Data; -import fr.ifremer.echobase.entities.data.DataAcousticProvider; import fr.ifremer.echobase.entities.data.DataAcquisition; import fr.ifremer.echobase.entities.data.DataProcessing; import fr.ifremer.echobase.entities.data.Echotype; @@ -85,6 +84,8 @@ import fr.ifremer.echobase.entities.references.Species; import fr.ifremer.echobase.entities.references.Species2; import fr.ifremer.echobase.entities.references.SpeciesCategory; import fr.ifremer.echobase.entities.references.Vessel; +import fr.ifremer.echobase.entities.references.VocabularyCIEM; +import fr.ifremer.echobase.entities.references.VocabularyCIEMTopiaDao; import fr.ifremer.echobase.io.InputFile; import fr.ifremer.echobase.services.EchoBaseServiceSupport; import fr.ifremer.echobase.services.csv.CellValueFormatter; @@ -116,6 +117,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; import java.util.Date; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -1103,6 +1105,24 @@ public class UserDbPersistenceService extends EchoBaseServiceSupport { } //------------------------------------------------------------------------// + //--- Vocabulary ---------------------------------------------------------// + //------------------------------------------------------------------------// + + public Map<String, String> getVocabulary() { + VocabularyCIEMTopiaDao vocabularyDao = persistenceContext.getVocabularyCIEMDao(); + List<VocabularyCIEM> all = vocabularyDao.findAll(); + + Map<String, String> result = new HashMap<String, String>(); + for (VocabularyCIEM voca : all) { + String key = voca.getLabel(); + String value = voca.getCode(); + result.put(key, value); + } + + return result; + } + + //------------------------------------------------------------------------// //--- Vessel -------------------------------------------------------------// //------------------------------------------------------------------------// diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/ExportAtlantosService.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/ExportAtlantosService.java index 8b3b7b4..b00269a 100644 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/ExportAtlantosService.java +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/ExportAtlantosService.java @@ -22,51 +22,22 @@ package fr.ifremer.echobase.services.service.atlantos; */ import com.google.common.base.Preconditions; -import fr.ifremer.echobase.EchoBaseTechnicalException; import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.DataMetadata; -import fr.ifremer.echobase.entities.references.DataMetadatas; -import fr.ifremer.echobase.io.EchoBaseIOUtil; import fr.ifremer.echobase.services.EchoBaseServiceSupport; import fr.ifremer.echobase.services.service.UserDbPersistenceService; -import fr.ifremer.echobase.services.service.atlantos.model.BiologyExportModel; -import fr.ifremer.echobase.services.service.atlantos.model.CalibrationExportModel; -import fr.ifremer.echobase.services.service.atlantos.model.CatchExportModel; -import fr.ifremer.echobase.services.service.atlantos.model.CruiseExportModel; -import fr.ifremer.echobase.services.service.atlantos.model.DataAcquisitionExportModel; -import fr.ifremer.echobase.services.service.atlantos.model.DataExportModel; -import fr.ifremer.echobase.services.service.atlantos.model.DataProcessingExportModel; -import fr.ifremer.echobase.services.service.atlantos.model.HaulExportModel; -import fr.ifremer.echobase.services.service.atlantos.model.InstrumentExportModel; -import fr.ifremer.echobase.services.service.atlantos.row.BiologyExportRow; -import fr.ifremer.echobase.services.service.atlantos.row.CalibrationExportRow; -import fr.ifremer.echobase.services.service.atlantos.row.CatchExportRow; -import fr.ifremer.echobase.services.service.atlantos.row.CruiseExportRow; -import fr.ifremer.echobase.services.service.atlantos.row.DataAcquisitionExportRow; -import fr.ifremer.echobase.services.service.atlantos.row.DataExportRow; -import fr.ifremer.echobase.services.service.atlantos.row.DataProcessingExportRow; -import fr.ifremer.echobase.services.service.atlantos.row.HaulExportRow; -import fr.ifremer.echobase.services.service.atlantos.row.InstrumentExportRow; import fr.ifremer.echobase.services.service.atlantos.xml.XmlAccousticExport; import fr.ifremer.echobase.services.service.atlantos.xml.XmlBioticExport; import fr.ifremer.echobase.services.service.atlantos.xml.XmlWriter; +import java.io.File; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.nuiton.csv.Export; import javax.inject.Inject; -import java.io.File; import java.io.FileWriter; import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.nio.file.StandardOpenOption; import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.List; -import java.util.Map; /** * @author Julien Ruchaud - ruchaud@codelutin.com @@ -96,7 +67,7 @@ public class ExportAtlantosService extends EchoBaseServiceSupport { Voyage voyage = persistenceService.getVoyage(model.getVoyageId()); Preconditions.checkNotNull(voyage); - + File tempDirectory = model.getWorkingDirectory(); String basePath = tempDirectory.getAbsolutePath(); @@ -124,217 +95,5 @@ public class ExportAtlantosService extends EchoBaseServiceSupport { model.incrementsProgress(); } - - public void doExport(ExportAtlantosConfiguration model) throws IOException { - - Preconditions.checkNotNull(model); - Preconditions.checkNotNull(model.getVoyageId()); - - int nbSteps = 11; - model.setNbSteps(nbSteps); - - Voyage voyage = persistenceService.getVoyage(model.getVoyageId()); - Preconditions.checkNotNull(voyage); - - File tempDirectory = model.getWorkingDirectory(); - String basePath = tempDirectory.getAbsolutePath(); - - // Export data - exportDatas(tempDirectory, voyage, model); - - // Concat files - String name = voyage.getName(); - - SimpleDateFormat formatter = new SimpleDateFormat("YYYY"); - String year = formatter.format(voyage.getStartDate()); - - List<Path> inputs = Arrays.asList( - Paths.get(basePath, "Cruise.csv"), - Paths.get(basePath, "Haul.csv"), - Paths.get(basePath, "Catch.csv"), - Paths.get(basePath, "Biology.csv") - ); - Path output = Paths.get(basePath, "Biotic_" + year + name + ".csv"); - concatDatas(inputs, output); - model.incrementsProgress(); - - inputs = Arrays.asList( - Paths.get(basePath, "Instrument.csv"), - Paths.get(basePath, "Calibration.csv"), - Paths.get(basePath, "DataAcquisition.csv"), - Paths.get(basePath, "DataProcessing.csv"), - Paths.get(basePath, "Cruise.csv"), - Paths.get(basePath, "Data.csv") - ); - output = Paths.get(basePath, "Acoustic_" + year + name + ".csv"); - concatDatas(inputs, output); - model.incrementsProgress(); - } - - protected void concatDatas(List<Path> inputs, Path output) throws IOException { - // Join files (lines) - for (Path path : inputs) { - List<String> lines = Files.readAllLines(path, StandardCharsets.UTF_8); - Files.write(output, lines, StandardCharsets.UTF_8, StandardOpenOption.CREATE, StandardOpenOption.APPEND); - } - } - - protected void exportDatas(File rawDataDirectory, - Voyage voyage, - ExportAtlantosConfiguration model) throws IOException { - - char csvSeparator = ','; - EchoBaseIOUtil.forceMkdir(rawDataDirectory); - - if (log.isInfoEnabled()) { - log.info("Extract raw data for mission: " + model.getVoyageId() + - " to : " + rawDataDirectory); - } - - { // create cruise file - File file = new File(rawDataDirectory, "Cruise.csv"); - if (log.isInfoEnabled()) { - log.info("generate " + file); - } - - CruiseExportModel exportModel = new CruiseExportModel(csvSeparator); - List<CruiseExportRow> rows = exportModel.prepareRows(voyage); - try { - Export.exportToFile(exportModel, rows, file); - } catch (Exception e) { - throw new EchoBaseTechnicalException("Could not export cruise to " + file, e); - } - model.incrementsProgress(); - } - - { // create haul file - File file = new File(rawDataDirectory, "Haul.csv"); - if (log.isInfoEnabled()) { - log.info("generate " + file); - } - - HaulExportModel exportModel = new HaulExportModel(csvSeparator); - List<HaulExportRow> rows = exportModel.prepareRows(voyage); - try { - Export.exportToFile(exportModel, rows, file); - } catch (Exception e) { - throw new EchoBaseTechnicalException("Could not export cruise to " + file, e); - } - model.incrementsProgress(); - } - - { // create catch file - File file = new File(rawDataDirectory, "Catch.csv"); - if (log.isInfoEnabled()) { - log.info("generate " + file); - } - - CatchExportModel exportModel = new CatchExportModel(csvSeparator); - List<CatchExportRow> rows = exportModel.prepareRows(voyage); - try { - Export.exportToFile(exportModel, rows, file); - } catch (Exception e) { - throw new EchoBaseTechnicalException("Could not export cruise to " + file, e); - } - model.incrementsProgress(); - } - - { // create biology file - File file = new File(rawDataDirectory, "Biology.csv"); - if (log.isInfoEnabled()) { - log.info("generate " + file); - } - - BiologyExportModel exportModel = new BiologyExportModel(csvSeparator); - List<BiologyExportRow> rows = exportModel.prepareRows(voyage); - try { - Export.exportToFile(exportModel, rows, file); - } catch (Exception e) { - throw new EchoBaseTechnicalException("Could not export cruise to " + file, e); - } - model.incrementsProgress(); - } - - { // create instrument file - File file = new File(rawDataDirectory, "Instrument.csv"); - if (log.isInfoEnabled()) { - log.info("generate " + file); - } - - InstrumentExportModel exportModel = new InstrumentExportModel(csvSeparator); - List<InstrumentExportRow> rows = exportModel.prepareRows(voyage); - try { - Export.exportToFile(exportModel, rows, file); - } catch (Exception e) { - throw new EchoBaseTechnicalException("Could not export cruise to " + file, e); - } - model.incrementsProgress(); - } - - { // create calibration file - File file = new File(rawDataDirectory, "Calibration.csv"); - if (log.isInfoEnabled()) { - log.info("generate " + file); - } - - CalibrationExportModel exportModel = new CalibrationExportModel(csvSeparator); - List<CalibrationExportRow> rows = exportModel.prepareRows(voyage); - try { - Export.exportToFile(exportModel, rows, file); - } catch (Exception e) { - throw new EchoBaseTechnicalException("Could not export cruise to " + file, e); - } - model.incrementsProgress(); - } - - { // create data acquisition file - File file = new File(rawDataDirectory, "DataAcquisition.csv"); - if (log.isInfoEnabled()) { - log.info("generate " + file); - } - - DataAcquisitionExportModel exportModel = new DataAcquisitionExportModel(csvSeparator); - List<DataAcquisitionExportRow> rows = exportModel.prepareRows(voyage); - try { - Export.exportToFile(exportModel, rows, file); - } catch (Exception e) { - throw new EchoBaseTechnicalException("Could not export cruise to " + file, e); - } - model.incrementsProgress(); - } - - { // create data processing file - File file = new File(rawDataDirectory, "DataProcessing.csv"); - if (log.isInfoEnabled()) { - log.info("generate " + file); - } - - DataProcessingExportModel exportModel = new DataProcessingExportModel(csvSeparator); - List<DataProcessingExportRow> rows = exportModel.prepareRows(voyage); - try { - Export.exportToFile(exportModel, rows, file); - } catch (Exception e) { - throw new EchoBaseTechnicalException("Could not export cruise to " + file, e); - } - model.incrementsProgress(); - } - - { // create data file - File file = new File(rawDataDirectory, "Data.csv"); - if (log.isInfoEnabled()) { - log.info("generate " + file); - } - - Map<String, DataMetadata> metadatas = persistenceService.getEntitiesMap(DataMetadata.class, DataMetadatas.DATA_METADATA_NAME); - DataExportModel exportModel = new DataExportModel(csvSeparator); - List<DataExportRow> rows = exportModel.prepareRows(voyage, metadatas); - try { - Export.exportToFile(exportModel, rows, file); - } catch (Exception e) { - throw new EchoBaseTechnicalException("Could not export cruise to " + file, e); - } - model.incrementsProgress(); - } - } } diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/BiologyExportModel.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/BiologyExportModel.java deleted file mode 100644 index ebadfb4..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/BiologyExportModel.java +++ /dev/null @@ -1,66 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.model; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.services.service.atlantos.row.BiologyExportRow; -import java.util.Arrays; -import java.util.List; -import org.nuiton.csv.ext.AbstractExportModel; - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class BiologyExportModel extends AbstractExportModel<BiologyExportRow> { - - public BiologyExportModel(char separator) { - super(separator); - newColumnForExport("Biology", BiologyExportRow.PROPERTY_ENTITY); - newColumnForExport("Header", BiologyExportRow.PROPERTY_HEADER); - newColumnForExport("CruiseLocalID", BiologyExportRow.PROPERTY_CRUISE_LOCAL_ID); - newColumnForExport("HaulGear", BiologyExportRow.PROPERTY_HAUL_GEAR); - newColumnForExport("HaulNumber", BiologyExportRow.PROPERTY_HAUL_NUMBER); - newColumnForExport("CatchSpeciesCode", BiologyExportRow.PROPERTY_CATCH_SPECIES_CODE); - newColumnForExport("StockCode", BiologyExportRow.PROPERTY_STOCK_CODE); - newColumnForExport("FishID", BiologyExportRow.PROPERTY_FISH_ID); - newColumnForExport("LengthCode", BiologyExportRow.PROPERTY_LENGTH_CODE); - newColumnForExport("IndividualLength", BiologyExportRow.PROPERTY_INDIVIDUAL_LENGTH); - newColumnForExport("WeightUnit", BiologyExportRow.PROPERTY_WEIGHT_UNIT); - newColumnForExport("IndividualWeight", BiologyExportRow.PROPERTY_INDIVIDUAL_WEIGHT); - newColumnForExport("IndividualSex", BiologyExportRow.PROPERTY_INDIVIDUAL_SEX); - newColumnForExport("IndividualMaturity", BiologyExportRow.PROPERTY_INDIVIDUAL_MATURITY); - newColumnForExport("MaturityScale", BiologyExportRow.PROPERTY_MATURITY_SCALE); - newColumnForExport("IndividualAge", BiologyExportRow.PROPERTY_INDIVIDUAL_AGE); - newColumnForExport("AgePlusGroup", BiologyExportRow.PROPERTY_AGE_PLUS_GROUP); - newColumnForExport("AgeSource", BiologyExportRow.PROPERTY_AGE_SOURCE); - newColumnForExport("GeneticSamplingFlag", BiologyExportRow.PROPERTY_GENETIC_SAMPLING_FLAG); - newColumnForExport("StomachSamplingFlag", BiologyExportRow.PROPERTY_STOMACH_SAMPLING_FLAG); - newColumnForExport("ParasiteSamplingFlag", BiologyExportRow.PROPERTY_PARASITE_SAMPLING_FLAG); - newColumnForExport("IndividualVertebraeCount", BiologyExportRow.PROPERTY_INDIVIDUAL_VERTEBRAE_COUNT); - } - - public List<BiologyExportRow> prepareRows(Voyage voyage) { - return Arrays.asList(new BiologyExportRow()); - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/CalibrationExportModel.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/CalibrationExportModel.java deleted file mode 100644 index fe4f583..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/CalibrationExportModel.java +++ /dev/null @@ -1,83 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.model; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -import fr.ifremer.echobase.entities.data.DataAcquisition; -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.Calibration; -import fr.ifremer.echobase.services.csv.EchoBaseCsvUtil; -import fr.ifremer.echobase.services.service.atlantos.row.CalibrationExportRow; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.nuiton.csv.ext.AbstractExportModel; - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class CalibrationExportModel extends AbstractExportModel<CalibrationExportRow> { - - public CalibrationExportModel(char separator) { - super(separator); - newColumnForExport("Calibration", CalibrationExportRow.PROPERTY_ENTITY); - newColumnForExport("Header", CalibrationExportRow.PROPERTY_HEADER); - newColumnForExport("CalibrationDate", CalibrationExportRow.PROPERTY_DATE, EchoBaseCsvUtil.ISO8611_DATE_FORMATTER); - newColumnForExport("CalibrationAcquisitionMethod", CalibrationExportRow.PROPERTY_ACQUISITION_METHOD); - newColumnForExport("CalibrationProcessingMethod", CalibrationExportRow.PROPERTY_PROCESSING_METHOD); - newColumnForExport("CalibrationAccuracyEstimate", CalibrationExportRow.PROPERTY_ACCURACY_ESTIMATE); - newColumnForExport("CalibrationReport", CalibrationExportRow.PROPERTY_REPORT); - newColumnForExport("CalibrationComments", CalibrationExportRow.PROPERTY_COMMENTS); - newColumnForExport("CalibrationID", CalibrationExportRow.PROPERTY_ID); - } - - public List<CalibrationExportRow> prepareRows(Voyage voyage) { - List<CalibrationExportRow> rows = new ArrayList<CalibrationExportRow>(); - - Collection<Transit> transits = voyage.getTransit(); - for (Transit transit : transits) { - - Collection<Transect> transects = transit.getTransect(); - for (Transect transect : transects) { - - Collection<DataAcquisition> dataAcquisitions = transect.getDataAcquisition(); - for (DataAcquisition dataAcquisition : dataAcquisitions) { - - AcousticInstrument acousticInstrument = dataAcquisition.getAcousticInstrument(); - Collection<Calibration> calibrations = acousticInstrument.getCalibration(); - for (Calibration calibration : calibrations) { - - CalibrationExportRow row = new CalibrationExportRow(); - row.setCalibration(calibration); - rows.add(row); - } - } - } - } - - return rows; - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/CatchExportModel.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/CatchExportModel.java deleted file mode 100644 index 85f1d34..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/CatchExportModel.java +++ /dev/null @@ -1,66 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.model; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.services.service.atlantos.row.CatchExportRow; -import java.util.Arrays; -import java.util.List; -import org.nuiton.csv.ext.AbstractExportModel; - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class CatchExportModel extends AbstractExportModel<CatchExportRow> { - - public CatchExportModel(char separator) { - super(separator); - newColumnForExport("Catch", CatchExportRow.PROPERTY_ENTITY); - newColumnForExport("Header", CatchExportRow.PROPERTY_HEADER); - newColumnForExport("CruiseLocalID", CatchExportRow.PROPERTY_CRUISE_LOCAL_ID); - newColumnForExport("HaulGear", CatchExportRow.PROPERTY_HAUL_GEAR); - newColumnForExport("HaulNumber", CatchExportRow.PROPERTY_HAUL_NUMBER); - newColumnForExport("DataType", CatchExportRow.PROPERTY_DATA_TYPE); - newColumnForExport("SpeciesCode", CatchExportRow.PROPERTY_SPECIES_CODE); - newColumnForExport("SpeciesValidity", CatchExportRow.PROPERTY_SPECIES_VALIDITY); - newColumnForExport("SpeciesTotalNumber", CatchExportRow.PROPERTY_SPECIES_TOTAL_NUMBER); - newColumnForExport("WeightUnit", CatchExportRow.PROPERTY_WEIGHT_UNIT); - newColumnForExport("SpeciesTotalWeight", CatchExportRow.PROPERTY_SPECIES_TOTAL_WEIGHT); - newColumnForExport("SpeciesCategory", CatchExportRow.PROPERTY_SPECIES_CATEGORY); - newColumnForExport("SpeciesSex", CatchExportRow.PROPERTY_SPECIES_SEX); - newColumnForExport("CategoryWeight", CatchExportRow.PROPERTY_CATEGORY_WEIGHT); - newColumnForExport("SubsampledNumber", CatchExportRow.PROPERTY_SUBSAMPLED_NUMBER); - newColumnForExport("SubsamplingFactor", CatchExportRow.PROPERTY_SUBSAMPLING_FACTOR); - newColumnForExport("SubsampleWeight", CatchExportRow.PROPERTY_SUBSAMPLE_WEIGHT); - newColumnForExport("LengthCode", CatchExportRow.PROPERTY_LENGTH_CODE); - newColumnForExport("LengthClass", CatchExportRow.PROPERTY_LENGTH_CLASS); - newColumnForExport("LengthType", CatchExportRow.PROPERTY_LENGTH_TYPE); - newColumnForExport("NumberAtLength", CatchExportRow.PROPERTY_NUMBER_AT_LENGTH); - newColumnForExport("WeightAtLength", CatchExportRow.PROPERTY_WEIGHT_AT_LENGTH); - } - - public List<CatchExportRow> prepareRows(Voyage voyage) { - return Arrays.asList(new CatchExportRow()); - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/CruiseExportModel.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/CruiseExportModel.java deleted file mode 100644 index 84d62ca..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/CruiseExportModel.java +++ /dev/null @@ -1,56 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.model; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -import fr.ifremer.echobase.services.csv.EchoBaseCsvUtil; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.services.service.atlantos.row.CruiseExportRow; -import java.util.Arrays; -import java.util.List; -import org.nuiton.csv.ext.AbstractExportModel; - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class CruiseExportModel extends AbstractExportModel<CruiseExportRow> { - - public CruiseExportModel(char separator) { - super(separator); - newColumnForExport("Cruise", CruiseExportRow.PROPERTY_ENTITY); - newColumnForExport("Header", CruiseExportRow.PROPERTY_HEADER); - newColumnForExport("CruiseSurvey", CruiseExportRow.PROPERTY_SURVEY); - newColumnForExport("CruiseCountry", CruiseExportRow.PROPERTY_COUNTRY); - newColumnForExport("CruiseOrganisation", CruiseExportRow.PROPERTY_ORGANISATION); - newColumnForExport("CruisePlatform", CruiseExportRow.PROPERTY_PLATEFORM); - newColumnForExport("CruiseStartDate", CruiseExportRow.PROPERTY_START_DATE, EchoBaseCsvUtil.ISO8611_DATE_FORMATTER); - newColumnForExport("CruiseEndDate", CruiseExportRow.PROPERTY_END_DATE, EchoBaseCsvUtil.ISO8611_DATE_FORMATTER); - newColumnForExport("CruiseLocalID", CruiseExportRow.PROPERTY_LOCAL_ID); - } - - public List<CruiseExportRow> prepareRows(Voyage voyage) { - CruiseExportRow row = new CruiseExportRow(); - row.setVoyage(voyage); - return Arrays.asList(row); - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/DataAcquisitionExportModel.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/DataAcquisitionExportModel.java deleted file mode 100644 index 5a87e9b..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/DataAcquisitionExportModel.java +++ /dev/null @@ -1,74 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.model; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -import fr.ifremer.echobase.entities.data.DataAcquisition; -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.service.atlantos.row.DataAcquisitionExportRow; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.nuiton.csv.ext.AbstractExportModel; - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class DataAcquisitionExportModel extends AbstractExportModel<DataAcquisitionExportRow> { - - public DataAcquisitionExportModel(char separator) { - super(separator); - newColumnForExport("DataAcquisition", DataAcquisitionExportRow.PROPERTY_ENTITY); - newColumnForExport("Header", DataAcquisitionExportRow.PROPERTY_HEADER); - newColumnForExport("DataAcquisitionSoftwareName", DataAcquisitionExportRow.PROPERTY_SOFTWARE_NAME); - newColumnForExport("DataAcquisitionSoftwareVersion", DataAcquisitionExportRow.PROPERTY_SOFTWARE_VERSION); - newColumnForExport("DataAcquisitionStoredDataFormat", DataAcquisitionExportRow.PROPERTY_STORED_DATA_FORMAT); - newColumnForExport("DataAcquisitionPingDutyCycle", DataAcquisitionExportRow.PROPERTY_PING_DUTY_CYCLE); - newColumnForExport("DataAcquisitionComments", DataAcquisitionExportRow.PROPERTY_COMMENTS); - newColumnForExport("DataAcquisitionID", DataAcquisitionExportRow.PROPERTY_ID); - } - - public List<DataAcquisitionExportRow> prepareRows(Voyage voyage) { - List<DataAcquisitionExportRow> rows = new ArrayList<DataAcquisitionExportRow>(); - - Collection<Transit> transits = voyage.getTransit(); - for (Transit transit : transits) { - - Collection<Transect> transects = transit.getTransect(); - for (Transect transect : transects) { - - Collection<DataAcquisition> dataAcquisitions = transect.getDataAcquisition(); - for (DataAcquisition dataAcquisition : dataAcquisitions) { - - DataAcquisitionExportRow row = new DataAcquisitionExportRow(); - row.setDataAcquisition(dataAcquisition); - rows.add(row); - } - } - } - - return rows; - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/DataExportModel.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/DataExportModel.java deleted file mode 100644 index 0b32c36..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/DataExportModel.java +++ /dev/null @@ -1,126 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.model; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -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.data.Transect; -import fr.ifremer.echobase.entities.data.Transit; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.DataMetadata; -import fr.ifremer.echobase.services.service.atlantos.row.DataExportRow; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import org.nuiton.csv.ext.AbstractExportModel; - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class DataExportModel extends AbstractExportModel<DataExportRow> { - - public DataExportModel(char separator) { - super(separator); - newColumnForExport("Data", DataExportRow.PROPERTY_ENTITY); - newColumnForExport("Header", DataExportRow.PROPERTY_HEADER); - newColumnForExport("LogDistance", DataExportRow.PROPERTY_LOG_DISTANCE); - newColumnForExport("LogTime", DataExportRow.PROPERTY_LOG_TIME); - newColumnForExport("LogLatitude", DataExportRow.PROPERTY_LOG_LATITUDE); - newColumnForExport("LogLongitude", DataExportRow.PROPERTY_LOG_LONGITUDE); - newColumnForExport("LogOrigin", DataExportRow.PROPERTY_LOG_ORIGIN); - newColumnForExport("SampleChannelDepthUpper", DataExportRow.PROPERTY_SAMPLE_CHANNEL_DEPTH_UPPER); - newColumnForExport("SampleChannelDepthLower", DataExportRow.PROPERTY_SAMPLE_CHANNEL_DEPTH_LOWER); - newColumnForExport("SamplePingAxisInterval", DataExportRow.PROPERTY_SAMPLE_PING_AXIS_INTERVAL); - newColumnForExport("SamplePingAxisIntervalType", DataExportRow.PROPERTY_SAMPLE_PING_AXIS_INTERVAL_TYPE); - newColumnForExport("SamplePingAxisIntervalOrigin", DataExportRow.PROPERTY_SAMPLE_PING_AXIS_INTERVAL_ORIGIN); - newColumnForExport("SamplePingAxisIntervalUnit", DataExportRow.PROPERTY_SAMPLE_PING_AXIS_INTERVAL_UNIT); - newColumnForExport("SampleSvThreshhold", DataExportRow.PROPERTY_SAMPLE_SV_THRESHHOLD); - newColumnForExport("InstrumentID", DataExportRow.PROPERTY_INSTRUMENT_ID); - newColumnForExport("CalibrationID", DataExportRow.PROPERTY_CALIBRATION_ID); - newColumnForExport("DataAcquisitionID", DataExportRow.PROPERTY_DATA_ACQUISITION_ID); - newColumnForExport("DataProcessingID", DataExportRow.PROPERTY_DATA_PROCESSING_ID); - newColumnForExport("DataSaCategory", DataExportRow.PROPERTY_DATA_SA_CATEGORY); - newColumnForExport("DataType", DataExportRow.PROPERTY_DATA_TYPE); - newColumnForExport("DataUnit", DataExportRow.PROPERTY_DATA_UNIT); - newColumnForExport("DataValue", DataExportRow.PROPERTY_DATA_VALUE); - newColumnForExport("CruiseLocalID", DataExportRow.PROPERTY_CRUISE_LOCAL_ID); - } - - public List<DataExportRow> prepareRows(Voyage voyage, Map<String, DataMetadata> metadatas) { - String Sv = metadatas.get("Sv").getTopiaId(); - String sv = metadatas.get("sv").getTopiaId(); - //String sA = metadatas.get("sA").getTopiaId(); - String sa = metadatas.get("sa").getTopiaId(); - - List<DataExportRow> rows = new ArrayList<DataExportRow>(); - - Collection<Transit> transits = voyage.getTransit(); - for (Transit transit : transits) { - - Collection<Transect> transects = transit.getTransect(); - for (Transect transect : transects) { - - Collection<DataAcquisition> dataAcquisitions = transect.getDataAcquisition(); - for (DataAcquisition dataAcquisition : dataAcquisitions) { - - Collection<DataProcessing> dataProcessings = dataAcquisition.getDataProcessing(); - for (DataProcessing dataProcessing : dataProcessings) { - - - Collection<Cell> cells = dataProcessing.getCell(); - for (Cell cell : cells) { - - Collection<Data> datas = cell.getData(); - for (Data data : datas) { - - DataMetadata dataMetadata = data.getDataMetadata(); - String dataMetadataId = dataMetadata.getTopiaId(); - -// if (dataMetadataId.equals(Sv) || -// dataMetadataId.equals(sv) || -// dataMetadataId.equals(sA) || -// dataMetadataId.equals(sa)) { - - DataExportRow row = new DataExportRow(); - row.setCell(data, cell, metadatas); - row.setDataAcquisitionId(dataAcquisition.getTopiaId()); - row.setDataProcessingId(dataProcessing.getTopiaId()); - row.setInstrumentId(dataAcquisition.getAcousticInstrument().getTopiaId()); - row.setCruiseLocalId(voyage.getTopiaId()); - //row.setCalibrationId(calibrationId); - rows.add(row); -// } - } - } - } - } - } - } - - return rows; - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/DataProcessingExportModel.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/DataProcessingExportModel.java deleted file mode 100644 index d5f52ea..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/DataProcessingExportModel.java +++ /dev/null @@ -1,92 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.model; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -import fr.ifremer.echobase.entities.data.DataAcquisition; -import fr.ifremer.echobase.entities.data.DataProcessing; -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.csv.EchoBaseCsvUtil; -import fr.ifremer.echobase.services.service.atlantos.row.DataProcessingExportRow; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.nuiton.csv.ext.AbstractExportModel; - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class DataProcessingExportModel extends AbstractExportModel<DataProcessingExportRow> { - - public DataProcessingExportModel(char separator) { - super(separator); - newColumnForExport("DataProcessing", DataProcessingExportRow.PROPERTY_ENTITY); - newColumnForExport("Header", DataProcessingExportRow.PROPERTY_HEADER); - newColumnForExport("DataProcessingSoftwareName", DataProcessingExportRow.PROPERTY_SOFTWARE_NAME); - newColumnForExport("DataProcessingSoftwareVersion", DataProcessingExportRow.PROPERTY_SOFTWARE_VERSION); - newColumnForExport("DataProcessingTriwaveCorrection", DataProcessingExportRow.PROPERTY_TRIWAVE_CORRECTION); - newColumnForExport("DataProcessingChannelID", DataProcessingExportRow.PROPERTY_CHANNEL_ID); - newColumnForExport("DataProcessingBandwidth", DataProcessingExportRow.PROPERTY_BAND_WIDTH, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("DataProcessingFrequency", DataProcessingExportRow.PROPERTY_FREQUENCY, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("DataProcessingTransceiverPower", DataProcessingExportRow.PROPERTY_TRANSCEIVER_POWER, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("DataProcessingTransmitPulseLength", DataProcessingExportRow.PROPERTY_TRANSMIT_PULSE_LENGTH, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("DataProcessingOnAxisGain", DataProcessingExportRow.PROPERTY_ON_AXIS_GAIN, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("DataProcessingOnAxisGainUnit", DataProcessingExportRow.PROPERTY_ON_AXIS_GAIN_UNIT); - newColumnForExport("DataProcessingSaCorrection", DataProcessingExportRow.PROPERTY_SA_CORRECTION, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("DataProcessingAbsorption", DataProcessingExportRow.PROPERTY_ABSORPTION, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("DataProcessingAbsorptionDescription", DataProcessingExportRow.PROPERTY_ABSORPTION_DESCRIPTION); - newColumnForExport("DataProcessingSoundSpeed", DataProcessingExportRow.PROPERTY_SOUND_SPEED); - newColumnForExport("DataProcessingSoundSpeedDescription", DataProcessingExportRow.PROPERTY_SOUND_SPEED_DESCRIPTION); - newColumnForExport("DataProcessingTransducerPSI", DataProcessingExportRow.PROPERTY_TRANSDUCER_PSI, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("DataProcessingComments", DataProcessingExportRow.PROPERTY_COMMENTS); - newColumnForExport("DataProcessingID", DataProcessingExportRow.PROPERTY_ID); - } - - public List<DataProcessingExportRow> prepareRows(Voyage voyage) { - List<DataProcessingExportRow> rows = new ArrayList<DataProcessingExportRow>(); - - Collection<Transit> transits = voyage.getTransit(); - for (Transit transit : transits) { - - Collection<Transect> transects = transit.getTransect(); - for (Transect transect : transects) { - - Collection<DataAcquisition> dataAcquisitions = transect.getDataAcquisition(); - for (DataAcquisition dataAcquisition : dataAcquisitions) { - - Collection<DataProcessing> dataProcessings = dataAcquisition.getDataProcessing(); - for (DataProcessing dataProcessing : dataProcessings) { - - DataProcessingExportRow row = new DataProcessingExportRow(); - row.setDataProcessing(dataProcessing); - rows.add(row); - } - } - } - } - - return rows; - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/HaulExportModel.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/HaulExportModel.java deleted file mode 100644 index 4399e5c..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/HaulExportModel.java +++ /dev/null @@ -1,87 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.model; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.services.service.atlantos.row.HaulExportRow; -import java.util.Arrays; -import java.util.List; -import org.nuiton.csv.ext.AbstractExportModel; - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class HaulExportModel extends AbstractExportModel<HaulExportRow> { - - public HaulExportModel(char separator) { - super(separator); - newColumnForExport("Cruise", HaulExportRow.PROPERTY_ENTITY); - newColumnForExport("Header", HaulExportRow.PROPERTY_HEADER); - newColumnForExport("CruiseLocalID", HaulExportRow.PROPERTY_CRUISE_LOCAL_ID); - newColumnForExport("HaulGear", HaulExportRow.PROPERTY_GEAR); - newColumnForExport("HaulNumber", HaulExportRow.PROPERTY_NUMBER); - newColumnForExport("HaulStartTime", HaulExportRow.PROPERTY_START_TIME); - newColumnForExport("HaulDuration", HaulExportRow.PROPERTY_DURATION); - newColumnForExport("HaulValidity", HaulExportRow.PROPERTY_VALIDITY); - newColumnForExport("HaulStartLatitude", HaulExportRow.PROPERTY_START_LATITUDE); - newColumnForExport("HaulStartLongitude", HaulExportRow.PROPERTY_START_LONGITUDE); - newColumnForExport("HaulStopLatitude", HaulExportRow.PROPERTY_STOP_LATITUDE); - newColumnForExport("HaulStopLongitude", HaulExportRow.PROPERTY_STOP_LONGITUDE); - newColumnForExport("HaulStatisticalRectangle", HaulExportRow.PROPERTY_STATISTICAL_RECTANGLE); - newColumnForExport("HaulMinTrawlDepth", HaulExportRow.PROPERTY_MIN_TRAWL_DEPTH); - newColumnForExport("HaulMaxTrawlDepth", HaulExportRow.PROPERTY_MAXT_RAWL_DEPTH); - newColumnForExport("HaulBottomDepth", HaulExportRow.PROPERTY_BOTTOM_DEPTH); - newColumnForExport("HaulDistance", HaulExportRow.PROPERTY_DISTANCE); - newColumnForExport("HaulNetopening", HaulExportRow.PROPERTY_NETOPENING); - newColumnForExport("HaulCodendMesh", HaulExportRow.PROPERTY_CODEND_MESH); - newColumnForExport("HaulSweepLength", HaulExportRow.PROPERTY_SWEEP_LENGTH); - newColumnForExport("HaulGearExceptions", HaulExportRow.PROPERTY_GEAR_EXCEPTIONS); - newColumnForExport("HaulDoorType", HaulExportRow.PROPERTY_DOOR_TYPE); - newColumnForExport("HaulWarpLength", HaulExportRow.PROPERTY_WARP_LENGTH); - newColumnForExport("HaulWarpDiameter", HaulExportRow.PROPERTY_WARP_DIAMETER); - newColumnForExport("HaulWarpDensity", HaulExportRow.PROPERTY_WARP_DENSITY); - newColumnForExport("HaulDoorSurface", HaulExportRow.PROPERTY_DOOR_SURFACE); - newColumnForExport("HaulDoorWeight", HaulExportRow.PROPERTY_DOOR_WEIGHT); - newColumnForExport("HaulDoorSpread", HaulExportRow.PROPERTY_DOOR_SPREAD); - newColumnForExport("HaulWingSpread", HaulExportRow.PROPERTY_WING_SPREAD); - newColumnForExport("HaulBuoyancy", HaulExportRow.PROPERTY_BUOYANCY); - newColumnForExport("HaulKiteArea", HaulExportRow.PROPERTY_KIT_EAREA); - newColumnForExport("HaulGroundRopeWeight", HaulExportRow.PROPERTY_GROUND_ROPE_WEIGHT); - newColumnForExport("HaulRigging", HaulExportRow.PROPERTY_RIGGING); - newColumnForExport("HaulTickler", HaulExportRow.PROPERTY_TICKLER); - newColumnForExport("HaulHydrographicStationID", HaulExportRow.PROPERTY_HYDROGRAPHIC_STATION_ID); - newColumnForExport("HaulTowDirection", HaulExportRow.PROPERTY_TOW_DIRECTION); - newColumnForExport("HaulSpeedGround", HaulExportRow.PROPERTY_SPEED_GROUND); - newColumnForExport("HaulSpeedWater", HaulExportRow.PROPERTY_SPEED_WATER); - newColumnForExport("HaulWindDirection", HaulExportRow.PROPERTY_WIND_DIRECTION); - newColumnForExport("HaulWindSpeed", HaulExportRow.PROPERTY_WIND_SPEED); - newColumnForExport("HaulSwellDirection", HaulExportRow.PROPERTY_SWELL_DIRECTION); - newColumnForExport("HaulSwellHeight", HaulExportRow.PROPERTY_SWELL_HEIGHT); - newColumnForExport("HaulLogDistance", HaulExportRow.PROPERTY_LOG_DISTANCE); - } - - public List<HaulExportRow> prepareRows(Voyage voyage) { - return Arrays.asList(new HaulExportRow()); - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/InstrumentExportModel.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/InstrumentExportModel.java deleted file mode 100644 index 79fedc4..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/InstrumentExportModel.java +++ /dev/null @@ -1,89 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.model; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -import fr.ifremer.echobase.entities.data.DataAcquisition; -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.services.csv.EchoBaseCsvUtil; -import fr.ifremer.echobase.services.service.atlantos.row.InstrumentExportRow; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.nuiton.csv.ext.AbstractExportModel; - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class InstrumentExportModel extends AbstractExportModel<InstrumentExportRow> { - - public InstrumentExportModel(char separator) { - super(separator); - newColumnForExport("Instrument", InstrumentExportRow.PROPERTY_ENTITY); - newColumnForExport("Header", InstrumentExportRow.PROPERTY_HEADER); - newColumnForExport("InstrumentFrequency", InstrumentExportRow.PROPERTY_FREQUENCY, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("InstrumentTransducerLocation", InstrumentExportRow.PROPERTY_TRANSDUCER_LOCATION); - newColumnForExport("InstrumentTransducerManufacturer", InstrumentExportRow.PROPERTY_TRANSDUCER_MANUFACTURER); - newColumnForExport("InstrumentTransducerModel", InstrumentExportRow.PROPERTY_TRANSDUCER_MODEL); - newColumnForExport("InstrumentTransducerSerial", InstrumentExportRow.PROPERTY_TRANSDUCER_SERIAL); - newColumnForExport("InstrumentTransducerBeamType", InstrumentExportRow.PROPERTY_TRANSDUCER_BEAM_TYPE); - newColumnForExport("InstrumentTransducerDepth", InstrumentExportRow.PROPERTY_TRANSDUCER_DEPTH, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("InstrumentTransducerOrientation", InstrumentExportRow.PROPERTY_TRANSDUCER_ORIENTATION, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("InstrumentTransducerPSI", InstrumentExportRow.PROPERTY_TRANSDUCER_PSI, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("InstrumentTransducerBeamAngleMajor", InstrumentExportRow.PROPERTY_TRANSDUCER_BEAM_ANGLE_MAJOR, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("InstrumentTransducerBeamAngleMinor", InstrumentExportRow.PROPERTY_TRANSDUCER_BEAM_ANGLE_MINOR, EchoBaseCsvUtil.PRIMITIVE_FLOAT); - newColumnForExport("InstrumentTransceiverManufacturer", InstrumentExportRow.PROPERTY_TRANSCEIVER_MANUFACTURER); - newColumnForExport("InstrumentTransceiverModel", InstrumentExportRow.PROPERTY_TRANSCEIVER_MODEL); - newColumnForExport("InstrumentTransceiverSerial", InstrumentExportRow.PROPERTY_TRANSDUCER_SERIAL); - newColumnForExport("InstrumentTransceiverFirmware", InstrumentExportRow.PROPERTY_TRANSCEIVER_FIRMWARE); - newColumnForExport("InstrumentComments", InstrumentExportRow.PROPERTY_COMMENTS); - newColumnForExport("InstrumentID", InstrumentExportRow.PROPERTY_ID); - } - - public List<InstrumentExportRow> prepareRows(Voyage voyage) { - List<InstrumentExportRow> rows = new ArrayList<InstrumentExportRow>(); - - Collection<Transit> transits = voyage.getTransit(); - for (Transit transit : transits) { - - Collection<Transect> transects = transit.getTransect(); - for (Transect transect : transects) { - - Collection<DataAcquisition> dataAcquisitions = transect.getDataAcquisition(); - for (DataAcquisition dataAcquisition : dataAcquisitions) { - - AcousticInstrument instrument = dataAcquisition.getAcousticInstrument(); - - InstrumentExportRow row = new InstrumentExportRow(); - row.setInstrument(instrument); - rows.add(row); - } - } - } - - return rows; - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/BiologyExportRow.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/BiologyExportRow.java deleted file mode 100644 index b19f009..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/BiologyExportRow.java +++ /dev/null @@ -1,141 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.row; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class BiologyExportRow { - - public static final String PROPERTY_ENTITY = "entity"; - public static final String PROPERTY_HEADER = "header"; - public static final String PROPERTY_CRUISE_LOCAL_ID = "cruiseLocalId"; - public static final String PROPERTY_HAUL_GEAR = "haulGear"; - public static final String PROPERTY_HAUL_NUMBER = "haulNumber"; - public static final String PROPERTY_CATCH_SPECIES_CODE = "catchSpeciesCode"; - public static final String PROPERTY_STOCK_CODE = "stockCode"; - public static final String PROPERTY_FISH_ID = "fishId"; - public static final String PROPERTY_LENGTH_CODE = "lengthCode"; - public static final String PROPERTY_INDIVIDUAL_LENGTH = "individualLength"; - public static final String PROPERTY_WEIGHT_UNIT = "weightUnit"; - public static final String PROPERTY_INDIVIDUAL_WEIGHT = "individualWeight"; - public static final String PROPERTY_INDIVIDUAL_SEX = "individualSex"; - public static final String PROPERTY_INDIVIDUAL_MATURITY = "individualMaturity"; - public static final String PROPERTY_MATURITY_SCALE = "maturityScale"; - public static final String PROPERTY_INDIVIDUAL_AGE = "individualAge"; - public static final String PROPERTY_AGE_PLUS_GROUP = "agePlusGroup"; - public static final String PROPERTY_AGE_SOURCE = "ageSource"; - public static final String PROPERTY_GENETIC_SAMPLING_FLAG = "geneticSamplingFlag"; - public static final String PROPERTY_STOMACH_SAMPLING_FLAG = "stomachSamplingFlag"; - public static final String PROPERTY_PARASITE_SAMPLING_FLAG = "parasiteSamplingFlag"; - public static final String PROPERTY_INDIVIDUAL_VERTEBRAE_COUNT = "individualVertebraeCount"; - - public String getEntity() { - return "Biology"; - } - - public String getHeader() { - return "Record"; - } - - public String getCruiseLocalId() { - return ""; - } - - public String getHaulGear() { - return ""; - } - - public String getHaulNumber() { - return ""; - } - - public String getCatchSpeciesCode() { - return ""; - } - - public String getStockCode() { - return ""; - } - - public String getFishId() { - return ""; - } - - public String getLengthCode() { - return ""; - } - - public String getIndividualLength() { - return ""; - } - - public String getWeightUnit() { - return ""; - } - - public String getIndividualWeight() { - return ""; - } - - public String getIndividualSex() { - return ""; - } - - public String getIndividualMaturity() { - return ""; - } - - public String getMaturityScale() { - return ""; - } - - public String getIndividualAge() { - return ""; - } - - public String getAgePlusGroup() { - return ""; - } - - public String getAgeSource() { - return ""; - } - - public String getGeneticSamplingFlag() { - return ""; - } - - public String getStomachSamplingFlag() { - return ""; - } - - public String getParasiteSamplingFlag() { - return ""; - } - - public String getIndividualVertebraeCount() { - return ""; - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/CalibrationExportRow.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/CalibrationExportRow.java deleted file mode 100644 index ac8db92..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/CalibrationExportRow.java +++ /dev/null @@ -1,84 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.row; - -import fr.ifremer.echobase.entities.references.Calibration; -import java.util.Date; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class CalibrationExportRow { - - public static final String PROPERTY_ENTITY = "entity"; - public static final String PROPERTY_HEADER = "header"; - public static final String PROPERTY_DATE = "date"; - public static final String PROPERTY_ACQUISITION_METHOD = "acquisitionMethod"; - public static final String PROPERTY_PROCESSING_METHOD = "processingMethod"; - public static final String PROPERTY_ACCURACY_ESTIMATE = "accuracyEstimate"; - public static final String PROPERTY_REPORT = "report"; - public static final String PROPERTY_COMMENTS = "comments"; - public static final String PROPERTY_ID = "id"; - - protected Calibration calibration; - - public void setCalibration(Calibration calibration) { - this.calibration = calibration; - } - - public String getEntity() { - return "Calibration"; - } - - public String getHeader() { - return "Record"; - } - - public Date getDate() { - return this.calibration.getDate(); - } - - public String getAcquisitionMethod() { - return this.calibration.getAquisitionMethod(); - } - - public String getProcessingMethod() { - return this.calibration.getProcessingMethod(); - } - - public String getAccuracyEstimate() { - return this.calibration.getAccuracyEstimate(); - } - - public String getReport() { - return this.calibration.getReport(); - } - - public String getComments() { - return this.calibration.getComments(); - } - - public String getId() { - return this.calibration.getTopiaId(); - } -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/CatchExportRow.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/CatchExportRow.java deleted file mode 100644 index 6af5331..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/CatchExportRow.java +++ /dev/null @@ -1,144 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.row; - -import fr.ifremer.echobase.entities.data.Voyage; -import java.util.Date; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class CatchExportRow { - - public static final String PROPERTY_ENTITY = "entity"; - public static final String PROPERTY_HEADER = "header"; - public static final String PROPERTY_CRUISE_LOCAL_ID = "cruiseLocalId"; - public static final String PROPERTY_HAUL_GEAR = "haulGear"; - public static final String PROPERTY_HAUL_NUMBER = "haulNumber"; - public static final String PROPERTY_DATA_TYPE = "dataType"; - public static final String PROPERTY_SPECIES_CODE = "speciesCode"; - public static final String PROPERTY_SPECIES_VALIDITY = "speciesValidity"; - public static final String PROPERTY_SPECIES_TOTAL_NUMBER = "speciesTotalNumber"; - public static final String PROPERTY_WEIGHT_UNIT = "weightUnit"; - public static final String PROPERTY_SPECIES_TOTAL_WEIGHT = "speciesTotalWeight"; - public static final String PROPERTY_SPECIES_CATEGORY = "speciesCategory"; - public static final String PROPERTY_SPECIES_SEX = "speciesSex"; - public static final String PROPERTY_CATEGORY_WEIGHT = "categoryWeight"; - public static final String PROPERTY_SUBSAMPLED_NUMBER = "subsampledNumber"; - public static final String PROPERTY_SUBSAMPLING_FACTOR = "subsamplingFactor"; - public static final String PROPERTY_SUBSAMPLE_WEIGHT = "subsampleWeight"; - public static final String PROPERTY_LENGTH_CODE = "lengthCode"; - public static final String PROPERTY_LENGTH_CLASS = "lengthClass"; - public static final String PROPERTY_LENGTH_TYPE = "lengthType"; - public static final String PROPERTY_NUMBER_AT_LENGTH = "numberAtLength"; - public static final String PROPERTY_WEIGHT_AT_LENGTH = "weightAtLength"; - - public String getEntity() { - return "Catch"; - } - - public String getHeader() { - return "Record"; - } - - public String getCruiseLocalId() { - return ""; - } - - public String getHaulGear() { - return ""; - } - - public String getHaulNumber() { - return ""; - } - - public String getDataType() { - return ""; - } - - public String getSpeciesCode() { - return ""; - } - - public String getSpeciesValidity() { - return ""; - } - - public String getSpeciesTotalNumber() { - return ""; - } - - public String getWeightUnit() { - return ""; - } - - public String getSpeciesTotalWeight() { - return ""; - } - - public String getSpeciesCategory() { - return ""; - } - - public String getSpeciesSex() { - return ""; - } - - public String getCategoryWeight() { - return ""; - } - - public String getSubsampledNumber() { - return ""; - } - - public String getSubsamplingFactor() { - return ""; - } - - public String getSubsampleWeight() { - return ""; - } - - public String getLengthCode() { - return ""; - } - - public String getLengthClass() { - return ""; - } - - public String getLengthType() { - return ""; - } - - public String getNumberAtLength() { - return ""; - } - - public String getWeightAtLength() { - return ""; - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/CruiseExportRow.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/CruiseExportRow.java deleted file mode 100644 index e83368c..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/CruiseExportRow.java +++ /dev/null @@ -1,85 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.row; - -import fr.ifremer.echobase.entities.data.Voyage; -import java.util.Date; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class CruiseExportRow { - - public static final String PROPERTY_ENTITY = "entity"; - public static final String PROPERTY_HEADER = "header"; - public static final String PROPERTY_SURVEY = "survey"; - public static final String PROPERTY_COUNTRY = "country"; - public static final String PROPERTY_ORGANISATION = "organisation"; - public static final String PROPERTY_PLATEFORM = "plateform"; - public static final String PROPERTY_START_DATE = "startDate"; - public static final String PROPERTY_END_DATE = "endDate"; - public static final String PROPERTY_LOCAL_ID = "localId"; - - protected Voyage voyage; - - public void setVoyage(Voyage voyage) { - this.voyage = voyage; - } - - public String getEntity() { - return "Cruise"; - } - - public String getHeader() { - return "Record"; - } - - public String getSurvey() { - return "NA"; - } - - public String getCountry() { - return "FR"; - } - - public String getOrganisation() { - return "NA"; - } - - public String getPlateform() { - return "NA"; - } - - public Date getStartDate() { - return voyage.getStartDate(); - } - - public Date getEndDate() { - return voyage.getEndDate(); - } - - public String getLocalId() { - return voyage.getTopiaId(); - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/DataAcquisitionExportRow.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/DataAcquisitionExportRow.java deleted file mode 100644 index bf9738a..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/DataAcquisitionExportRow.java +++ /dev/null @@ -1,79 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.row; - -import fr.ifremer.echobase.entities.data.DataAcquisition; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class DataAcquisitionExportRow { - - public static final String PROPERTY_ENTITY = "entity"; - public static final String PROPERTY_HEADER = "header"; - public static final String PROPERTY_SOFTWARE_NAME = "softwareName"; - public static final String PROPERTY_SOFTWARE_VERSION = "softwareVersion"; - public static final String PROPERTY_STORED_DATA_FORMAT = "storedDataFormat"; - public static final String PROPERTY_PING_DUTY_CYCLE = "pingDutyCycle"; - public static final String PROPERTY_COMMENTS = "comments"; - public static final String PROPERTY_ID = "id"; - - protected DataAcquisition dataAcquisition; - - public void setDataAcquisition(DataAcquisition dataAcquisition) { - this.dataAcquisition = dataAcquisition; - } - - public String getEntity() { - return "DataAcquisition"; - } - - public String getHeader() { - return "Record"; - } - - public String getSoftwareName() { - return this.dataAcquisition.getSoftwareName(); - } - - public String getSoftwareVersion() { - return this.dataAcquisition.getAcquisitionSoftwareVersion(); - } - - public String getStoredDataFormat() { - return this.dataAcquisition.getStoredDataFormat(); - } - - public String getPingDutyCycle() { - return this.dataAcquisition.getPingDutyCycle(); - } - - public String getComments() { - return this.dataAcquisition.getComments(); - } - - public String getId() { - return this.dataAcquisition.getTopiaId(); - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/DataExportRow.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/DataExportRow.java deleted file mode 100644 index ba58a54..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/DataExportRow.java +++ /dev/null @@ -1,223 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.row; - -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Maps; -import fr.ifremer.echobase.entities.data.Cell; -import fr.ifremer.echobase.entities.data.Data; -import fr.ifremer.echobase.entities.data.Datas; -import fr.ifremer.echobase.entities.references.DataMetadata; -import java.util.Map; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class DataExportRow { - - public static final String PROPERTY_ENTITY = "entity"; - public static final String PROPERTY_HEADER = "header"; - public static final String PROPERTY_LOG_DISTANCE = "logDistance"; - public static final String PROPERTY_LOG_TIME = "logTime"; - public static final String PROPERTY_LOG_LATITUDE = "logLatitude"; - public static final String PROPERTY_LOG_LONGITUDE = "logLongitude"; - public static final String PROPERTY_LOG_ORIGIN = "logOrigin"; - public static final String PROPERTY_SAMPLE_CHANNEL_DEPTH_UPPER = "sampleChannelDepthUpper"; - public static final String PROPERTY_SAMPLE_CHANNEL_DEPTH_LOWER = "sampleChannelDepthLower"; - public static final String PROPERTY_SAMPLE_PING_AXIS_INTERVAL = "samplePingAxisInterval"; - public static final String PROPERTY_SAMPLE_PING_AXIS_INTERVAL_TYPE = "samplePingAxisIntervalType"; - public static final String PROPERTY_SAMPLE_PING_AXIS_INTERVAL_ORIGIN = "samplePingAxisIntervalOrigin"; - public static final String PROPERTY_SAMPLE_PING_AXIS_INTERVAL_UNIT = "samplePingAxisIntervalUnit"; - public static final String PROPERTY_SAMPLE_SV_THRESHHOLD = "sampleSvThreshhold"; - public static final String PROPERTY_INSTRUMENT_ID = "instrumentId"; - public static final String PROPERTY_CALIBRATION_ID = "calibrationId"; - public static final String PROPERTY_DATA_ACQUISITION_ID = "dataAcquisitionId"; - public static final String PROPERTY_DATA_PROCESSING_ID = "dataProcessingId"; - public static final String PROPERTY_DATA_SA_CATEGORY = "dataSaCategory"; - public static final String PROPERTY_DATA_TYPE = "dataType"; - public static final String PROPERTY_DATA_UNIT = "dataUnit"; - public static final String PROPERTY_DATA_VALUE = "dataValue"; - public static final String PROPERTY_CRUISE_LOCAL_ID = "cruiseLocalId"; - - protected String instrumentId; - protected String calibrationId; - protected String dataAcquisitionId; - protected String dataProcessingId; - protected String cruiseLocalId; - - protected Cell cell; - protected Map<String, DataMetadata> metadatas; - protected ImmutableMap<DataMetadata, Data> datas; - protected Data data; - - public void setCell(Data data, Cell cell, Map<String, DataMetadata> metadatas) { - this.cell = cell; - this.metadatas = metadatas; - this.datas = Maps.uniqueIndex(cell.getData(), Datas.TO_DATA_METADATA); - this.data = data; - } - - public String getEntity() { - return "Data"; - } - - public String getHeader() { - return "Record"; - } - - public String getLogDistance() { - return ""; - } - - public String getLogTime() { - DataMetadata timeMeta = this.metadatas.get("TimeStart"); - Data time = this.datas.get(timeMeta); - - if (time == null) { - timeMeta = this.metadatas.get("TimeEnd"); - time = this.datas.get(timeMeta); - } - - return time.getDataValue(); - } - - public String getLogLatitude() { - DataMetadata latitudeMeta = this.metadatas.get("LatitudeStart"); - Data latitude = this.datas.get(latitudeMeta); - - if (latitude == null) { - latitudeMeta = this.metadatas.get("LatitudeEnd"); - latitude = this.datas.get(latitudeMeta); - } - - return latitude.getDataValue(); - } - - public String getLogLongitude() { - DataMetadata longitudeMeta = this.metadatas.get("LongitudeStart"); - Data longitude = this.datas.get(longitudeMeta); - - if (longitude == null) { - longitudeMeta = this.metadatas.get("LongitudeEnd"); - longitude = this.datas.get(longitudeMeta); - } - - return longitude.getDataValue(); - } - - public String getLogOrigin() { - DataMetadata latitudeMeta = this.metadatas.get("LatitudeStart"); - Data latitude = this.datas.get(latitudeMeta); - - if (latitude == null) { - return "end"; - } - - return "start"; - } - - public String getSampleChannelDepthUpper() { - return ""; - } - - public String getSampleChannelDepthLower() { - return ""; - } - - public String getSamplePingAxisInterval() { - return ""; - } - - public String getSamplePingAxisIntervalType() { - return ""; - } - - public String getSamplePingAxisIntervalOrigin() { - return ""; - } - - public String getSamplePingAxisIntervalUnit() { - return ""; - } - - public String getSampleSvThreshhold() { - return ""; - } - - public void setInstrumentId(String instrumentId) { - this.instrumentId = instrumentId; - } - - public String getInstrumentId() { - return this.instrumentId; - } - - public void setCalibrationId(String calibrationId) { - this.calibrationId = calibrationId; - } - - public String getCalibrationId() { - return this.calibrationId; - } - - public void setDataAcquisitionId(String dataAcquisitionId) { - this.dataAcquisitionId = dataAcquisitionId; - } - - public String getDataAcquisitionId() { - return this.dataAcquisitionId; - } - - public void setDataProcessingId(String dataProcessingId) { - this.dataProcessingId = dataProcessingId; - } - - public String getDataProcessingId() { - return this.dataProcessingId; - } - - public String getDataSaCategory() { - return ""; - } - - public String getDataType() { - return ""; - } - - public String getDataUnit() { - return this.data.getDataMetadata().getUnits(); - } - - public String getDataValue() { - return this.data.getDataValue(); - } - - public void setCruiseLocalId(String cruiseLocalId) { - this.cruiseLocalId = cruiseLocalId; - } - - public String getCruiseLocalId() { - return this.cruiseLocalId; - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/DataProcessingExportRow.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/DataProcessingExportRow.java deleted file mode 100644 index 320911a..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/DataProcessingExportRow.java +++ /dev/null @@ -1,139 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.row; - -import fr.ifremer.echobase.entities.data.DataProcessing; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class DataProcessingExportRow { - - public static final String PROPERTY_ENTITY = "entity"; - public static final String PROPERTY_HEADER = "header"; - public static final String PROPERTY_SOFTWARE_NAME = "softwareName"; - public static final String PROPERTY_SOFTWARE_VERSION = "softwareVersion"; - public static final String PROPERTY_TRIWAVE_CORRECTION = "triwaveCorrection"; - public static final String PROPERTY_CHANNEL_ID = "channelId"; - public static final String PROPERTY_BAND_WIDTH = "bandwidth"; - public static final String PROPERTY_FREQUENCY = "frequency"; - public static final String PROPERTY_TRANSCEIVER_POWER = "transceiverPower"; - public static final String PROPERTY_TRANSMIT_PULSE_LENGTH = "transmitPulseLength"; - public static final String PROPERTY_ON_AXIS_GAIN = "onAxisGain"; - public static final String PROPERTY_ON_AXIS_GAIN_UNIT = "onAxisGainUnit"; - public static final String PROPERTY_SA_CORRECTION = "saCorrection"; - public static final String PROPERTY_ABSORPTION = "absorption"; - public static final String PROPERTY_ABSORPTION_DESCRIPTION = "absorptionDescription"; - public static final String PROPERTY_SOUND_SPEED = "soundSpeed"; - public static final String PROPERTY_SOUND_SPEED_DESCRIPTION = "soundSpeedDescription"; - public static final String PROPERTY_TRANSDUCER_PSI = "transducerPSI"; - public static final String PROPERTY_COMMENTS = "comments"; - public static final String PROPERTY_ID = "id"; - - protected DataProcessing dataProcessing; - - public void setDataProcessing(DataProcessing dataProcessing) { - this.dataProcessing = dataProcessing; - } - - public String getEntity() { - return "DataProcessing"; - } - - public String getHeader() { - return "Record"; - } - - public String getSoftwareName() { - return this.dataProcessing.getSoftwareName(); - } - - public String getSoftwareVersion() { - return this.dataProcessing.getProcessingSoftwareVersion(); - } - - public String getTriwaveCorrection() { - return "NA"; - } - - public String getChannelId() { - return this.dataProcessing.getChannelId(); - } - - public Float getBandwidth() { - return this.dataProcessing.getBandWith(); - } - - public Float getFrequency() { - return this.dataProcessing.getFrequency(); - } - - public Float getTransceiverPower() { - return this.dataProcessing.getTransceiverPower(); - } - - public Float getTransmitPulseLength() { - return this.dataProcessing.getTransmitPulseLength(); - } - - public Float getOnAxisGain() { - return this.dataProcessing.getTransceiverProcessingGain(); - } - - public String getOnAxisGainUnit() { - return this.dataProcessing.getTransceiverGainUnits(); - } - - public Float getSaCorrection() { - return this.dataProcessing.getTransceiverProcessingSacorrection(); - } - - public Float getAbsorption() { - return this.dataProcessing.getTransceiverProcessingAbsorption(); - } - - public String getAbsorptionDescription() { - return this.dataProcessing.getTransceiverProcessingAbsorptionDescription(); - } - - public String getSoundSpeed() { - return this.dataProcessing.getEchosounderSoundSpeed(); - } - - public String getSoundSpeedDescription() { - return this.dataProcessing.getSoundSpeedCalculations(); - } - - public Float getTransducerPSI() { - return this.dataProcessing.getTransducerProcessingPsi(); - } - - public String getComments() { - return this.dataProcessing.getComments(); - } - - public String getId() { - return this.dataProcessing.getTopiaId(); - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/HaulExportRow.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/HaulExportRow.java deleted file mode 100644 index 6bcd2ff..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/HaulExportRow.java +++ /dev/null @@ -1,251 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.row; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class HaulExportRow { - - public static final String PROPERTY_ENTITY = "entity"; - public static final String PROPERTY_HEADER = "header"; - public static final String PROPERTY_CRUISE_LOCAL_ID = "cruiseLocalId"; - public static final String PROPERTY_GEAR = "gear"; - public static final String PROPERTY_NUMBER = "number"; - public static final String PROPERTY_STATIONN_AME = "stationName"; - public static final String PROPERTY_START_TIME = "startTime"; - public static final String PROPERTY_DURATION = "duration"; - public static final String PROPERTY_VALIDITY = "validity"; - public static final String PROPERTY_START_LATITUDE = "startLatitude"; - public static final String PROPERTY_START_LONGITUDE = "startLongitude"; - public static final String PROPERTY_STOP_LATITUDE = "stopLatitude"; - public static final String PROPERTY_STOP_LONGITUDE = "stopLongitude"; - public static final String PROPERTY_STATISTICAL_RECTANGLE = "statisticalRectangle"; - public static final String PROPERTY_MIN_TRAWL_DEPTH = "minTrawlDepth"; - public static final String PROPERTY_MAXT_RAWL_DEPTH = "maxTrawlDepth"; - public static final String PROPERTY_BOTTOM_DEPTH = "bottomDepth"; - public static final String PROPERTY_DISTANCE = "distance"; - public static final String PROPERTY_NETOPENING = "netopening"; - public static final String PROPERTY_CODEND_MESH = "codendMesh"; - public static final String PROPERTY_SWEEP_LENGTH = "sweepLength"; - public static final String PROPERTY_GEAR_EXCEPTIONS = "gearExceptions"; - public static final String PROPERTY_DOOR_TYPE = "doorType"; - public static final String PROPERTY_WARP_LENGTH = "warpLength"; - public static final String PROPERTY_WARP_DIAMETER = "warpDiameter"; - public static final String PROPERTY_WARP_DENSITY = "warpDensity"; - public static final String PROPERTY_DOOR_SURFACE = "doorSurface"; - public static final String PROPERTY_DOOR_WEIGHT = "doorWeight"; - public static final String PROPERTY_DOOR_SPREAD = "doorSpread"; - public static final String PROPERTY_WING_SPREAD = "wingSpread"; - public static final String PROPERTY_BUOYANCY = "buoyancy"; - public static final String PROPERTY_KIT_EAREA = "kiteArea"; - public static final String PROPERTY_GROUND_ROPE_WEIGHT = "groundRopeWeight"; - public static final String PROPERTY_RIGGING = "rigging"; - public static final String PROPERTY_TICKLER = "tickler"; - public static final String PROPERTY_HYDROGRAPHIC_STATION_ID = "hydrographicStationId"; - public static final String PROPERTY_TOW_DIRECTION = "towDirection"; - public static final String PROPERTY_SPEED_GROUND = "speedGround"; - public static final String PROPERTY_SPEED_WATER = "speedWater"; - public static final String PROPERTY_WIND_DIRECTION = "windDirection"; - public static final String PROPERTY_WIND_SPEED = "windSpeed"; - public static final String PROPERTY_SWELL_DIRECTION = "swellDirection"; - public static final String PROPERTY_SWELL_HEIGHT = "swellHeight"; - public static final String PROPERTY_LOG_DISTANCE = "logDistance"; - - public String getEntity() { - return "Haul"; - } - - public String getHeader() { - return "Record"; - } - - public String getCruiseLocalId() { - return ""; - } - - public String getGear() { - return ""; - } - - public String getNumber() { - return ""; - } - - public String getStationName() { - return ""; - } - - public String getStartTime() { - return ""; - } - - public String getDuration() { - return ""; - } - - public String getValidity() { - return ""; - } - - public String getStartLatitude() { - return ""; - } - - public String getStartLongitude() { - return ""; - } - - public String getStopLatitude() { - return ""; - } - - public String getStopLongitude() { - return ""; - } - - public String getStatisticalRectangle() { - return ""; - } - - public String getMinTrawlDepth() { - return ""; - } - - public String getMaxTrawlDepth() { - return ""; - } - - public String getBottomDepth() { - return ""; - } - - public String getDistance() { - return ""; - } - - public String getNetopening() { - return ""; - } - - public String getCodendMesh() { - return ""; - } - - public String getSweepLength() { - return ""; - } - - public String getGearExceptions() { - return ""; - } - - public String getDoorType() { - return ""; - } - - public String getWarpLength() { - return ""; - } - - public String getWarpDiameter() { - return ""; - } - - public String getWarpDensity() { - return ""; - } - - public String getDoorSurface() { - return ""; - } - - public String getDoorWeight() { - return ""; - } - - public String getDoorSpread() { - return ""; - } - - public String getWingSpread() { - return ""; - } - - public String getBuoyancy() { - return ""; - } - - public String getKiteArea() { - return ""; - } - - public String getGroundRopeWeight() { - return ""; - } - - public String getRigging() { - return ""; - } - - public String getTickler() { - return ""; - } - - public String getHydrographicStationId() { - return ""; - } - - public String getTowDirection() { - return ""; - } - - public String getSpeedGround() { - return ""; - } - - public String getSpeedWater() { - return ""; - } - - public String getWindDirection() { - return ""; - } - - public String getWindSpeed() { - return ""; - } - - public String getSwellDirection() { - return ""; - } - - public String getSwellHeight() { - return ""; - } - - public String getLogDistance() { - return ""; - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/InstrumentExportRow.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/InstrumentExportRow.java deleted file mode 100644 index eec1692..0000000 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/InstrumentExportRow.java +++ /dev/null @@ -1,134 +0,0 @@ -package fr.ifremer.echobase.services.service.atlantos.row; - -import fr.ifremer.echobase.entities.references.AcousticInstrument; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 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% - */ - -/** - * @author Julien Ruchaud - ruchaud@codelutin.com - * @since 4 - */ -public class InstrumentExportRow { - - public static final String PROPERTY_ENTITY = "entity"; - public static final String PROPERTY_HEADER = "header"; - public static final String PROPERTY_FREQUENCY = "frequency"; - public static final String PROPERTY_TRANSDUCER_LOCATION = "transducerLocation"; - public static final String PROPERTY_TRANSDUCER_MANUFACTURER = "transducerManufacturer"; - public static final String PROPERTY_TRANSDUCER_MODEL = "transducerModel"; - public static final String PROPERTY_TRANSDUCER_SERIAL = "transducerSerial"; - public static final String PROPERTY_TRANSDUCER_BEAM_TYPE = "transducerBeamType"; - public static final String PROPERTY_TRANSDUCER_DEPTH = "transducerDepth"; - public static final String PROPERTY_TRANSDUCER_ORIENTATION = "transducerOrientation"; - public static final String PROPERTY_TRANSDUCER_PSI = "transducerPSI"; - public static final String PROPERTY_TRANSDUCER_BEAM_ANGLE_MAJOR = "transducerBeamAngleMajor"; - public static final String PROPERTY_TRANSDUCER_BEAM_ANGLE_MINOR = "transducerBeamAngleMinor"; - public static final String PROPERTY_TRANSCEIVER_MANUFACTURER = "transceiverManufacturer"; - public static final String PROPERTY_TRANSCEIVER_MODEL = "transceiverModel"; - public static final String PROPERTY_TRANSCEIVER_SERIAL = "transceiverSerial"; - public static final String PROPERTY_TRANSCEIVER_FIRMWARE = "transceiverFirmware"; - public static final String PROPERTY_COMMENTS = "comments"; - public static final String PROPERTY_ID = "id"; - - protected AcousticInstrument instrument; - - public void setInstrument(AcousticInstrument instrument) { - this.instrument = instrument; - } - - public String getEntity() { - return "Instrument"; - } - - public String getHeader() { - return "Record"; - } - - public Float getFrequency() { - return this.instrument.getTransducerFrequency(); - } - - public String getTransducerLocation() { - return this.instrument.getTransducerLocation(); - } - - public String getTransducerManufacturer() { - return this.instrument.getTransducerBeamManufactuer(); - } - - public String getTransducerModel() { - return this.instrument.getTransducerModel(); - } - - public String getTransducerSerial() { - return this.instrument.getTransducerSerial(); - } - - public String getTransducerBeamType() { - return this.instrument.getTransducerBeams(); - } - - public Float getTransducerDepth() { - return this.instrument.getTransducerDepth(); - } - - public Float getTransducerOrientation() { - return this.instrument.getTransducerAzimuth(); - } - - public Float getTransducerPSI() { - return this.instrument.getTransducerPsi(); - } - - public Float getTransducerBeamAngleMajor() { - return this.instrument.getTransducerBeamAngleMajor(); - } - - public Float getTransducerBeamAngleMinor() { - return this.instrument.getTransducerBeamAngleMinor(); - } - - public String getTransceiverManufacturer() { - return this.instrument.getTransceiverManufacturer(); - } - - public String getTransceiverModel() { - return this.instrument.getTransceiverModel(); - } - - public String getTransceiverSerial() { - return this.instrument.getTransceiverSerial(); - } - - public String getTransceiverFirmware() { - return this.instrument.getTransceiverFirmware(); - } - - public String getComments() { - return this.instrument.getComments(); - } - - public String getId() { - return this.instrument.getTopiaId(); - } - -} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/VocabularyExport.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/VocabularyExport.java new file mode 100644 index 0000000..711a6d7 --- /dev/null +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/VocabularyExport.java @@ -0,0 +1,61 @@ +package fr.ifremer.echobase.services.service.atlantos.xml; + +import fr.ifremer.echobase.services.EchoBaseService; +import fr.ifremer.echobase.services.service.UserDbPersistenceService; +import java.util.HashMap; +import java.util.Map; +import javax.inject.Inject; + +/** + * + * @author julien + */ +public class VocabularyExport implements EchoBaseService { + + @Inject + private UserDbPersistenceService persistenceService; + + protected Map<String, String> vocabulary; + + public void init() { + vocabulary = new HashMap<String, String>(); + + vocabulary.put("Hull", "AC_TransducerLocation_AA"); + vocabulary.put("Split", "AC_TransducerBeamType_S2"); + vocabulary.put(".hac and .raw formats", "AC_StoredDataFormat_HAC"); + vocabulary.put("ER60", "AC_DataAcquisitionSoftwareName_ER60"); // À ajouter dans le voca + vocabulary.put("Movies3D", "AC_DataProcessingSoftwareName_Movies3D"); // À ajouter dans le voca + vocabulary.put("PELGAS", "AC_Survey_PELGAS"); // À ajouter dans le voca + vocabulary.put("France", "ISO_3166_FR"); + vocabulary.put("35HT", "SHIPC_35HT"); + vocabulary.put("D1", "AC_SaCategory_D1"); // À ajouter dans le voca + vocabulary.put("D2", "AC_SaCategory_D2"); // À ajouter dans le voca + vocabulary.put("D3", "AC_SaCategory_D3"); // À ajouter dans le voca + vocabulary.put("D4", "AC_SaCategory_D4"); // À ajouter dans le voca + vocabulary.put("D5", "AC_SaCategory_D5"); // À ajouter dans le voca + vocabulary.put("D6", "AC_SaCategory_D6"); // À ajouter dans le voca + vocabulary.put("D7", "AC_SaCategory_D7"); // À ajouter dans le voca + vocabulary.put("D8", "AC_SaCategory_D8"); // À ajouter dans le voca + vocabulary.put("D9", "AC_SaCategory_D9"); // À ajouter dans le voca + vocabulary.put("D10", "AC_SaCategory_D10"); // À ajouter dans le voca + vocabulary.put("D11", "AC_SaCategory_D11"); // À ajouter dans le voca + vocabulary.put("D12", "AC_SaCategory_D12"); // À ajouter dans le voca + + Map<String, String> fromDB = persistenceService.getVocabulary(); + vocabulary.putAll(fromDB); + } + + public String getVocabularyCode(String key, String defaultValue) { + if (key == null || key.trim().equals("")) { + return defaultValue; + } + + String code = vocabulary.get(key.trim()); + if (code == null) { + return defaultValue; + } + + return code; + } + +} diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/XmlAccousticExport.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/XmlAccousticExport.java index 4ca5420..62ff4f4 100644 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/XmlAccousticExport.java +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/XmlAccousticExport.java @@ -24,6 +24,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.function.Predicate; +import javax.inject.Inject; import org.apache.commons.lang3.StringUtils; /* @@ -53,46 +54,12 @@ import org.apache.commons.lang3.StringUtils; */ public class XmlAccousticExport implements EchoBaseService { - public static Map<String, String> vocabulary = new HashMap<String, String>(); - - static { - vocabulary.put("Hull", "AC_TransducerLocation_AA"); - vocabulary.put("Split", "AC_TransducerBeamType_S2"); - vocabulary.put(".hac and .raw formats", "AC_StoredDataFormat_HAC"); - vocabulary.put("ER60", "AC_DataAcquisitionSoftwareName_ER60"); // À ajouter dans le voca - vocabulary.put("Movies3D", "AC_DataProcessingSoftwareName_Movies3D"); // À ajouter dans le voca - vocabulary.put("PELGAS", "AC_Survey_PELGAS"); // À ajouter dans le voca - vocabulary.put("France", "ISO_3166_FR"); - vocabulary.put("35HT", "SHIPC_35HT"); - vocabulary.put("D1", "AC_SaCategory_D1"); // À ajouter dans le voca - vocabulary.put("D2", "AC_SaCategory_D2"); // À ajouter dans le voca - vocabulary.put("D3", "AC_SaCategory_D3"); // À ajouter dans le voca - vocabulary.put("D4", "AC_SaCategory_D4"); // À ajouter dans le voca - vocabulary.put("D5", "AC_SaCategory_D5"); // À ajouter dans le voca - vocabulary.put("D6", "AC_SaCategory_D6"); // À ajouter dans le voca - vocabulary.put("D7", "AC_SaCategory_D7"); // À ajouter dans le voca - vocabulary.put("D8", "AC_SaCategory_D8"); // À ajouter dans le voca - vocabulary.put("D9", "AC_SaCategory_D9"); // À ajouter dans le voca - vocabulary.put("D10", "AC_SaCategory_D10"); // À ajouter dans le voca - vocabulary.put("D11", "AC_SaCategory_D11"); // À ajouter dans le voca - vocabulary.put("D12", "AC_SaCategory_D12"); // À ajouter dans le voca - } - - public static String getVocabularyCode(String key, String defaultValue) { - if (key == null || key.trim().equals("")) { - return defaultValue; - } - - String code = vocabulary.get(key.trim()); - if (code == null) { - return defaultValue; - } - - return code; - } + @Inject + protected VocabularyExport vocabulary; public void doExport(Voyage voyage, XmlWriter xml) throws IOException { boolean exportCruiseDone = false; + vocabulary.init(); // EXPORT ACCOUSTIC xml.open("Acoustic", @@ -190,7 +157,7 @@ public class XmlAccousticExport implements EchoBaseService { instrument.getTransducerFrequency()); xml.create("TransducerLocation", - "IDREF", getVocabularyCode(instrument.getTransducerLocation(), "AC_TransducerLocation_AA")); + "IDREF", vocabulary.getVocabularyCode(instrument.getTransducerLocation(), "AC_TransducerLocation_AA")); xml.create("TransducerManufacturer", instrument.getTransducerBeamManufactuer()); @@ -199,7 +166,7 @@ public class XmlAccousticExport implements EchoBaseService { xml.create("TransducerSerial", instrument.getTransducerSerial()); xml.create("TransducerBeamType", - "IDREF", getVocabularyCode(instrument.getTransducerAperture(), "AC_TransducerBeamType_S2")); + "IDREF", vocabulary.getVocabularyCode(instrument.getTransducerAperture(), "AC_TransducerBeamType_S2")); xml.create("TransducerDepth", instrument.getTransducerDepth()); @@ -253,11 +220,11 @@ public class XmlAccousticExport implements EchoBaseService { "ID", dataAcquisition.getTopiaId()); xml.create("SoftwareName", - "IDREF", getVocabularyCode(dataAcquisition.getSoftwareName(), "AC_DataAcquisitionSoftwareName_test1")); + "IDREF", vocabulary.getVocabularyCode(dataAcquisition.getSoftwareName(), "AC_DataAcquisitionSoftwareName_test1")); xml.create("SoftwareVersion", dataAcquisition.getAcquisitionSoftwareVersion()); xml.create("StoredDataFormat", - "IDREF", getVocabularyCode(dataAcquisition.getLoggedDataFormat(), "AC_StoredDataFormat_HAC")); + "IDREF", vocabulary.getVocabularyCode(dataAcquisition.getLoggedDataFormat(), "AC_StoredDataFormat_HAC")); xml.create("PingDutyCycle", dataAcquisition.getPingDutyCycle()); xml.create("Comments", @@ -271,7 +238,7 @@ public class XmlAccousticExport implements EchoBaseService { "ID", dataProcessing.getTopiaId()); xml.create("SoftwareName", - "IDREF", getVocabularyCode(dataProcessing.getSoftwareName(), "AC_DataProcessingSoftwareName_test1")); + "IDREF", vocabulary.getVocabularyCode(dataProcessing.getSoftwareName(), "AC_DataProcessingSoftwareName_test1")); xml.create("SoftwareVersion", dataProcessing.getProcessingSoftwareVersion()); xml.create("TriwaveCorrection", "IDREF", @@ -312,17 +279,17 @@ public class XmlAccousticExport implements EchoBaseService { xml.open("Cruise"); xml.create("Survey", - "IDREF", getVocabularyCode(voyage.getMission().getName(), "AC_Survey_PELGAS")); + "IDREF", vocabulary.getVocabularyCode(voyage.getMission().getName(), "AC_Survey_PELGAS")); xml.create("Country", - "IDREF", getVocabularyCode(voyage.getMission().getCountry(), "ISO_3166_FR")); + "IDREF", vocabulary.getVocabularyCode(voyage.getMission().getCountry(), "ISO_3166_FR")); xml.create("Platform", - "IDREF", getVocabularyCode(transect.getVessel().getCode(), "SHIPC_35HT")); + "IDREF", vocabulary.getVocabularyCode(transect.getVessel().getCode(), "SHIPC_35HT")); xml.create("StartDate", EchoBaseCsvUtil.ISO8611_DATE_FORMATTER.format(voyage.getStartDate())); xml.create("EndDate", EchoBaseCsvUtil.ISO8611_DATE_FORMATTER.format(voyage.getEndDate())); xml.create("Organisation", - "IDREF", getVocabularyCode(voyage.getMission().getInstitution(), "EDMO_541")); + "IDREF", vocabulary.getVocabularyCode(voyage.getMission().getInstitution(), "EDMO_541")); xml.create("LocalID", voyage.getTopiaId()); } @@ -424,7 +391,7 @@ public class XmlAccousticExport implements EchoBaseService { xml.open("Data"); xml.create("SaCategory", - "IDREF", getVocabularyCode(result.getCategory().getEchotypeLabel(), "AC_SaCategory_D4")); + "IDREF", vocabulary.getVocabularyCode(result.getCategory().getEchotypeLabel(), "AC_SaCategory_D4")); xml.create("Type", "IDREF", "AC_AcousticDataType_C"); xml.create("Unit", diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/XmlBioticExport.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/XmlBioticExport.java index e47329a..4d8ce25 100644 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/XmlBioticExport.java +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/XmlBioticExport.java @@ -13,7 +13,6 @@ import fr.ifremer.echobase.entities.references.Species; import fr.ifremer.echobase.entities.references.SpeciesCategory; import fr.ifremer.echobase.services.EchoBaseService; import fr.ifremer.echobase.services.csv.EchoBaseCsvUtil; -import fr.ifremer.echobase.services.service.UserDbPersistenceService; import java.io.IOException; import java.util.Collection; import javax.inject.Inject; @@ -45,7 +44,11 @@ import javax.inject.Inject; */ public class XmlBioticExport implements EchoBaseService { + @Inject + protected VocabularyExport vocabulary; + public void doExport(Voyage voyage, XmlWriter xml) throws IOException { + vocabulary.init(); // EXPORT BIOTIC xml.open("Biotic", diff --git a/echobase-services/src/test/java/fr/ifremer/echobase/services/service/atlantos/ExportAtlantosServiceTest.java b/echobase-services/src/test/java/fr/ifremer/echobase/services/service/atlantos/ExportAtlantosServiceTest.java index 22dcb3e..7a0708b 100644 --- a/echobase-services/src/test/java/fr/ifremer/echobase/services/service/atlantos/ExportAtlantosServiceTest.java +++ b/echobase-services/src/test/java/fr/ifremer/echobase/services/service/atlantos/ExportAtlantosServiceTest.java @@ -58,38 +58,5 @@ public class ExportAtlantosServiceTest extends EchoBaseTestServiceSupport { exportService.doXmlExport(model); } - -// @Test - public void testExport() throws Exception { - - File workingDirectory = new File(getTestDir(), "testAtlantos"); - FileUtil.createDirectoryIfNecessary(workingDirectory); - - ExportAtlantosConfiguration model = new ExportAtlantosConfiguration(); - model.setVoyageId(getVoyageId()); - model.setWorkingDirectory(workingDirectory); - - Assert.assertFalse(new File(workingDirectory, "Cruise.csv").exists()); - Assert.assertFalse(new File(workingDirectory, "Haul.csv").exists()); - Assert.assertFalse(new File(workingDirectory, "Catch.csv").exists()); - Assert.assertFalse(new File(workingDirectory, "Biology.csv").exists()); - Assert.assertFalse(new File(workingDirectory, "Instrument.csv").exists()); - Assert.assertFalse(new File(workingDirectory, "Calibration.csv").exists()); - Assert.assertFalse(new File(workingDirectory, "DataAcquisition.csv").exists()); - Assert.assertFalse(new File(workingDirectory, "DataProcessing.csv").exists()); - Assert.assertFalse(new File(workingDirectory, "Data.csv").exists()); - - exportService.doExport(model); - - Assert.assertTrue(new File(workingDirectory, "Cruise.csv").exists()); - Assert.assertTrue(new File(workingDirectory, "Haul.csv").exists()); - Assert.assertTrue(new File(workingDirectory, "Catch.csv").exists()); - Assert.assertTrue(new File(workingDirectory, "Biology.csv").exists()); - Assert.assertTrue(new File(workingDirectory, "Instrument.csv").exists()); - Assert.assertTrue(new File(workingDirectory, "Calibration.csv").exists()); - Assert.assertTrue(new File(workingDirectory, "DataAcquisition.csv").exists()); - Assert.assertTrue(new File(workingDirectory, "DataProcessing.csv").exists()); - Assert.assertTrue(new File(workingDirectory, "Data.csv").exists()); - } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.