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 526aa06499cbef20f8e9bb1c8fca69fcb99fd885 Author: Julien Ruchaud <julien.ruchaud@debux.org> Date: Mon Oct 3 15:23:30 2016 +0200 ref #8173, create all data structures --- .../echobase/services/csv/EchoBaseCsvUtil.java | 1 - .../service/atlantos/model/BiologyExportModel.java | 65 ++++++ .../service/atlantos/model/CatchExportModel.java | 65 ++++++ .../service/atlantos/model/DataExportModel.java | 126 +++++++++++ .../service/atlantos/model/HaulExportModel.java | 86 +++++++ .../service/atlantos/row/BiologyExportRow.java | 141 ++++++++++++ .../service/atlantos/row/CatchExportRow.java | 144 ++++++++++++ .../service/atlantos/row/DataExportRow.java | 223 ++++++++++++++++++ .../service/atlantos/row/HaulExportRow.java | 251 +++++++++++++++++++++ .../service/atlantos/row/InstrumentExportRow.java | 1 - 10 files changed, 1101 insertions(+), 2 deletions(-) diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchoBaseCsvUtil.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchoBaseCsvUtil.java index 957c210..c7ea5ab 100644 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchoBaseCsvUtil.java +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchoBaseCsvUtil.java @@ -45,7 +45,6 @@ import fr.ifremer.echobase.entities.references.SizeCategory; import fr.ifremer.echobase.entities.references.Species; import fr.ifremer.echobase.entities.references.Strata; import fr.ifremer.echobase.entities.references.Vessel; -import java.text.SimpleDateFormat; import org.nuiton.csv.ValueFormatter; import org.nuiton.csv.ValueGetter; import org.nuiton.csv.ValueParser; 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 new file mode 100644 index 0000000..e9dc865 --- /dev/null +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/BiologyExportModel.java @@ -0,0 +1,65 @@ +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.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 null; + } + +} 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 new file mode 100644 index 0000000..8033321 --- /dev/null +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/CatchExportModel.java @@ -0,0 +1,65 @@ +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.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 null; + } + +} 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 new file mode 100644 index 0000000..29d10f5 --- /dev/null +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/DataExportModel.java @@ -0,0 +1,126 @@ +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/HaulExportModel.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/HaulExportModel.java new file mode 100644 index 0000000..13e8d81 --- /dev/null +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/model/HaulExportModel.java @@ -0,0 +1,86 @@ +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.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 null; + } + +} 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 new file mode 100644 index 0000000..b19f009 --- /dev/null +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/BiologyExportRow.java @@ -0,0 +1,141 @@ +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/CatchExportRow.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/CatchExportRow.java new file mode 100644 index 0000000..60d5702 --- /dev/null +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/CatchExportRow.java @@ -0,0 +1,144 @@ +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/DataExportRow.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/DataExportRow.java new file mode 100644 index 0000000..d17d896 --- /dev/null +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/DataExportRow.java @@ -0,0 +1,223 @@ +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 this.data.getDataMetadata().getDataType().getName(); + } + + 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/HaulExportRow.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/HaulExportRow.java new file mode 100644 index 0000000..6bcd2ff --- /dev/null +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/row/HaulExportRow.java @@ -0,0 +1,251 @@ +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 index 8764212..775cf3e 100644 --- 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 @@ -130,6 +130,5 @@ public class InstrumentExportRow { public String getId() { return this.instrument.getTopiaId(); } - } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.