Author: tchemit Date: 2012-03-28 01:02:51 +0200 (Wed, 28 Mar 2012) New Revision: 420 Url: http://forge.codelutin.com/repositories/revision/echobase/420 Log: Last big refactor :( - move all importData to his own place - remove configurations and csv package from services one - uniformize esdu result import name (remove the acoustic prefix) - make all result import works :) - reformat everything Voila. Added: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/EntityCsvModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AbstractEchobaseActionConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EmbeddedApplicationConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportDbConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDbConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ProgressionModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CellPositionReference.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportMode.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/BiometrySampleImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/BiometrySampleImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EchotypeImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EchotypeImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/GearMetadataValueImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/GearMetadataValueImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthAgeKeyImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthAgeKeyImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthWeightKeyImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthWeightKeyImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationMetadataValueImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationMetadataValueImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellAssociationImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellAssociationImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/SubSampleImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/SubSampleImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TotalSampleImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TotalSampleImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransectImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransectImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransitImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransitImportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/VoyageImportModel.java trunk/echobase-services/src/test/resources/import-data/result/esdu/ trunk/echobase-services/src/test/resources/import-data/result/esdu/byEchotype.csv.gz trunk/echobase-services/src/test/resources/import-data/result/esdu/byEchotypeAndSpeciesCategory.csv.gz trunk/echobase-services/src/test/resources/import-data/result/esdu/bySpeciesAndAgeCategory.csv.gz trunk/echobase-services/src/test/resources/import-data/result/esdu/bySpeciesAndSizeCategory.csv.gz trunk/echobase-services/src/test/resources/import-data/result/map/ trunk/echobase-services/src/test/resources/import-data/result/region/ trunk/echobase-services/src/test/resources/import-data/result/region/regions.csv.gz trunk/echobase-services/src/test/resources/import-data/result/voyage/ trunk/echobase-services/src/test/resources/import-data/result/voyage/echotype.csv.gz trunk/echobase-services/src/test/resources/import-data/result/voyage/lengthAgeKey.csv.gz trunk/echobase-services/src/test/resources/import-data/result/voyage/lengthWeightKey.csv.gz trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduByEchotype-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduByEchotypeAndSpeciesCategory-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduBySpeciesAndAgeCategory-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduBySpeciesAndSizeCategory-validation.xml Removed: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AbstractEchobaseActionConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AbstractImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AcousticDataImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesDataImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CellPositionReference.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportMode.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/DefaultProgressionModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/EmbeddedApplicationConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ExportDbConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ImportDbConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/OperationImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ProgressionModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportMode.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeAndSpeciesCategoryImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeAndSpeciesCategoryImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndAgeCategoryImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndAgeCategoryImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndSizeCategoryImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndSizeCategoryImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/BiometrySampleImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/BiometrySampleImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EntityAssociationExportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EntityAssociationImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EntityCsvModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/ExportQueryCsvModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/GearMetadataValueImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/GearMetadataValueImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationMetadataValueImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationMetadataValueImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellAssociationImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellAssociationImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/SubSampleImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/SubSampleImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TotalSampleImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TotalSampleImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransectImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransectImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransitImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransitImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/VoyageImportModel.java trunk/echobase-services/src/test/resources/import-data/result/acousticResultByEchotype.csv.gz trunk/echobase-services/src/test/resources/import-data/result/acousticResultByEchotypeAndSpeciesCategory.csv.gz trunk/echobase-services/src/test/resources/import-data/result/acousticResultBySpeciesAndAgeCategory.csv.gz trunk/echobase-services/src/test/resources/import-data/result/acousticResultBySpeciesAndSizeCategory.csv.gz trunk/echobase-services/src/test/resources/import-data/result/echotype.csv.gz trunk/echobase-services/src/test/resources/import-data/result/lengthAgeKey.csv.gz trunk/echobase-services/src/test/resources/import-data/result/lengthWeightKey.csv.gz trunk/echobase-services/src/test/resources/import-data/result/regions.csv.gz trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData.java trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotype-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotypeAndSpeciesCategory-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticBySpeciesAndAgeCategory-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticBySpeciesAndSizeCategory-validation.xml Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EmbeddedApplicationService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportDbService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportQueryService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDbService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsVoyageImportService.java trunk/echobase-services/src/main/resources/i18n/echobase-services_en_GB.properties trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EchoBaseTestServiceSupport.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceIT.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/ExportDbServiceTest.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/ImportDbServiceTest.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticDataImportServiceIT.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesDataImportServiceIT.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonData2ImportServiceIT.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonDataImportServiceIT.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/OperationImportServiceIT.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportServiceIT.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportServiceIT.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportServiceIT.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsVoyageImportServiceIT.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/CellMethodLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/CellTypeLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DataQualityLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DataTypeLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EchotypeLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EntityLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/GearLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/MissionLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationEventLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SpeciesLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/StrataLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/TSParametersLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/VesselLoader.java trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoader.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/AbstractWaitAndExecAction.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/embeddedApplication/Build.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/embeddedApplication/Configure.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/embeddedApplication/Download.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportDb/Configure.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportDb/Download.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportDb/Export.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractConfigureImport.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticData.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesData.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importDb/Configure.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importDb/Import.java trunk/echobase-ui/src/main/resources/config/struts-user.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/LoginAction-login-validation.xml trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties trunk/echobase-ui/src/main/resources/template/css_xhtml/checkbox.ftl trunk/echobase-ui/src/main/resources/template/css_xhtml/controlheader-core.ftl trunk/echobase-ui/src/main/resources/template/simple/myradiomap.ftl trunk/echobase-ui/src/main/resources/validators.xml trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp Copied: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/EntityCsvModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EntityCsvModel.java) =================================================================== --- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/EntityCsvModel.java (rev 0) +++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/EntityCsvModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,254 @@ +/* + * #%L + * EchoBase :: Entities + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.csv; + +import com.google.common.base.Function; +import com.google.common.collect.Maps; +import fr.ifremer.echobase.EchoBaseFunctions; +import fr.ifremer.echobase.entities.meta.TableMeta; +import org.nuiton.topia.persistence.TopiaEntity; +import org.nuiton.util.csv.ValueFormatter; +import org.nuiton.util.decorator.Decorator; + +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.Map; + +/** + * A model to import / export entities into csv files. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class EntityCsvModel<E extends TopiaEntity> extends AbstractImportExportModel<E> { + + protected final TableMeta tableMeta; + + public static <E extends TopiaEntity> EntityCsvModel<E> newModel( + char separator, + TableMeta tableMeta + ) { + return new EntityCsvModel<E>(separator, tableMeta); + } + + public static <E extends TopiaEntity> EntityCsvModel<E> newModel( + char separator, + TableMeta tableMeta, + String idHeader + ) { + return new EntityCsvModel<E>(separator, tableMeta, idHeader); + } + + @Override + public E newEmptyInstance() { + return (E) tableMeta.newEntity(); + } + + public void addForeignKeyForExport(String propertyName, + Class<TopiaEntity> entityType) { + + Map<String, TopiaEntity> universe = Collections.emptyMap(); + + newColumnForExport( + propertyName, + EchobaseCsvUtil.newForeignKeyValue(entityType, + propertyName, + universe) + ); + } + + public <T> void addDecoratedForeignKeyForExport(String headerName, String propertyName, Decorator<T> decorator) { + modelBuilder.newColumnForExport(headerName, propertyName, + new ForeignKeyDecoratedValue<T>(decorator)); + } + + public <E extends TopiaEntity> void addForeignKeyForImport(String headerName, + String propertyName, + Class<E> entityType, + Collection<E> entities, + Function<E, String> transform) { + + Map<String, E> universe = Maps.uniqueIndex(entities, transform); + + newMandatoryColumn( + headerName, + propertyName, + EchobaseCsvUtil.newForeignKeyValue(entityType, + propertyName, + universe) + ); + } + + public <E extends TopiaEntity> void addForeignKeyForAssociationForImport(String headerName, + String propertyName, + Class<E> entityType, + Collection<E> entities, + Function<E, String> transform) { + + Map<String, E> universe = Maps.uniqueIndex(entities, transform); + + newMandatoryColumn( + headerName, + propertyName, + EchobaseCsvUtil.newForeignKeyValueAssociation(entityType, + propertyName, + universe) + ); + } + + public <E extends TopiaEntity> void addForeignKeyForImport(String propertyName, + Class<E> entityType, + Collection<E> entities) { + + Map<String, E> universe = Maps.uniqueIndex( + entities, EchoBaseFunctions.TO_TOPIAID); + + newMandatoryColumn( + propertyName, + EchobaseCsvUtil.newForeignKeyValue(entityType, + propertyName, + universe) + ); + } + + public void addDefaultColumn(String propertyName, + Class<?> type) { + addDefaultColumn(propertyName, propertyName, type); + } + + public void addDefaultColumn(String headerName, + String propertyName, + Class<?> type) { + + if (Date.class.equals(type)) { + newColumnForImportExport( + headerName, + propertyName, + EchobaseCsvUtil.DAY_TIME_SECOND_WITH_TIMESTAMP + ); + } else if (double.class.equals(type)) { + newColumnForImportExport( + headerName, + propertyName, + EchobaseCsvUtil.DOUBLE_PRIMITIVE + ); + } else if (Double.class.equals(type)) { + newColumnForImportExport( + headerName, + propertyName, + EchobaseCsvUtil.DOUBLE + ); + } else if (long.class.equals(type)) { + newColumnForImportExport( + headerName, + propertyName, + EchobaseCsvUtil.PRIMITIVE_LONG + ); + } else if (Long.class.equals(type)) { + newColumnForImportExport( + headerName, + propertyName, + EchobaseCsvUtil.LONG + ); + } else if (float.class.equals(type)) { + newColumnForImportExport( + headerName, + propertyName, + EchobaseCsvUtil.PRIMITIVE_FLOAT + ); + } else if (Float.class.equals(type)) { + newColumnForImportExport( + headerName, + propertyName, + EchobaseCsvUtil.FLOAT + ); + } else if (int.class.equals(type)) { + newColumnForImportExport( + headerName, + propertyName, + EchobaseCsvUtil.PRIMITIVE_INTEGER + ); + } else if (Integer.class.equals(type)) { + newColumnForImportExport( + headerName, + propertyName, + EchobaseCsvUtil.INTEGER + ); + } else if (boolean.class.equals(type)) { + newColumnForImportExport( + headerName, + propertyName, + EchobaseCsvUtil.PRIMITIVE_BOOLEAN + ); + } else if (Boolean.class.equals(type)) { + newColumnForImportExport( + headerName, + propertyName, + EchobaseCsvUtil.BOOLEAN + ); + } else { + + // string + newColumnForImportExport( + headerName, + propertyName + ); + } + } + + public static class ForeignKeyDecoratedValue<E> implements ValueFormatter<E> { + + protected final Decorator<E> decorator; + + public ForeignKeyDecoratedValue(Decorator<E> decorator) { + this.decorator = decorator; + } + + @Override + public String format(E e) { + String value = ""; + if (e != null) { + value = decorator.toString(e); + } + return value; + } + } + + protected EntityCsvModel(char separator, + TableMeta tableMeta) { + super(separator); + this.tableMeta = tableMeta; + } + + protected EntityCsvModel(char separator, + TableMeta tableMeta, + String idHeader) { + this(separator, tableMeta); + newColumnForImportExport( + idHeader, + TopiaEntity.TOPIA_ID + ); + } +} \ No newline at end of file Property changes on: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/csv/EntityCsvModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AbstractEchobaseActionConfiguration.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AbstractEchobaseActionConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AbstractEchobaseActionConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AbstractEchobaseActionConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,197 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services; + +import org.nuiton.util.StringUtil; + +import java.io.IOException; +import java.io.Serializable; + +/** + * Abstract long action configuration. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public abstract class AbstractEchobaseActionConfiguration implements Serializable, ProgressionModel { + + private static final long serialVersionUID = 1L; + + private final ProgressionModel progressionModel; + + private Exception error; + + protected AbstractEchobaseActionConfiguration() { + progressionModel = new DefaultProgressionModel(); + } + + protected AbstractEchobaseActionConfiguration(ProgressionModel progressionModel) { + this.progressionModel = progressionModel; + } + + @Override + public final long getNbSteps() { + return progressionModel.getNbSteps(); + } + + @Override + public final float getProgression() { + return progressionModel.getProgression(); + } + + @Override + public final void setProgression(float progression) { + progressionModel.setProgression(progression); + } + + @Override + public final void incrementsProgression() { + progressionModel.incrementsProgression(); + } + + @Override + public final void setNbSteps(long nbSteps) { + progressionModel.setNbSteps(nbSteps); + } + + @Override + public final long getStartTime() { + return progressionModel.getStartTime(); + } + + @Override + public final void setStartTime(long startTime) { + progressionModel.setStartTime(startTime); + } + + @Override + public final long getEndTime() { + return progressionModel.getEndTime(); + } + + @Override + public final void setEndTime(long endTime) { + progressionModel.setEndTime(endTime); + } + + public Exception getError() { + return error; + } + + public void setError(Exception error) { + this.error = error; + } + + @Override + public String getActionTime() { + return progressionModel.getActionTime(); + } + + public void beginAction() { + setStartTime(System.nanoTime()); + } + + public void endAction() { + setEndTime(System.nanoTime()); + } + + public void destroy() throws IOException { + } + + /** + * Default progression model implementation. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ + public static class DefaultProgressionModel implements ProgressionModel { + + private static final long serialVersionUID = 1L; + + private long nbSteps; + + private float stepIncrement; + + private float progression; + + private long startTime; + + private long endTime; + + @Override + public long getNbSteps() { + return nbSteps; + } + + @Override + public float getProgression() { + return progression; + } + + @Override + public void setProgression(float progression) { + this.progression = progression; + } + + @Override + public long getStartTime() { + return startTime; + } + + @Override + public void setStartTime(long startTime) { + this.startTime = startTime; + } + + @Override + public long getEndTime() { + return endTime; + } + + + @Override + public void setEndTime(long endTime) { + this.endTime = endTime; + } + + @Override + public final void incrementsProgression() { + setProgression(progression + stepIncrement); + } + + @Override + public final void setNbSteps(long nbSteps) { + + this.nbSteps = nbSteps; + stepIncrement = 100f / nbSteps; + } + + @Override + public String getActionTime() { + long sTime = getStartTime(); + long eTime = getEndTime(); + return StringUtil.convertTime(eTime - sTime); + } + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AbstractEchobaseActionConfiguration.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -27,13 +27,13 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import fr.ifremer.echobase.EchoBaseTechnicalException; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.EchoBaseEntityEnum; import fr.ifremer.echobase.entities.EchoBaseUser; import fr.ifremer.echobase.entities.EntityModificationLog; import fr.ifremer.echobase.entities.meta.ColumnMeta; import fr.ifremer.echobase.entities.meta.DbMeta; import fr.ifremer.echobase.entities.meta.TableMeta; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EmbeddedApplicationConfiguration.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/EmbeddedApplicationConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EmbeddedApplicationConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EmbeddedApplicationConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,103 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services; + +import org.apache.commons.io.FileUtils; + +import java.io.File; +import java.io.IOException; +import java.util.Arrays; + +/** + * Configuration of a embedded application creation. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class EmbeddedApplicationConfiguration extends AbstractEchobaseActionConfiguration { + + private static final long serialVersionUID = 1L; + + /** File name of the embedded application archive (without the zip extension). */ + private String fileName; + + /** Working directory where to generate the archive of embedded application. */ + private File workingDirectory; + + /** Embedded application archive file. */ + private File embeddedApplicationFile; + + /** Location of the war file to push in embedded application. */ + private File warLocation; + + /** Ids of voyages to push in embedded application (with all their datas). */ + private String[] voyageIds; + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public File getWorkingDirectory() { + return workingDirectory; + } + + public void setWorkingDirectory(File workingDirectory) { + this.workingDirectory = workingDirectory; + } + + public File getEmbeddedApplicationFile() { + return embeddedApplicationFile; + } + + public void setEmbeddedApplicationFile(File embeddedApplicationFile) { + this.embeddedApplicationFile = embeddedApplicationFile; + } + + public String[] getVoyageIds() { + return voyageIds; + } + + public void setVoyageIds(String[] voyageIds) { + this.voyageIds = Arrays.copyOf(voyageIds, voyageIds.length); + } + + public File getWarLocation() { + return warLocation; + } + + public void setWarLocation(File warLocation) { + this.warLocation = warLocation; + } + + @Override + public void destroy() throws IOException { + if (workingDirectory != null) { + FileUtils.deleteDirectory(workingDirectory); + } + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EmbeddedApplicationConfiguration.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EmbeddedApplicationService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EmbeddedApplicationService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EmbeddedApplicationService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -31,9 +31,6 @@ import fr.ifremer.echobase.entities.EchoBaseUser; import fr.ifremer.echobase.entities.EntitiesUtil; import fr.ifremer.echobase.entities.ExportQuery; -import fr.ifremer.echobase.services.configurations.EmbeddedApplicationConfiguration; -import fr.ifremer.echobase.services.configurations.ExportDbConfiguration; -import fr.ifremer.echobase.services.configurations.ImportDbConfiguration; import fr.ifremer.echobase.services.exceptions.ExportQueryNameAlreadyExistException; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportDbConfiguration.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ExportDbConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportDbConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportDbConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,96 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services; + +import org.apache.commons.io.FileUtils; + +import java.io.File; +import java.io.IOException; + +/** + * Configuration of a complete db export. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class ExportDbConfiguration extends AbstractEchobaseActionConfiguration { + + private static final long serialVersionUID = 1L; + + private String fileName; + + private File workingDirectory; + + private File exportFile; + + /** Ids of voyages to push in embedded application (with all their datas). */ + private String[] voyageIds; + + public ExportDbConfiguration() { + } + + public ExportDbConfiguration(ProgressionModel progressionModel) { + super(progressionModel); + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public File getWorkingDirectory() { + return workingDirectory; + } + + public void setWorkingDirectory(File workingDirectory) { + this.workingDirectory = workingDirectory; + } + + public File getExportFile() { + return exportFile; + } + + public void setExportFile(File exportFile) { + this.exportFile = exportFile; + } + + public String[] getVoyageIds() { + return voyageIds; + } + + public void setVoyageIds(String... voyageIds) { + this.voyageIds = voyageIds; + } + + @Override + public void destroy() throws IOException { + if (workingDirectory != null) { + FileUtils.deleteDirectory(workingDirectory); + } + } + +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportDbConfiguration.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportDbService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportDbService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportDbService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -31,7 +31,6 @@ import fr.ifremer.echobase.entities.meta.AssociationMeta; import fr.ifremer.echobase.entities.meta.MetaFilenameAware; import fr.ifremer.echobase.entities.meta.TableMeta; -import fr.ifremer.echobase.services.configurations.ExportDbConfiguration; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.util.FileUtil; Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportQueryService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportQueryService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportQueryService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -25,10 +25,11 @@ import com.google.common.base.Charsets; import fr.ifremer.echobase.EchoBaseTechnicalException; +import fr.ifremer.echobase.csv.AbstractExportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; import fr.ifremer.echobase.entities.EchoBaseUser; import fr.ifremer.echobase.entities.ExportQuery; import fr.ifremer.echobase.entities.ExportQueryImpl; -import fr.ifremer.echobase.services.csv.ExportQueryCsvModel; import fr.ifremer.echobase.services.exceptions.ExportQueryNameAlreadyExistException; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -295,4 +296,24 @@ } } + + /** + * Csv model to export sql in {@link ExportQueryService}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ + public static class ExportQueryCsvModel extends AbstractExportModel<Map<String, Object>> { + + public ExportQueryCsvModel(char separator, String[] columnHeaders) { + super(separator); + for (String columnHeader : columnHeaders) { + newColumnForExport( + columnHeader, + EchobaseCsvUtil.TO_STRING_FORMATTER + ); + } + } + + } } Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -25,11 +25,12 @@ import com.google.common.base.Charsets; import fr.ifremer.echobase.EchoBaseTechnicalException; +import fr.ifremer.echobase.csv.AbstractExportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.AssociationMeta; import fr.ifremer.echobase.entities.meta.ColumnMeta; import fr.ifremer.echobase.entities.meta.TableMeta; -import fr.ifremer.echobase.services.csv.EntityAssociationExportModel; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.topia.persistence.TopiaEntity; @@ -173,4 +174,37 @@ ExportModel<TopiaEntity> model = buildForExport(associationMeta); return Export.newExport(model, datas); } + + /** + * A model to export associations of entities into csv files. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ + public static class EntityAssociationExportModel<E extends TopiaEntity> extends AbstractExportModel<E> { + + protected final AssociationMeta meta; + + public static <E extends TopiaEntity> ExportModel<E> newExportModel(char separator, + AssociationMeta meta + ) { + EntityAssociationExportModel<E> model = new EntityAssociationExportModel<E>( + separator, + meta); + + // topiaId <-> topiaId + model.newColumnForExport(TopiaEntity.TOPIA_ID); + + model.newColumnForExport( + meta.getName(), + EchobaseCsvUtil.newAssociationValueFormatter() + ); + return model; + } + + protected EntityAssociationExportModel(char separator, AssociationMeta meta) { + super(separator); + this.meta = meta; + } + } } Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDbConfiguration.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ImportDbConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDbConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDbConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,78 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services; + +import fr.ifremer.echobase.InputFile; +import org.apache.commons.io.FileUtils; + +import java.io.File; +import java.io.IOException; +import java.util.Locale; + +import static org.nuiton.i18n.I18n.l_; + +/** + * Configuration of a import db operation. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class ImportDbConfiguration extends AbstractEchobaseActionConfiguration { + + private static final long serialVersionUID = 1L; + + protected File workingDirectory; + + protected final InputFile input; + + public ImportDbConfiguration(ProgressionModel progressionModel, + Locale locale) { + super(progressionModel); + input = InputFile.newFile(l_(locale, "echobase.common.importDbFile")); + } + + public ImportDbConfiguration(Locale locale) { + input = InputFile.newFile(l_(locale, "echobase.common.importDbFile")); + } + + public File getWorkingDirectory() { + return workingDirectory; + } + + public InputFile getInput() { + return input; + } + + public void setWorkingDirectory(File workingDirectory) { + this.workingDirectory = workingDirectory; + } + + @Override + public void destroy() throws IOException { + if (workingDirectory != null) { + FileUtils.deleteDirectory(workingDirectory); + } + } + +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDbConfiguration.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDbService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDbService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDbService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -33,7 +33,6 @@ import fr.ifremer.echobase.entities.meta.AssociationMeta; import fr.ifremer.echobase.entities.meta.MetaFilenameAware; import fr.ifremer.echobase.entities.meta.TableMeta; -import fr.ifremer.echobase.services.configurations.ImportDbConfiguration; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -24,14 +24,15 @@ package fr.ifremer.echobase.services; import fr.ifremer.echobase.EchoBaseTechnicalException; +import fr.ifremer.echobase.csv.AbstractImportModel; import fr.ifremer.echobase.csv.CsvImportResult; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.EchoBaseEntityEnum; import fr.ifremer.echobase.entities.EchoBaseUser; import fr.ifremer.echobase.entities.meta.AssociationMeta; import fr.ifremer.echobase.entities.meta.ColumnMeta; import fr.ifremer.echobase.entities.meta.TableMeta; -import fr.ifremer.echobase.services.csv.EntityAssociationImportModel; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.topia.persistence.TopiaEntity; @@ -145,4 +146,49 @@ } return result; } + + /** + * A model to import associations of entities into csv files. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ + public static class EntityAssociationImportModel extends AbstractImportModel<Map<String, Object>> { + + protected final AssociationMeta meta; + + public static ImportModel<Map<String, Object>> newImportModel(char separator, + AssociationMeta meta + ) { + EntityAssociationImportModel model = new EntityAssociationImportModel( + separator, meta); + + // topiaId <-> topiaId + model.newMandatoryColumn( + TopiaEntity.TOPIA_ID, + EchobaseCsvUtil.<Map<String, Object>, String>newMapProperty(TopiaEntity.TOPIA_ID) + ); + + // add association -> target + model.newMandatoryColumn( + meta.getName(), + EchobaseCsvUtil.ASSOCIATION_VALUE_PARSER, + EchobaseCsvUtil.<Map<String, Object>, String[]>newMapProperty("target") + ); + + return model; + } + + @Override + public Map<String, Object> newEmptyInstance() { + return null; + } + + protected EntityAssociationImportModel(char separator, + AssociationMeta meta) { + super(separator); + this.meta = meta; + } + + } } Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ProgressionModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ProgressionModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ProgressionModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ProgressionModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,55 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services; + +import java.io.Serializable; + +/** + * Cotnract for a progression model while long service actions. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public interface ProgressionModel extends Serializable { + + long getNbSteps(); + + float getProgression(); + + void setProgression(float progression); + + void incrementsProgression(); + + void setNbSteps(long nbSteps); + + long getStartTime(); + + void setStartTime(long startTime); + + long getEndTime(); + + void setEndTime(long endTime); + + String getActionTime(); +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ProgressionModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AbstractEchobaseActionConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AbstractEchobaseActionConfiguration.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AbstractEchobaseActionConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,119 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import java.io.IOException; -import java.io.Serializable; - -/** - * Abstract long action configuration. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public abstract class AbstractEchobaseActionConfiguration implements Serializable, ProgressionModel { - - private static final long serialVersionUID = 1L; - - private final ProgressionModel progressionModel; - - private Exception error; - - protected AbstractEchobaseActionConfiguration() { - progressionModel = new DefaultProgressionModel(); - } - - protected AbstractEchobaseActionConfiguration(ProgressionModel progressionModel) { - this.progressionModel = progressionModel; - } - - @Override - public final long getNbSteps() { - return progressionModel.getNbSteps(); - } - - @Override - public final float getProgression() { - return progressionModel.getProgression(); - } - - @Override - public final void setProgression(float progression) { - progressionModel.setProgression(progression); - } - - @Override - public final void incrementsProgression() { - progressionModel.incrementsProgression(); - } - - @Override - public final void setNbSteps(long nbSteps) { - progressionModel.setNbSteps(nbSteps); - } - - @Override - public final long getStartTime() { - return progressionModel.getStartTime(); - } - - @Override - public final void setStartTime(long startTime) { - progressionModel.setStartTime(startTime); - } - - @Override - public final long getEndTime() { - return progressionModel.getEndTime(); - } - - @Override - public final void setEndTime(long endTime) { - progressionModel.setEndTime(endTime); - } - - public Exception getError() { - return error; - } - - public void setError(Exception error) { - this.error = error; - } - - @Override - public String getActionTime() { - return progressionModel.getActionTime(); - } - - public void beginAction() { - setStartTime(System.nanoTime()); - } - - public void endAction() { - setEndTime(System.nanoTime()); - } - - public void destroy() throws IOException { - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AbstractImportConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AbstractImportConfiguration.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AbstractImportConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,66 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import fr.ifremer.echobase.EchoBaseIOUtil; -import fr.ifremer.echobase.InputFile; - -import java.io.File; - -/** - * Common import data configuration. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public abstract class AbstractImportConfiguration extends AbstractEchobaseActionConfiguration { - - private static final long serialVersionUID = 1L; - - protected File workingDirectory; - - public File getWorkingDirectory() { - return workingDirectory; - } - - public void setWorkingDirectory(File workingDirectory) { - this.workingDirectory = workingDirectory; - } - - public abstract InputFile[] getInputFiles(); - - public long computeNbSteps() { - long result = 0; - for (InputFile inputFile : getInputFiles()) { - - if (inputFile.hasFile()) { - int currentLines = EchoBaseIOUtil.countLines( - inputFile.getFile()); - result += currentLines; - } - } - setNbSteps(result); - return result; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AcousticDataImportConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AcousticDataImportConfiguration.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AcousticDataImportConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,267 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import fr.ifremer.echobase.InputFile; - -import java.util.Locale; - -import static org.nuiton.i18n.I18n.l_; - -/** - * Configuration of a "accoustic datas" import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class AcousticDataImportConfiguration extends AbstractImportConfiguration { - - private static final long serialVersionUID = 1L; - - /** Selected voyage id where to import datas. */ - protected String voyageId; - - /** Selected vessel id to find out transect where to import datas. */ - protected String vesselId; - - /** Flag to always add new dataAcquisition when a new instrument is found in movies file. */ - protected boolean addDataAcquisition = true; - - /** Manual transceiverAcquisitionAbsorptionDescription. */ - protected String transceiverAcquisitionAbsorptionDescription = "(i) Equation: Francois and garrison 1982,(ii) CTD, (iii) nominal value for entire data set"; - - /** Manual acquisitionSoftwareVersion (ER60 instrument). */ - protected String acquisitionSoftwareVersionER60; - - /** Manual acquisitionSoftwareVersion (ME70 instrument). */ - protected String acquisitionSoftwareVersionME70; - - /** Manual loggedDataFormat. */ - protected String loggedDataFormat = ".hac and .raw formats"; - - /** Manual loggedDataDatatype. */ - protected String loggedDataDatatype = "‘raw’ digitisation samples"; - - /** Manual pingDutyCycle. */ - protected String pingDutyCycle = "Ifremer's standard ping duty cycle"; - -// /** Manual echosounderSoundSpeed. */ -// protected String echosounderSoundSpeed = "Variable"; - - /** Manual soundSpeedCalculations (ER60 instrument). */ - protected String soundSpeedCalculationsER60 = "(i) Equation: Mackenzie (1980), (ii) CTD, (iii) nominal value for entire data set"; - - /** Manual soundSpeedCalculations (ME70 instrument). */ - protected String soundSpeedCalculationsME70 = "(i) Equation: Mackenzie (1980), (ii) Hull-mounted thermosalinometer, (iii) surface absorption value recomputed every 30s and applied to the entire data set"; - - /** Manual sounderConstant. */ - protected String sounderConstant = "NA"; - - /** Manual processingTemplate. */ - protected String processingTemplate; - - /** Manual processingDescription. */ - protected String processingDescription; - - /** Manual digitThreshold. */ - protected float digitThreshold = -100f; - - /** Manual acousticDensityUnit. */ - protected String acousticDensityUnit = "sA"; - - /** Manual notes. */ - protected String notes; - - /** Cell position reference for esdu cell datas. */ - protected CellPositionReference cellPositionReference; - - /** Movies file to import. */ - protected final InputFile moviesFile; - - - public AcousticDataImportConfiguration(Locale locale) { - moviesFile = InputFile.newFile(l_(locale, "echobase.common.moviesFile")); - } - - public String getVoyageId() { - return voyageId; - } - - public void setVoyageId(String voyageId) { - this.voyageId = voyageId; - } - - public String getVesselId() { - return vesselId; - } - - public void setVesselId(String vesselId) { - this.vesselId = vesselId; - } - - public boolean isAddDataAcquisition() { - return addDataAcquisition; - } - - public void setAddDataAcquisition(boolean addDataAcquisition) { - this.addDataAcquisition = addDataAcquisition; - } - - public String getTransceiverAcquisitionAbsorptionDescription() { - return transceiverAcquisitionAbsorptionDescription; - } - - public void setTransceiverAcquisitionAbsorptionDescription(String transceiverAcquisitionAbsorptionDescription) { - this.transceiverAcquisitionAbsorptionDescription = transceiverAcquisitionAbsorptionDescription; - } - - public String getAcquisitionSoftwareVersionER60() { - return acquisitionSoftwareVersionER60; - } - - public void setAcquisitionSoftwareVersionER60(String acquisitionSoftwareVersionER60) { - this.acquisitionSoftwareVersionER60 = acquisitionSoftwareVersionER60; - } - - public String getAcquisitionSoftwareVersionME70() { - return acquisitionSoftwareVersionME70; - } - - public void setAcquisitionSoftwareVersionME70(String acquisitionSoftwareVersionME70) { - this.acquisitionSoftwareVersionME70 = acquisitionSoftwareVersionME70; - } - - public String getLoggedDataFormat() { - return loggedDataFormat; - } - - public void setLoggedDataFormat(String loggedDataFormat) { - this.loggedDataFormat = loggedDataFormat; - } - - public String getLoggedDataDatatype() { - return loggedDataDatatype; - } - - public void setLoggedDataDatatype(String loggedDataDatatype) { - this.loggedDataDatatype = loggedDataDatatype; - } - - public String getPingDutyCycle() { - return pingDutyCycle; - } - - public void setPingDutyCycle(String pingDutyCycle) { - this.pingDutyCycle = pingDutyCycle; - } - -// public String getEchosounderSoundSpeed() { -// return echosounderSoundSpeed; -// } -// -// public void setEchosounderSoundSpeed(String echosounderSoundSpeed) { -// this.echosounderSoundSpeed = echosounderSoundSpeed; -// } - - public String getSoundSpeedCalculationsER60() { - return soundSpeedCalculationsER60; - } - - public void setSoundSpeedCalculationsER60(String soundSpeedCalculationsER60) { - this.soundSpeedCalculationsER60 = soundSpeedCalculationsER60; - } - - public String getSoundSpeedCalculationsME70() { - return soundSpeedCalculationsME70; - } - - public void setSoundSpeedCalculationsME70(String soundSpeedCalculationsME70) { - this.soundSpeedCalculationsME70 = soundSpeedCalculationsME70; - } - - public String getSounderConstant() { - return sounderConstant; - } - - public void setSounderConstant(String sounderConstant) { - this.sounderConstant = sounderConstant; - } - - public float getDigitThreshold() { - return digitThreshold; - } - - public void setDigitThreshold(float digitThreshold) { - this.digitThreshold = digitThreshold; - } - - public String getAcousticDensityUnit() { - return acousticDensityUnit; - } - - public void setAcousticDensityUnit(String acousticDensityUnit) { - this.acousticDensityUnit = acousticDensityUnit; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public InputFile getMoviesFile() { - return moviesFile; - } - - public String getProcessingTemplate() { - return processingTemplate; - } - - public void setProcessingTemplate(String processingTemplate) { - this.processingTemplate = processingTemplate; - } - - public String getProcessingDescription() { - return processingDescription; - } - - public void setProcessingDescription(String processingDescription) { - this.processingDescription = processingDescription; - } - - public CellPositionReference getCellPositionReference() { - return cellPositionReference; - } - - public void setCellPositionReference(CellPositionReference cellPositionReference) { - this.cellPositionReference = cellPositionReference; - } - - @Override - public InputFile[] getInputFiles() { - return new InputFile[]{moviesFile}; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesDataImportConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesDataImportConfiguration.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesDataImportConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,87 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import fr.ifremer.echobase.InputFile; - -import java.util.Locale; - -import static org.nuiton.i18n.I18n.l_; - -/** - * Configuration of a "catches data import". - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class CatchesDataImportConfiguration extends AbstractImportConfiguration { - - private static final long serialVersionUID = 1L; - - /** Selected voyage id where to import datas. */ - protected String voyageId; - - /** Sample file to import. */ - protected final InputFile totalSampleFile; - - /** Sub sample file to import. */ - protected final InputFile subSampleFile; - - /** Biometry sample file to import. */ - protected final InputFile biometrySampleFile; - - public CatchesDataImportConfiguration(Locale locale) { - totalSampleFile = InputFile.newFile( - l_(locale, "echobase.common.totalSampleFile")); - subSampleFile = InputFile.newFile( - l_(locale, "echobase.common.subSampleFile")); - biometrySampleFile = InputFile.newFile( - l_(locale, "echobase.common.biometrySampleFile")); - } - - public String getVoyageId() { - return voyageId; - } - - public void setVoyageId(String voyageId) { - this.voyageId = voyageId; - } - - public InputFile getTotalSampleFile() { - return totalSampleFile; - } - - public InputFile getSubSampleFile() { - return subSampleFile; - } - - public InputFile getBiometrySampleFile() { - return biometrySampleFile; - } - - @Override - public InputFile[] getInputFiles() { - return new InputFile[]{totalSampleFile, subSampleFile, biometrySampleFile}; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CellPositionReference.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CellPositionReference.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CellPositionReference.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,74 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import fr.ifremer.echobase.I18nAble; - -import static org.nuiton.i18n.I18n.n_; - -/** - * To define cell position reference in acoustic import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public enum CellPositionReference implements I18nAble { - - /** Begin. */ - START(n_("echobase.common.cellPositionReference.start")) { - @Override - public String getMetadataNameSuffix() { - return "Start"; - } - }, - - /** Mid. */ - MID(n_("echobase.common.cellPositionReference.mid")) { - @Override - public String getMetadataNameSuffix() { - return "Bary"; - } - }, - - /** End. */ - END(n_("echobase.common.cellPositionReference.end")) { - @Override - public String getMetadataNameSuffix() { - return "End"; - } - }; - - private final String i18nKey; - - CellPositionReference(String i18nKey) { - this.i18nKey = i18nKey; - } - - @Override - public String getI18nKey() { - return i18nKey; - } - - public abstract String getMetadataNameSuffix(); -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportConfiguration.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,186 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import fr.ifremer.echobase.InputFile; - -import java.util.Locale; - -import static org.nuiton.i18n.I18n.l_; - -/** - * Configuration of a "common data complete" import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class CommonDataImportConfiguration extends AbstractImportConfiguration { - - private static final long serialVersionUID = 1L; - - /** Selected import mode. */ - protected CommonDataImportMode importMode; - - /** Selected mission id to use in voyage. */ - protected String missionId; - - /** Selected voyage id to use (in mode 2). */ - protected String voyageId; - - /** Selected area of operation to use for voyage. */ - protected String areaOfOperationId; - - /** Manual description of voyage. */ - protected String voyageDescription; - - /** transit related activity. */ - protected String transitRelatedActivity; - - /** transect license. */ - protected String transectLicence; - - /** transect geospatialVerticalPositive. */ - protected String transectGeospatialVerticalPositive = "down"; - - /** transect binUnitsPingAxis. */ - protected String transectBinUnitsPingAxis = "1 nautical mile"; - - /** Manual datum to use in voyage. */ - protected String datum = "WGS84"; - - /** Voyage file to import. */ - protected final InputFile voyageFile; - - /** Transit file to import. */ - protected final InputFile transitFile; - - /** Transect file to import. */ - protected final InputFile transectFile; - - public CommonDataImportConfiguration(Locale locale) { - voyageFile = InputFile.newFile( - l_(locale, "echobase.common.voyageFile")); - transitFile = InputFile.newFile( - l_(locale, "echobase.common.transitFile")); - transectFile = InputFile.newFile( - l_(locale, "echobase.common.transectFile")); - } - - public CommonDataImportMode getImportMode() { - return importMode; - } - - public void setImportMode(CommonDataImportMode importMode) { - this.importMode = importMode; - } - - public String getMissionId() { - return missionId; - } - - public void setMissionId(String missionId) { - this.missionId = missionId; - } - - public String getAreaOfOperationId() { - return areaOfOperationId; - } - - public void setAreaOfOperationId(String areaOfOperationId) { - this.areaOfOperationId = areaOfOperationId; - } - - public String getVoyageId() { - return voyageId; - } - - public void setVoyageId(String voyageId) { - this.voyageId = voyageId; - } - - public String getVoyageDescription() { - return voyageDescription; - } - - public void setVoyageDescription(String voyageDescription) { - this.voyageDescription = voyageDescription; - } - - public String getDatum() { - return datum; - } - - public void setDatum(String datum) { - this.datum = datum; - } - - public String getTransitRelatedActivity() { - return transitRelatedActivity; - } - - public void setTransitRelatedActivity(String transitRelatedActivity) { - this.transitRelatedActivity = transitRelatedActivity; - } - - public String getTransectLicence() { - return transectLicence; - } - - public void setTransectLicence(String transectLicence) { - this.transectLicence = transectLicence; - } - - public String getTransectGeospatialVerticalPositive() { - return transectGeospatialVerticalPositive; - } - - public void setTransectGeospatialVerticalPositive(String transectGeospatialVerticalPositive) { - this.transectGeospatialVerticalPositive = transectGeospatialVerticalPositive; - } - - public String getTransectBinUnitsPingAxis() { - return transectBinUnitsPingAxis; - } - - public void setTransectBinUnitsPingAxis(String transectBinUnitsPingAxis) { - this.transectBinUnitsPingAxis = transectBinUnitsPingAxis; - } - - public InputFile getVoyageFile() { - return voyageFile; - } - - public InputFile getTransitFile() { - return transitFile; - } - - public InputFile getTransectFile() { - return transectFile; - } - - @Override - public InputFile[] getInputFiles() { - return new InputFile[]{voyageFile, transitFile, transectFile}; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportMode.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportMode.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportMode.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,54 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import fr.ifremer.echobase.I18nAble; - -import static org.nuiton.i18n.I18n.n_; - -/** - * To define common data import mode. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public enum CommonDataImportMode implements I18nAble { - - /** Import Voyage / Transit / Transect. */ - ALL(n_("echobase.common.commonDataImportMode.all")), - - /** Import all common data from Transect to Operation. */ - TRANSECT(n_("echobase.common.commonDataImportMode.transect")); - - private final String i18nKey; - - CommonDataImportMode(String i18nKey) { - this.i18nKey = i18nKey; - } - - @Override - public String getI18nKey() { - return i18nKey; - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/DefaultProgressionModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/DefaultProgressionModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/DefaultProgressionModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,102 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import org.nuiton.util.StringUtil; - -/** - * Default progression model implementation. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class DefaultProgressionModel implements ProgressionModel { - - private static final long serialVersionUID = 1L; - - private long nbSteps; - - private float stepIncrement; - - private float progression; - - private long startTime; - - private long endTime; - - @Override - public long getNbSteps() { - return nbSteps; - } - - @Override - public float getProgression() { - return progression; - } - - @Override - public void setProgression(float progression) { - this.progression = progression; - } - - @Override - public long getStartTime() { - return startTime; - } - - @Override - public void setStartTime(long startTime) { - this.startTime = startTime; - } - - @Override - public long getEndTime() { - return endTime; - } - - - @Override - public void setEndTime(long endTime) { - this.endTime = endTime; - } - - @Override - public final void incrementsProgression() { - setProgression(progression + stepIncrement); - } - - @Override - public final void setNbSteps(long nbSteps) { - - this.nbSteps = nbSteps; - stepIncrement = 100f / nbSteps; - } - - @Override - public String getActionTime() { - long sTime = getStartTime(); - long eTime = getEndTime(); - return StringUtil.convertTime(eTime - sTime); - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/EmbeddedApplicationConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/EmbeddedApplicationConfiguration.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/EmbeddedApplicationConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,103 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import org.apache.commons.io.FileUtils; - -import java.io.File; -import java.io.IOException; -import java.util.Arrays; - -/** - * Configuration of a embedded application creation. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class EmbeddedApplicationConfiguration extends AbstractEchobaseActionConfiguration { - - private static final long serialVersionUID = 1L; - - /** File name of the embedded application archive (without the zip extension). */ - private String fileName; - - /** Working directory where to generate the archive of embedded application. */ - private File workingDirectory; - - /** Embedded application archive file. */ - private File embeddedApplicationFile; - - /** Location of the war file to push in embedded application. */ - private File warLocation; - - /** Ids of voyages to push in embedded application (with all their datas). */ - private String[] voyageIds; - - public String getFileName() { - return fileName; - } - - public void setFileName(String fileName) { - this.fileName = fileName; - } - - public File getWorkingDirectory() { - return workingDirectory; - } - - public void setWorkingDirectory(File workingDirectory) { - this.workingDirectory = workingDirectory; - } - - public File getEmbeddedApplicationFile() { - return embeddedApplicationFile; - } - - public void setEmbeddedApplicationFile(File embeddedApplicationFile) { - this.embeddedApplicationFile = embeddedApplicationFile; - } - - public String[] getVoyageIds() { - return voyageIds; - } - - public void setVoyageIds(String[] voyageIds) { - this.voyageIds = Arrays.copyOf(voyageIds, voyageIds.length); - } - - public File getWarLocation() { - return warLocation; - } - - public void setWarLocation(File warLocation) { - this.warLocation = warLocation; - } - - @Override - public void destroy() throws IOException { - if (workingDirectory != null) { - FileUtils.deleteDirectory(workingDirectory); - } - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ExportDbConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ExportDbConfiguration.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ExportDbConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,96 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import org.apache.commons.io.FileUtils; - -import java.io.File; -import java.io.IOException; - -/** - * Configuration of a complete db export. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class ExportDbConfiguration extends AbstractEchobaseActionConfiguration { - - private static final long serialVersionUID = 1L; - - private String fileName; - - private File workingDirectory; - - private File exportFile; - - /** Ids of voyages to push in embedded application (with all their datas). */ - private String[] voyageIds; - - public ExportDbConfiguration() { - } - - public ExportDbConfiguration(ProgressionModel progressionModel) { - super(progressionModel); - } - - public String getFileName() { - return fileName; - } - - public void setFileName(String fileName) { - this.fileName = fileName; - } - - public File getWorkingDirectory() { - return workingDirectory; - } - - public void setWorkingDirectory(File workingDirectory) { - this.workingDirectory = workingDirectory; - } - - public File getExportFile() { - return exportFile; - } - - public void setExportFile(File exportFile) { - this.exportFile = exportFile; - } - - public String[] getVoyageIds() { - return voyageIds; - } - - public void setVoyageIds(String... voyageIds) { - this.voyageIds = voyageIds; - } - - @Override - public void destroy() throws IOException { - if (workingDirectory != null) { - FileUtils.deleteDirectory(workingDirectory); - } - } - -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ImportDbConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ImportDbConfiguration.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ImportDbConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,78 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import fr.ifremer.echobase.InputFile; -import org.apache.commons.io.FileUtils; - -import java.io.File; -import java.io.IOException; -import java.util.Locale; - -import static org.nuiton.i18n.I18n.l_; - -/** - * Configuration of a import db operation. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class ImportDbConfiguration extends AbstractEchobaseActionConfiguration { - - private static final long serialVersionUID = 1L; - - protected File workingDirectory; - - protected final InputFile input; - - public ImportDbConfiguration(ProgressionModel progressionModel, - Locale locale) { - super(progressionModel); - input = InputFile.newFile(l_(locale, "echobase.common.importDbFile")); - } - - public ImportDbConfiguration(Locale locale) { - input = InputFile.newFile(l_(locale, "echobase.common.importDbFile")); - } - - public File getWorkingDirectory() { - return workingDirectory; - } - - public InputFile getInput() { - return input; - } - - public void setWorkingDirectory(File workingDirectory) { - this.workingDirectory = workingDirectory; - } - - @Override - public void destroy() throws IOException { - if (workingDirectory != null) { - FileUtils.deleteDirectory(workingDirectory); - } - } - -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/OperationImportConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/OperationImportConfiguration.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/OperationImportConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,89 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import fr.ifremer.echobase.InputFile; - -import java.util.Locale; - -import static org.nuiton.i18n.I18n.l_; - -/** - * Configuration of a "operation" import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class OperationImportConfiguration extends AbstractImportConfiguration { - - private static final long serialVersionUID = 1L; - - /** Selected voyage id where to import datas. */ - protected String voyageId; - - /** operation file to import. */ - protected final InputFile operationFile; - - /** operation metadatas file to import. */ - protected final InputFile operationMetadataFile; - - /** gear metadatas file to import. */ - protected final InputFile gearMetadataFile; - - public OperationImportConfiguration(Locale locale) { - operationFile = InputFile.newFile( - l_(locale, "echobase.common.operationFile")); - operationMetadataFile = InputFile.newFile( - l_(locale, "echobase.common.operationMetadataFile")); - gearMetadataFile = InputFile.newFile( - l_(locale, "echobase.common.gearMetadataFile")); - } - - public String getVoyageId() { - return voyageId; - } - - public void setVoyageId(String voyageId) { - this.voyageId = voyageId; - } - - public InputFile getOperationFile() { - return operationFile; - } - - public InputFile getOperationMetadataFile() { - return operationMetadataFile; - } - - public InputFile getGearMetadataFile() { - return gearMetadataFile; - } - - @Override - public InputFile[] getInputFiles() { - return new InputFile[]{operationFile, - operationMetadataFile, - gearMetadataFile}; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ProgressionModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ProgressionModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ProgressionModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,55 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import java.io.Serializable; - -/** - * Cotnract for a progression model while long service actions. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public interface ProgressionModel extends Serializable { - - long getNbSteps(); - - float getProgression(); - - void setProgression(float progression); - - void incrementsProgression(); - - void setNbSteps(long nbSteps); - - long getStartTime(); - - void setStartTime(long startTime); - - long getEndTime(); - - void setEndTime(long endTime); - - String getActionTime(); -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportConfiguration.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,207 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import fr.ifremer.echobase.InputFile; - -import java.util.Locale; - -import static org.nuiton.i18n.I18n.l_; - -/** - * Configuration of a "results" import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class ResultsImportConfiguration extends AbstractImportConfiguration { - - private static final long serialVersionUID = 1L; - - /** Selected voyage id where to import datas. */ - protected String voyageId; - - /** Selected vessel id to find out transect where to import datas. */ - protected String vesselId; - - /** resultLabel to store while importing acoustic result. */ - protected String resultLabel; - - /** Type of import. */ - protected ResultsImportMode importMode; - - /** Acoustic result by echotype import. */ - protected final InputFile acousticByEchotypeFile; - - /** Acoustic result by echotype and species category import. */ - protected final InputFile acousticByEchotypeAndSpeciesCategoryFile; - - /** Acoustic result by species and size category import. */ - protected final InputFile acousticBySpeciesAndSizeCategoryFile; - - /** Acoustic result by species and age category import. */ - protected final InputFile acousticBySpeciesAndAgeCategoryFile; - - /** Region file to import. */ - protected final InputFile regionsFile; - - /** Region cell associations file to import. */ - protected final InputFile regionAssociationFile; - - /** Region cell results file to import. */ - protected final InputFile regionResultFile; - - /** Map cells file to import. */ - protected final InputFile mapsFile; - - /** Map cell results file to import. */ - protected final InputFile mapResultFile; - - /** Echotype file to import. */ - protected final InputFile echotypeFile; - - /** LengthAgeKey file to import. */ - protected final InputFile lengthAgeKeyFile; - - /** LengthWeightKey file to import. */ - protected final InputFile lengthWeightKeyFile; - - public ResultsImportConfiguration(Locale locale) { - regionsFile = InputFile.newFile( - l_(locale, "echobase.common.cellRegionsFile")); - regionAssociationFile = InputFile.newFile( - l_(locale, "echobase.common.cellRegionAssociationFile")); - regionResultFile = InputFile.newFile( - l_(locale, "echobase.common.cellRegionResultFile")); - mapsFile = InputFile.newFile( - l_(locale, "echobase.common.cellMapsFile")); - mapResultFile = InputFile.newFile( - l_(locale, "echobase.common.cellMapResultFile")); - echotypeFile = InputFile.newFile( - l_(locale, "echobase.common.echotypeFile")); - lengthAgeKeyFile = InputFile.newFile( - l_(locale, "echobase.common.lengthAgeKeyFile")); - lengthWeightKeyFile = InputFile.newFile( - l_(locale, "echobase.common.lengthWeightKeyFile")); - acousticByEchotypeFile = InputFile.newFile( - l_(locale, "echobase.common.acousticByEchotypeFile")); - acousticByEchotypeAndSpeciesCategoryFile = InputFile.newFile( - l_(locale, "echobase.common.acousticByEchotypeAndSpeciesCategoryFile")); - acousticBySpeciesAndSizeCategoryFile = InputFile.newFile( - l_(locale, "echobase.common.acousticBySpeciesAndSizeCategoryFile")); - acousticBySpeciesAndAgeCategoryFile = InputFile.newFile( - l_(locale, "echobase.common.acousticBySpeciesAndAgeCategoryFile")); - } - - public String getVoyageId() { - return voyageId; - } - - public void setVoyageId(String voyageId) { - this.voyageId = voyageId; - } - - public String getVesselId() { - return vesselId; - } - - public void setVesselId(String vesselId) { - this.vesselId = vesselId; - } - - public ResultsImportMode getImportMode() { - return importMode; - } - - public void setImportMode(ResultsImportMode importMode) { - this.importMode = importMode; - } - - public String getResultLabel() { - return resultLabel; - } - - public void setResultLabel(String resultLabel) { - this.resultLabel = resultLabel; - } - - public InputFile getRegionsFile() { - return regionsFile; - } - - public InputFile getRegionAssociationFile() { - return regionAssociationFile; - } - - public InputFile getRegionResultFile() { - return regionResultFile; - } - - public InputFile getMapsFile() { - return mapsFile; - } - - public InputFile getMapResultFile() { - return mapResultFile; - } - - public InputFile getEchotypeFile() { - return echotypeFile; - } - - public InputFile getLengthAgeKeyFile() { - return lengthAgeKeyFile; - } - - public InputFile getLengthWeightKeyFile() { - return lengthWeightKeyFile; - } - - public InputFile getAcousticByEchotypeFile() { - return acousticByEchotypeFile; - } - - public InputFile getAcousticByEchotypeAndSpeciesCategoryFile() { - return acousticByEchotypeAndSpeciesCategoryFile; - } - - public InputFile getAcousticBySpeciesAndSizeCategoryFile() { - return acousticBySpeciesAndSizeCategoryFile; - } - - public InputFile getAcousticBySpeciesAndAgeCategoryFile() { - return acousticBySpeciesAndAgeCategoryFile; - } - - @Override - public InputFile[] getInputFiles() { - return new InputFile[]{regionsFile, regionAssociationFile, regionResultFile, - mapsFile, mapResultFile, echotypeFile, - lengthAgeKeyFile, lengthWeightKeyFile, - acousticByEchotypeFile, - acousticByEchotypeAndSpeciesCategoryFile, - acousticBySpeciesAndSizeCategoryFile, - acousticBySpeciesAndAgeCategoryFile}; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportMode.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportMode.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportMode.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,69 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.configurations; - -import fr.ifremer.echobase.I18nAble; - -import static org.nuiton.i18n.I18n.n_; - -/** - * To define results import mode. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public enum ResultsImportMode implements I18nAble { - - /** Import results at voyage level. */ - VOYAGE(n_("echobase.common.resultsImportMode.voyage")), - - /** Import cells Region. */ - REGION(n_("echobase.common.resultsImportMode.region")), - - /** Import cells Map. */ - MAP(n_("echobase.common.resultsImportMode.map")), - - /** Import acoustic results by echotype. */ - ACOUSTIC_BY_ECHOTYPE(n_("echobase.common.resultsImportMode.acoustic.byEchotype")), - - /** Import acoustic results by echotype and species category. */ - ACOUSTIC_BY_ECHOTYPE_AND_SPECIES_CATEGORY(n_("echobase.common.resultsImportMode.acoustic.byEchotypeAndSpeciesCategory")), - - /** Import acoustic results by species and size category. */ - ACOUSTIC_BY_SPECIES_AND_SIZE_CATEGORY(n_("echobase.common.resultsImportMode.acoustic.bySpeciesAndSizeCategory")), - - /** Import acoustic results by species and age category. */ - ACOUSTIC_BY_SPECIES_AND_AGE_CATEGORY(n_("echobase.common.resultsImportMode.acoustic.bySpeciesAndAgeCategory")); - - private final String i18nKey; - - ResultsImportMode(String i18nKey) { - this.i18nKey = i18nKey; - } - - @Override - public String getI18nKey() { - return i18nKey; - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,164 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.Cell; -import fr.ifremer.echobase.entities.data.Data; -import fr.ifremer.echobase.entities.data.DataAcquisition; -import fr.ifremer.echobase.entities.data.DataProcessing; -import fr.ifremer.echobase.entities.references.AcousticInstrument; - -import java.util.Map; - -/** - * To import acoustic datas (says {@link DataAcquisition}, - * {@link DataProcessing}, {@link Cell} and {@link Data}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class AcousticDataImportModel extends AbstractImportModel<AcousticDataImportModelRow> { - - - /* -ESDU Data - -Latitude MOVIES_EILayer\\cellset\\lat, OK -Longitude MOVIES_EILayer\\cellset\\long OK -depth MOVIES_EILayer\\shipnav\\depth OK -timeStart MOVIES_EILayer\\cellset\\datestart OK -timeEnd MOVIES_EILayer\\cellset\\dateend OK -NASC MOVIES_EILayer\\eilayer\\sa OK -Volume MOVIES_EILayer\\cellset\\volume OK -Surface MOVIES_EILayer\\cellset\\area OK -NumberOfSamplesRecorded MOVIES_EILayer\\cellset\\nt OK -NumberOfSamplesEchoIntegrated MOVIES_EILayer\\cellset\\ni"OK - - -Elementary Data - -Latitude MOVIES_EILayer\\cellset\\lat -Longitude MOVIES_EILayer\\cellset\\long -depthStart (surface ou bottom) MOVIES_EILayer\\cellset\\depthstart -depthEnd (surface ou bottom) MOVIES_EILayer\\cellset\\depthend -timeStart MOVIES_EILayer\\cellset\\datestart -timeEnd MOVIES_EILayer\\cellset\\dateend -NASC MOVIES_EILayer\\eilayer\\sa -Volume MOVIES_EILayer\\cellset\\volume -Surface MOVIES_EILayer\\cellset\\area -NumberOfSamplesRecorded MOVIES_EILayer\\cellset\\nt -NumberOfSamplesEchoIntegrated MOVIES_EILayer\\cellset\\ni -minEIthr MOVIES_EILayer\cellset\thresholdlow -maxEIthr MOVIES_EILayer\cellset\thresholdup - */ - public AcousticDataImportModel(char separator, - Map<String, AcousticInstrument> instrumentsById) { - super(separator); - - newMandatoryColumn("MOVIES_EILayer", AcousticDataImportModelRow.PROPERTY_EI_LAYER);//A - newIgnoredColumn("MOVIES_EILayer\\sndset");//B - newIgnoredColumn("MOVIES_EILayer\\sndset\\sndname");//C - newIgnoredColumn("MOVIES_EILayer\\sndset\\sndident");//D - newForeignKeyColumn("MOVIES_EILayer\\sndset\\softChannelId", AcousticDataImportModelRow.PROPERTY_ACOUSTIC_INSTRUMENT, AcousticInstrument.class, AcousticInstrument.PROPERTY_ID, instrumentsById); //E - newIgnoredColumn("MOVIES_EILayer\\sndset\\channelName");//F - newIgnoredColumn("MOVIES_EILayer\\sndset\\dataType");//G - newIgnoredColumn("MOVIES_EILayer\\sndset\\beamType");//H - newIgnoredColumn("MOVIES_EILayer\\sndset\\acousticFrequency");//I - newIgnoredColumn("MOVIES_EILayer\\sndset\\startSample");//J - newIgnoredColumn("MOVIES_EILayer\\sndset\\mainBeamAlongSteeringAngle");//K - newIgnoredColumn("MOVIES_EILayer\\sndset\\mainBeamAthwartSteeringAngle");//L - newMandatoryColumn("MOVIES_EILayer\\sndset\\absorptionCoef", AcousticDataImportModelRow.PROPERTY_TRANSCEIVER_ACQUISITION_ABSORPTION, EchobaseCsvUtil.FLOAT);//M - newMandatoryColumn("MOVIES_EILayer\\sndset\\transmissionPower", AcousticDataImportModelRow.PROPERTY_TRANSCEIVER_ACQUISITION_POWER, EchobaseCsvUtil.INTEGER);//N - newMandatoryColumn("MOVIES_EILayer\\sndset\\beamAlongAngleSensitivity", AcousticDataImportModelRow.PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ALONGSHIP, EchobaseCsvUtil.FLOAT);//O - newMandatoryColumn("MOVIES_EILayer\\sndset\\beamAthwartAngleSensitivity", AcousticDataImportModelRow.PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ATHWARTSHIP, EchobaseCsvUtil.FLOAT);//P - newIgnoredColumn("MOVIES_EILayer\\sndset\\beam3dBWidthAlong");//Q - newIgnoredColumn("MOVIES_EILayer\\sndset\\beam3dBWidthAthwart");//R - newMandatoryColumn("MOVIES_EILayer\\sndset\\beamEquTwoWayAngle", AcousticDataImportModelRow.PROPERTY_TRANSDUCER_ACQUISITION_PSI, EchobaseCsvUtil.FLOAT);//S - newMandatoryColumn("MOVIES_EILayer\\sndset\\beamGain", AcousticDataImportModelRow.PROPERTY_TRANSCEIVER_ACQUISITION_GAIN, EchobaseCsvUtil.FLOAT);//T - newMandatoryColumn("MOVIES_EILayer\\sndset\\beamSACorrection", AcousticDataImportModelRow.PROPERTY_TRANSCEIVER_ACQUISITION_SACORRECTION, EchobaseCsvUtil.FLOAT);//U - newIgnoredColumn("MOVIES_EILayer\\sndset\\bottomDetectionMinDepth");//V - newIgnoredColumn("MOVIES_EILayer\\sndset\\bottomDetectionMaxDepth");//W - newIgnoredColumn("MOVIES_EILayer\\sndset\\bottomDetectionMinLevel");//X - newIgnoredColumn("MOVIES_EILayer\\sndset\\AlongTXRXWeightId");//Y - newIgnoredColumn("MOVIES_EILayer\\sndset\\AthwartTXRXWeightId");//Z - newIgnoredColumn("MOVIES_EILayer\\sndset\\SplitBeamAlongTXRXWeightId");//AA - newIgnoredColumn("MOVIES_EILayer\\sndset\\SplitBeamAthwartTXRXWeightId");//AB - newIgnoredColumn("MOVIES_EILayer\\sndset\\bandWidth");//AC - newIgnoredColumn("MOVIES_EILayer\\sndset\\tvgminrange");//AD - newIgnoredColumn("MOVIES_EILayer\\sndset\\tvgmaxrange");//AE - newMandatoryColumn("MOVIES_EILayer\\sndset\\pulseduration", AcousticDataImportModelRow.PROPERTY_TRANSCEIVER_ACQUISITION_PULSE_LENGTH, EchobaseCsvUtil.FLOAT);//AF - newIgnoredColumn("MOVIES_EILayer\\shipnav");//AG - newIgnoredColumn("MOVIES_EILayer\\shipnav\\lat");//AH - newIgnoredColumn("MOVIES_EILayer\\shipnav\\long");//AI - newIgnoredColumn("MOVIES_EILayer\\shipnav\\alt");//AJ - newIgnoredColumn("MOVIES_EILayer\\shipnav\\gndspeed");//AK - newIgnoredColumn("MOVIES_EILayer\\shipnav\\gndcourse");//AL - newIgnoredColumn("MOVIES_EILayer\\shipnav\\surfspeed");//AM - newIgnoredColumn("MOVIES_EILayer\\shipnav\\surfcourse");//AN - newIgnoredColumn("MOVIES_EILayer\\shipnav\\driftspeed");//AO - newIgnoredColumn("MOVIES_EILayer\\shipnav\\driftcourse");//AP - newIgnoredColumn("MOVIES_EILayer\\shipnav\\heading");//AQ - newIgnoredColumn("MOVIES_EILayer\\shipnav\\roll");//AR - newIgnoredColumn("MOVIES_EILayer\\shipnav\\pitch");//AS - newIgnoredColumn("MOVIES_EILayer\\shipnav\\heave");//AT - newMandatoryColumn("MOVIES_EILayer\\shipnav\\depth", AcousticDataImportModelRow.PROPERTY_ESDU_CELL_DATA_DEPTH);//AU - newIgnoredColumn("MOVIES_EILayer\\shipnav\\draught");//AV - - // Cell elementary Datas - newIgnoredColumn("MOVIES_EILayer\\cellset");//AW - newMandatoryColumn("MOVIES_EILayer\\cellset\\cellnum", AcousticDataImportModelRow.PROPERTY_CELL_NUM, EchobaseCsvUtil.PRIMITIVE_INTEGER);//AX - newMandatoryColumn("MOVIES_EILayer\\cellset\\celltype", AcousticDataImportModelRow.PROPERTY_CELL_TYPE, EchobaseCsvUtil.PRIMITIVE_INTEGER);//AY - newMandatoryColumn("MOVIES_EILayer\\cellset\\depthstart", AcousticDataImportModelRow.PROPERTY_CELL_DEPTH_START, EchobaseCsvUtil.PRIMITIVE_FLOAT);//AZ - newMandatoryColumn("MOVIES_EILayer\\cellset\\depthend", AcousticDataImportModelRow.PROPERTY_CELL_DEPTH_END, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BA - newIgnoredColumn("MOVIES_EILayer\\cellset\\indexstart");//BB - newIgnoredColumn("MOVIES_EILayer\\cellset\\indexend");//BC - newMandatoryColumn("MOVIES_EILayer\\cellset\\datestart", AcousticDataImportModelRow.PROPERTY_CELL_DATE_START, EchobaseCsvUtil.IMPORT_DAY_TIME3);//BD - newMandatoryColumn("MOVIES_EILayer\\cellset\\dateend", AcousticDataImportModelRow.PROPERTY_CELL_DATE_END, EchobaseCsvUtil.IMPORT_DAY_TIME3);//BE - - newMandatoryColumn("MOVIES_EILayer\\cellset\\lat", AcousticDataImportModelRow.PROPERTY_CELL_LATITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BF - newMandatoryColumn("MOVIES_EILayer\\cellset\\long", AcousticDataImportModelRow.PROPERTY_CELL_LONGITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BG - newMandatoryColumn("MOVIES_EILayer\\cellset\\volume", AcousticDataImportModelRow.PROPERTY_CELL_VOLUME, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BH - newMandatoryColumn("MOVIES_EILayer\\cellset\\area", AcousticDataImportModelRow.PROPERTY_CELL_SURFACE, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BI - newIgnoredColumn("MOVIES_EILayer\\cellset\\diststart");//BJ - newIgnoredColumn("MOVIES_EILayer\\cellset\\distend");//BK - newMandatoryColumn("MOVIES_EILayer\\cellset\\thresholdup", AcousticDataImportModelRow.PROPERTY_E_ITHRESHOLD_HIGH, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BL - newMandatoryColumn("MOVIES_EILayer\\cellset\\thresholdlow", AcousticDataImportModelRow.PROPERTY_E_ITHRESHOLD_LOW, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BM - newIgnoredColumn("MOVIES_EILayer\\eilayer");//BN - newMandatoryColumn("MOVIES_EILayer\\eilayer\\sa", AcousticDataImportModelRow.PROPERTY_CELL_NASC, EchobaseCsvUtil.NA_TO_FLOAT_PARSER);//BO - newIgnoredColumn("MOVIES_EILayer\\eilayer\\sv");//BP - newMandatoryColumn("MOVIES_EILayer\\eilayer\\ni", AcousticDataImportModelRow.PROPERTY_CELL_NUMBER_OF_SAMPLES_ECHO_INTEGRATED, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BQ - newMandatoryColumn("MOVIES_EILayer\\eilayer\\nt", AcousticDataImportModelRow.PROPERTY_CELL_NUMBER_OF_SAMPLES_RECORDED, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BR - newIgnoredColumn("MOVIES_EILayer\\boterr");//BR - newIgnoredColumn("MOVIES_EILayer\\boterr\\sa");//BT - newIgnoredColumn("MOVIES_EILayer\\boterr\\ni");//BU - newMandatoryColumn("MOVIES_EILayer\\sndset\\soundcelerity", AcousticDataImportModelRow.PROPERTY_SOUND_CELERITY);//BV - } - - @Override - public AcousticDataImportModelRow newEmptyInstance() { - return new AcousticDataImportModelRow(); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,365 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.references.AcousticInstrument; - -import java.util.Date; - -/** - * Bean of a row for {@link AcousticDataImportModel} import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class AcousticDataImportModelRow { - - public static final String PROPERTY_ACOUSTIC_INSTRUMENT = "acousticInstrument"; - - public static final String PROPERTY_EI_LAYER = "eiLayer"; - - public static final String PROPERTY_CELL_TYPE = "cellType"; - - public static final String PROPERTY_CELL_NUM = "cellNum"; - - public static final String PROPERTY_ESDU_CELL_DATA_DEPTH = "esduCellDataDepth"; - - public static final String PROPERTY_CELL_DATE_START = "cellDateStart"; - - public static final String PROPERTY_CELL_DATE_END = "cellDateEnd"; - - public static final String PROPERTY_CELL_DEPTH_START = "cellDepthStart"; - - public static final String PROPERTY_CELL_DEPTH_END = "cellDepthEnd"; - - public static final String PROPERTY_CELL_NASC = "cellNasc"; - - public static final String PROPERTY_TRANSCEIVER_ACQUISITION_PULSE_LENGTH = "transceiverAcquisitionPulseLength"; - - public static final String PROPERTY_TRANSCEIVER_ACQUISITION_GAIN = "transceiverAcquisitionGain"; - - public static final String PROPERTY_TRANSCEIVER_ACQUISITION_ABSORPTION = "transceiverAcquisitionAbsorption"; - - public static final String PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ATHWARTSHIP = "transducerAcquisitionBeamAngleAthwartship"; - - public static final String PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ALONGSHIP = "transducerAcquisitionBeamAngleAlongship"; - - public static final String PROPERTY_TRANSDUCER_ACQUISITION_PSI = "transducerAcquisitionPsi"; - - public static final String PROPERTY_TRANSCEIVER_ACQUISITION_POWER = "transceiverAcquisitionPower"; - - public static final String PROPERTY_TRANSCEIVER_ACQUISITION_SACORRECTION = "transceiverAcquisitionSacorrection"; - - public static final String PROPERTY_E_ITHRESHOLD_LOW = "eIThresholdLow"; - - public static final String PROPERTY_E_ITHRESHOLD_HIGH = "eIThresholdHigh"; - - public static final String PROPERTY_CELL_VOLUME = "cellVolume"; - - public static final String PROPERTY_CELL_SURFACE = "cellSurface"; - - public static final String PROPERTY_CELL_NUMBER_OF_SAMPLES_RECORDED = "cellNumberOfSamplesRecorded"; - - public static final String PROPERTY_CELL_NUMBER_OF_SAMPLES_ECHO_INTEGRATED = "cellNumberOfSamplesEchoIntegrated"; - - public static final String PROPERTY_SOUND_CELERITY = "soundCelerity"; - - public static final String PROPERTY_CELL_LATITUDE = "cellLatitude"; - - public static final String PROPERTY_CELL_LONGITUDE = "cellLongitude"; - - protected String eiLayer; - - protected String esduCellDataDepth; - - protected Date cellDateStart; - - protected Date cellDateEnd; - - protected float cellLatitude; - - protected float cellLongitude; - - protected Float cellVolume; - - protected int cellSurface; - - protected Integer cellNumberOfSamplesRecorded; - - protected Integer cellNumberOfSamplesEchoIntegrated; - - protected int cellType; - - protected int cellNum; - - protected float cellDepthStart; - - protected float cellDepthEnd; - - protected Float cellNasc; - - protected float transceiverAcquisitionPulseLength; - - protected float transceiverAcquisitionGain; - - protected float transceiverAcquisitionAbsorption; - - protected float transceiverAcquisitionPower; - - protected float transceiverAcquisitionSacorrection; - - protected float transducerAcquisitionBeamAngleAthwartship; - - protected float transducerAcquisitionBeamAngleAlongship; - - protected float transducerAcquisitionPsi; - - protected int eIThresholdLow; - - protected int eIThresholdHigh; - - protected String soundCelerity; - - protected AcousticInstrument acousticInstrument; - - public boolean isCellToAdd() { - return cellNasc != null; - } - - public String getEiLayer() { - return eiLayer; - } - - public void setEiLayer(String eiLayer) { - this.eiLayer = eiLayer; - } - - public AcousticInstrument getAcousticInstrument() { - return acousticInstrument; - } - - public void setAcousticInstrument(AcousticInstrument acousticInstrument) { - this.acousticInstrument = acousticInstrument; - } - - public Date getCellDateStart() { - return cellDateStart; - } - - public void setCellDateStart(Date cellDateStart) { - this.cellDateStart = cellDateStart; - } - - public int getCellType() { - return cellType; - } - - public void setCellType(int cellType) { - this.cellType = cellType; - } - - public int getCellNum() { - return cellNum; - } - - public void setCellNum(int cellNum) { - this.cellNum = cellNum; - } - - public String getEsduCellDataDepth() { - return esduCellDataDepth; - } - - public void setEsduCellDataDepth(String esduCellDataDepth) { - this.esduCellDataDepth = esduCellDataDepth; - } - - public float getCellDepthStart() { - return cellDepthStart; - } - - public void setCellDepthStart(float cellDepthStart) { - this.cellDepthStart = cellDepthStart; - } - - public float getCellDepthEnd() { - return cellDepthEnd; - } - - public void setCellDepthEnd(float cellDepthEnd) { - this.cellDepthEnd = cellDepthEnd; - } - - public Float getCellNasc() { - return cellNasc; - } - - public void setCellNasc(Float cellNasc) { - this.cellNasc = cellNasc; - } - - public float getTransceiverAcquisitionPulseLength() { - return transceiverAcquisitionPulseLength; - } - - public void setTransceiverAcquisitionPulseLength(float transceiverAcquisitionPulseLength) { - this.transceiverAcquisitionPulseLength = transceiverAcquisitionPulseLength; - } - - public float getTransceiverAcquisitionGain() { - return transceiverAcquisitionGain; - } - - public void setTransceiverAcquisitionGain(float transceiverAcquisitionGain) { - this.transceiverAcquisitionGain = transceiverAcquisitionGain; - } - - public float getTransceiverAcquisitionAbsorption() { - return transceiverAcquisitionAbsorption; - } - - public void setTransceiverAcquisitionAbsorption(float transceiverAcquisitionAbsorption) { - this.transceiverAcquisitionAbsorption = transceiverAcquisitionAbsorption; - } - - public float getTransceiverAcquisitionPower() { - return transceiverAcquisitionPower; - } - - public void setTransceiverAcquisitionPower(float transceiverAcquisitionPower) { - this.transceiverAcquisitionPower = transceiverAcquisitionPower; - } - - public float getTransceiverAcquisitionSacorrection() { - return transceiverAcquisitionSacorrection; - } - - public void setTransceiverAcquisitionSacorrection(float transceiverAcquisitionSacorrection) { - this.transceiverAcquisitionSacorrection = transceiverAcquisitionSacorrection; - } - - public float getTransducerAcquisitionBeamAngleAthwartship() { - return transducerAcquisitionBeamAngleAthwartship; - } - - public void setTransducerAcquisitionBeamAngleAthwartship(float transducerAcquisitionBeamAngleAthwartship) { - this.transducerAcquisitionBeamAngleAthwartship = transducerAcquisitionBeamAngleAthwartship; - } - - public float getTransducerAcquisitionBeamAngleAlongship() { - return transducerAcquisitionBeamAngleAlongship; - } - - public void setTransducerAcquisitionBeamAngleAlongship(float transducerAcquisitionBeamAngleAlongship) { - this.transducerAcquisitionBeamAngleAlongship = transducerAcquisitionBeamAngleAlongship; - } - - public float getTransducerAcquisitionPsi() { - return transducerAcquisitionPsi; - } - - public void setTransducerAcquisitionPsi(float transducerAcquisitionPsi) { - this.transducerAcquisitionPsi = transducerAcquisitionPsi; - } - - public float getCellLatitude() { - return cellLatitude; - } - - public void setCellLatitude(float cellLatitude) { - this.cellLatitude = cellLatitude; - } - - public float getCellLongitude() { - return cellLongitude; - } - - public void setCellLongitude(float cellLongitude) { - this.cellLongitude = cellLongitude; - } - - public int geteIThresholdLow() { - return eIThresholdLow; - } - - public void seteIThresholdLow(int eIThresholdLow) { - this.eIThresholdLow = eIThresholdLow; - } - - public int geteIThresholdHigh() { - return eIThresholdHigh; - } - - public void seteIThresholdHigh(int eIThresholdHigh) { - this.eIThresholdHigh = eIThresholdHigh; - } - - public Date getCellDateEnd() { - return cellDateEnd; - } - - public void setCellDateEnd(Date cellDateEnd) { - this.cellDateEnd = cellDateEnd; - } - - public Float getCellVolume() { - return cellVolume; - } - - public void setCellVolume(Float cellVolume) { - this.cellVolume = cellVolume; - } - - public int getCellSurface() { - return cellSurface; - } - - public void setCellSurface(int cellSurface) { - this.cellSurface = cellSurface; - } - - public Integer getCellNumberOfSamplesRecorded() { - return cellNumberOfSamplesRecorded; - } - - public void setCellNumberOfSamplesRecorded(Integer cellNumberOfSamplesRecorded) { - this.cellNumberOfSamplesRecorded = cellNumberOfSamplesRecorded; - } - - public Integer getCellNumberOfSamplesEchoIntegrated() { - return cellNumberOfSamplesEchoIntegrated; - } - - public void setCellNumberOfSamplesEchoIntegrated(Integer cellNumberOfSamplesEchoIntegrated) { - this.cellNumberOfSamplesEchoIntegrated = cellNumberOfSamplesEchoIntegrated; - } - - public String getSoundCelerity() { - return soundCelerity; - } - - public void setSoundCelerity(String soundCelerity) { - this.soundCelerity = soundCelerity; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeAndSpeciesCategoryImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeAndSpeciesCategoryImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeAndSpeciesCategoryImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,83 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.CellDAO; -import fr.ifremer.echobase.entities.data.Echotype; -import fr.ifremer.echobase.entities.data.Result; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.DataMetadata; -import fr.ifremer.echobase.entities.references.SizeCategory; -import fr.ifremer.echobase.entities.references.Species; - -import java.util.List; -import java.util.Map; - -/** - * Model to import {@link Result} for esdu cell and echotypes. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class AcousticResultByEchotypeAndSpeciesCategoryImportModel extends AbstractImportModel<AcousticResultByEchotypeAndSpeciesCategoryImportModelRow> { - - public static final String[] COLUMN_NAMES_TO_EXCLUDE = { - "name", - "baracoudaCode", - "sizeCategory", - AcousticResultByEchotypeImportModelRow.PROPERTY_ECHOTYPE - }; - - public AcousticResultByEchotypeAndSpeciesCategoryImportModel( - char separator, - Map<String, Echotype> echotypeMap, - Map<String, Species> speciesMap, - Map<String, SizeCategory> sizeCategoryMap, - Voyage voyage, - CellDAO cellDAO, - List<DataMetadata> dataMetadatas) { - super(separator); - - newForeignKeyColumn(AcousticResultByEchotypeAndSpeciesCategoryImportModelRow.PROPERTY_ECHOTYPE, Echotype.class, Echotype.PROPERTY_NAME, echotypeMap); - newForeignKeyColumn("baracoudaCode", AcousticResultByEchotypeAndSpeciesCategoryImportModelRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); - newForeignKeyColumn(AcousticResultByEchotypeAndSpeciesCategoryImportModelRow.PROPERTY_SIZE_CATEGORY, SizeCategory.class, SizeCategory.PROPERTY_NAME, sizeCategoryMap); - newMandatoryColumn("name", AcousticResultByEchotypeAndSpeciesCategoryImportModelRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, cellDAO)); - - for (DataMetadata metadata : dataMetadatas) { - String name = metadata.getName(); - newMandatoryColumn( - name, - EchobaseCsvUtil.newResultValueParser(metadata), - EchobaseCsvUtil.<AcousticResultByEchotypeAndSpeciesCategoryImportModelRow>newResultValueSetter()); - } - } - - @Override - public AcousticResultByEchotypeAndSpeciesCategoryImportModelRow newEmptyInstance() { - return new AcousticResultByEchotypeAndSpeciesCategoryImportModelRow(); - } - -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeAndSpeciesCategoryImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeAndSpeciesCategoryImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeAndSpeciesCategoryImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,104 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import com.google.common.collect.Lists; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.Cell; -import fr.ifremer.echobase.entities.data.Echotype; -import fr.ifremer.echobase.entities.data.Result; -import fr.ifremer.echobase.entities.references.SizeCategory; -import fr.ifremer.echobase.entities.references.Species; - -import java.util.List; - -/** - * Bean used as a row for import of - * {@link AcousticResultByEchotypeAndSpeciesCategoryImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class AcousticResultByEchotypeAndSpeciesCategoryImportModelRow implements EchobaseCsvUtil.ResultAble { - - public static final String PROPERTY_ECHOTYPE = "echotype"; - - public static final String PROPERTY_CELL = "cell"; - - public static final String PROPERTY_SPECIES = "species"; - - public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory"; - - protected Echotype echotype; - - protected Cell cell; - - protected List<Result> result = Lists.newArrayList(); - - protected Species species; - - private SizeCategory sizeCategory; - - public Echotype getEchotype() { - return echotype; - } - - public void setEchotype(Echotype echotype) { - this.echotype = echotype; - } - - public Cell getCell() { - return cell; - } - - public void setCell(Cell cell) { - this.cell = cell; - } - - public List<Result> getResult() { - return result; - } - - @Override - public void addResult(Result result) { - this.result.add(result); - } - - public Species getSpecies() { - return species; - } - - public void setSpecies(Species species) { - this.species = species; - } - - public SizeCategory getSizeCategory() { - return sizeCategory; - } - - public void setSizeCategory(SizeCategory sizeCategory) { - this.sizeCategory = sizeCategory; - } - -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,82 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import com.google.common.collect.Lists; -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.CellDAO; -import fr.ifremer.echobase.entities.data.Echotype; -import fr.ifremer.echobase.entities.data.Result; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.DataMetadata; -import org.nuiton.util.csv.ImportRuntimeException; - -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static org.nuiton.i18n.I18n.l_; - -/** - * Model to import {@link Result} for esdu cell and echotypes. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class AcousticResultByEchotypeImportModel extends AbstractImportModel<AcousticResultByEchotypeImportModelRow> { - - public static final String[] COLUMN_NAMES_TO_EXCLUDE = { - "name", - AcousticResultByEchotypeImportModelRow.PROPERTY_ECHOTYPE - }; - - public AcousticResultByEchotypeImportModel( - char separator, - Map<String, Echotype> echotypeMap, - Voyage voyage, - CellDAO cellDAO, - List<DataMetadata> dataMetadatas) { - super(separator); - - newForeignKeyColumn(AcousticResultByEchotypeImportModelRow.PROPERTY_ECHOTYPE, Echotype.class, Echotype.PROPERTY_NAME, echotypeMap); - newMandatoryColumn("name", AcousticResultByEchotypeImportModelRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, cellDAO)); - - for (DataMetadata metadata : dataMetadatas) { - String name = metadata.getName(); - newMandatoryColumn( - name, - EchobaseCsvUtil.newResultValueParser(metadata), - EchobaseCsvUtil.<AcousticResultByEchotypeImportModelRow>newResultValueSetter()); - } - } - - @Override - public AcousticResultByEchotypeImportModelRow newEmptyInstance() { - return new AcousticResultByEchotypeImportModelRow(); - } - -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,76 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import com.google.common.collect.Lists; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.Cell; -import fr.ifremer.echobase.entities.data.Echotype; -import fr.ifremer.echobase.entities.data.Result; - -import java.util.List; - -/** - * Bean used as a row for import of {@link AcousticResultByEchotypeImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class AcousticResultByEchotypeImportModelRow implements EchobaseCsvUtil.ResultAble { - - public static final String PROPERTY_ECHOTYPE = "echotype"; - - public static final String PROPERTY_CELL = "cell"; - - protected Echotype echotype; - - protected Cell cell; - - protected List<Result> result = Lists.newArrayList(); - - public Echotype getEchotype() { - return echotype; - } - - public void setEchotype(Echotype echotype) { - this.echotype = echotype; - } - - public Cell getCell() { - return cell; - } - - public void setCell(Cell cell) { - this.cell = cell; - } - - public List<Result> getResult() { - return result; - } - - @Override - public void addResult(Result result) { - this.result.add(result); - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndAgeCategoryImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndAgeCategoryImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndAgeCategoryImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,79 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.CellDAO; -import fr.ifremer.echobase.entities.data.Result; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.DataMetadata; -import fr.ifremer.echobase.entities.references.Species; - -import java.util.List; -import java.util.Map; - -/** - * Model to import {@link Result} for esdu cell and species and size category. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class AcousticResultBySpeciesAndAgeCategoryImportModel extends AbstractImportModel<AcousticResultBySpeciesAndAgeCategoryImportModelRow> { - - public static final String[] COLUMN_NAMES_TO_EXCLUDE = { - "name", - "baracoudaCode", - AcousticResultBySpeciesAndAgeCategoryImportModelRow.PROPERTY_AGE_CATEGORY, - AcousticResultBySpeciesAndAgeCategoryImportModelRow.PROPERTY_AGE_CATEGORY_MEANING, - }; - - public AcousticResultBySpeciesAndAgeCategoryImportModel( - char separator, - Map<String, Species> speciesMap, - Voyage voyage, - CellDAO cellDAO, - List<DataMetadata> dataMetadatas) { - super(separator); - - newMandatoryColumn("name", AcousticResultBySpeciesAndAgeCategoryImportModelRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, cellDAO)); - newMandatoryColumn(AcousticResultBySpeciesAndAgeCategoryImportModelRow.PROPERTY_AGE_CATEGORY); - newMandatoryColumn(AcousticResultBySpeciesAndAgeCategoryImportModelRow.PROPERTY_AGE_CATEGORY_MEANING); - newForeignKeyColumn("baracoudaCode", AcousticResultBySpeciesAndAgeCategoryImportModelRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); - - for (DataMetadata metadata : dataMetadatas) { - String name = metadata.getName(); - newMandatoryColumn( - name, - EchobaseCsvUtil.newResultValueParser(metadata), - EchobaseCsvUtil.<AcousticResultBySpeciesAndAgeCategoryImportModelRow>newResultValueSetter()); - } - } - - @Override - public AcousticResultBySpeciesAndAgeCategoryImportModelRow newEmptyInstance() { - return new AcousticResultBySpeciesAndAgeCategoryImportModelRow(); - } - -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndAgeCategoryImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndAgeCategoryImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndAgeCategoryImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,101 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import com.google.common.collect.Lists; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.Cell; -import fr.ifremer.echobase.entities.data.Result; -import fr.ifremer.echobase.entities.references.Species; - -import java.util.List; - -/** - * Bean used as a row for import of - * {@link AcousticResultBySpeciesAndAgeCategoryImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class AcousticResultBySpeciesAndAgeCategoryImportModelRow implements EchobaseCsvUtil.ResultAble { - - public static final String PROPERTY_CELL = "cell"; - - public static final String PROPERTY_SPECIES = "species"; - - public static final String PROPERTY_AGE_CATEGORY = "ageCategory"; - - public static final String PROPERTY_AGE_CATEGORY_MEANING = "ageCategoryMeaning"; - - protected Cell cell; - - protected List<Result> result = Lists.newArrayList(); - - protected Species species; - - private String ageCategory; - - private String ageCategoryMeaning; - - public Species getSpecies() { - return species; - } - - public void setSpecies(Species species) { - this.species = species; - } - - public Cell getCell() { - return cell; - } - - public void setCell(Cell cell) { - this.cell = cell; - } - - public String getAgeCategory() { - return ageCategory; - } - - public void setAgeCategory(String ageCategory) { - this.ageCategory = ageCategory; - } - - public String getAgeCategoryMeaning() { - return ageCategoryMeaning; - } - - public void setAgeCategoryMeaning(String ageCategoryMeaning) { - this.ageCategoryMeaning = ageCategoryMeaning; - } - - public List<Result> getResult() { - return result; - } - - @Override - public void addResult(Result result) { - this.result.add(result); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndSizeCategoryImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndSizeCategoryImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndSizeCategoryImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,79 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.CellDAO; -import fr.ifremer.echobase.entities.data.Result; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.DataMetadata; -import fr.ifremer.echobase.entities.references.Species; - -import java.util.List; -import java.util.Map; - -/** - * Model to import {@link Result} for esdu cell and species and size category. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class AcousticResultBySpeciesAndSizeCategoryImportModel extends AbstractImportModel<AcousticResultBySpeciesAndSizeCategoryImportModelRow> { - - public static final String[] COLUMN_NAMES_TO_EXCLUDE = { - "name", - "baracoudaCode", - AcousticResultBySpeciesAndSizeCategoryImportModelRow.PROPERTY_SIZE_CATEGORY, - AcousticResultBySpeciesAndSizeCategoryImportModelRow.PROPERTY_SIZE_CATEGORY_MEANING - }; - - public AcousticResultBySpeciesAndSizeCategoryImportModel( - char separator, - Map<String, Species> speciesMap, - Voyage voyage, - CellDAO cellDAO, - List<DataMetadata> dataMetadatas) { - super(separator); - - newMandatoryColumn("name", AcousticResultBySpeciesAndSizeCategoryImportModelRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, cellDAO)); - newMandatoryColumn(AcousticResultBySpeciesAndSizeCategoryImportModelRow.PROPERTY_SIZE_CATEGORY); - newMandatoryColumn(AcousticResultBySpeciesAndSizeCategoryImportModelRow.PROPERTY_SIZE_CATEGORY_MEANING); - newForeignKeyColumn("baracoudaCode", AcousticResultBySpeciesAndSizeCategoryImportModelRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); - - for (DataMetadata metadata : dataMetadatas) { - String name = metadata.getName(); - newMandatoryColumn( - name, - EchobaseCsvUtil.newResultValueParser(metadata), - EchobaseCsvUtil.<AcousticResultBySpeciesAndSizeCategoryImportModelRow>newResultValueSetter()); - } - } - - @Override - public AcousticResultBySpeciesAndSizeCategoryImportModelRow newEmptyInstance() { - return new AcousticResultBySpeciesAndSizeCategoryImportModelRow(); - } - -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndSizeCategoryImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndSizeCategoryImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndSizeCategoryImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,101 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import com.google.common.collect.Lists; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.Cell; -import fr.ifremer.echobase.entities.data.Result; -import fr.ifremer.echobase.entities.references.Species; - -import java.util.List; - -/** - * Bean used as a row for import of - * {@link AcousticResultBySpeciesAndSizeCategoryImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class AcousticResultBySpeciesAndSizeCategoryImportModelRow implements EchobaseCsvUtil.ResultAble { - - public static final String PROPERTY_CELL = "cell"; - - public static final String PROPERTY_SPECIES = "species"; - - public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory"; - - public static final String PROPERTY_SIZE_CATEGORY_MEANING = "sizeCategoryMeaning"; - - protected Cell cell; - - protected List<Result> result = Lists.newArrayList(); - - protected Species species; - - private String sizeCategory; - - private String sizeCategoryMeaning; - - public Species getSpecies() { - return species; - } - - public void setSpecies(Species species) { - this.species = species; - } - - public Cell getCell() { - return cell; - } - - public void setCell(Cell cell) { - this.cell = cell; - } - - public String getSizeCategory() { - return sizeCategory; - } - - public void setSizeCategory(String sizeCategory) { - this.sizeCategory = sizeCategory; - } - - public String getSizeCategoryMeaning() { - return sizeCategoryMeaning; - } - - public void setSizeCategoryMeaning(String sizeCategoryMeaning) { - this.sizeCategoryMeaning = sizeCategoryMeaning; - } - - public List<Result> getResult() { - return result; - } - - @Override - public void addResult(Result result) { - this.result.add(result); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/BiometrySampleImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/BiometrySampleImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/BiometrySampleImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,72 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.Operation; -import fr.ifremer.echobase.entities.data.Sample; -import fr.ifremer.echobase.entities.data.SampleData; -import fr.ifremer.echobase.entities.references.SampleDataType; -import fr.ifremer.echobase.entities.references.Species; - -import java.util.Map; - -/** - * Model to import {@link Sample} of total biometry. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class BiometrySampleImportModel extends AbstractImportModel<BiometrySampleImportModelRow> { - - public BiometrySampleImportModel(char separator, Map<String, Operation> operationMap, - Map<String, Species> speciesMap, - Map<String, SampleDataType> sampleDataTypeMap) { - super(separator); - - /* - operationID - baracoudacode - numFish - dataLabel - dataValue - name - */ - - newForeignKeyColumn("operationID", BiometrySampleImportModelRow.PROPERTY_OPERATION, Operation.class, Operation.PROPERTY_ID, operationMap); - newForeignKeyColumn("baracoudacode", BiometrySampleImportModelRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); - - newMandatoryColumn(BiometrySampleImportModelRow.PROPERTY_NUM_FISH, EchobaseCsvUtil.PRIMITIVE_INTEGER); - - newForeignKeyColumn("name", SampleData.PROPERTY_SAMPLE_DATA_TYPE, SampleDataType.class, SampleDataType.PROPERTY_NAME, sampleDataTypeMap); - newMandatoryColumn(SampleData.PROPERTY_DATA_LABEL); - newMandatoryColumn(SampleData.PROPERTY_DATA_VALUE, EchobaseCsvUtil.NA_TO_FLOAT_PARSER); - } - - @Override - public BiometrySampleImportModelRow newEmptyInstance() { - return new BiometrySampleImportModelRow(); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/BiometrySampleImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/BiometrySampleImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/BiometrySampleImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,97 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.data.Operation; -import fr.ifremer.echobase.entities.data.SampleData; -import fr.ifremer.echobase.entities.data.SampleDataImpl; -import fr.ifremer.echobase.entities.references.SampleDataType; -import fr.ifremer.echobase.entities.references.Species; - -/** - * Bean used as a row for import of {@link BiometrySampleImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class BiometrySampleImportModelRow { - - public static final String PROPERTY_NUM_FISH = "numFish"; - - public static final String PROPERTY_OPERATION = "operation"; - - public static final String PROPERTY_SPECIES = "species"; - - protected final SampleData sampleData; - - protected Operation operation; - - protected Species species; - - protected int numFish; - - public BiometrySampleImportModelRow() { - sampleData = new SampleDataImpl(); - } - - public Operation getOperation() { - return operation; - } - - public void setOperation(Operation operation) { - this.operation = operation; - } - - public Species getSpecies() { - return species; - } - - public void setSpecies(Species species) { - this.species = species; - } - - public int getNumFish() { - return numFish; - } - - public void setNumFish(int numfish) { - this.numFish = numfish; - } - - public void setDataValue(Float dataValue) { - sampleData.setDataValue(dataValue); - } - - public void setSampleDataType(SampleDataType sampleDataType) { - sampleData.setSampleDataType(sampleDataType); - } - - public void setDataLabel(String dataLabel) { - sampleData.setDataLabel(dataLabel); - } - - public SampleData getSampleData() { - return sampleData; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,77 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.entities.data.Echotype; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.DepthStratum; -import fr.ifremer.echobase.entities.references.Species; - -import java.util.Map; - -/** - * Model to import echotypes. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class EchotypeImportModel extends AbstractImportModel<EchotypeImportModelRow> { - - protected final Map<String, Voyage> voyageMap; - - protected final Map<String, DepthStratum> depthStratumMap; - - protected final Map<String, Species> speciesMap; - - public EchotypeImportModel(char separator, - Map<String, Voyage> voyageMap, - Map<String, DepthStratum> depthStratumMap, - Map<String, Species> speciesMap) { - super(separator); - this.voyageMap = voyageMap; - this.depthStratumMap = depthStratumMap; - this.speciesMap = speciesMap; - - /* - voyage - echotypeName - DepthStratumID - meaning - baracoudacode - */ - - newMandatoryColumn("echotypeName", Echotype.PROPERTY_NAME); - newMandatoryColumn("meaning", Echotype.PROPERTY_MEANING); - newForeignKeyColumn(EchotypeImportModelRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, voyageMap); - newForeignKeyColumn("DepthStratumID", Echotype.PROPERTY_DEPTH_STRATUM, DepthStratum.class, DepthStratum.PROPERTY_ID, depthStratumMap); - newForeignKeyColumn("baracoudacode", Echotype.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); - - } - - @Override - public EchotypeImportModelRow newEmptyInstance() { - return new EchotypeImportModelRow(); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,81 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.data.Echotype; -import fr.ifremer.echobase.entities.data.EchotypeImpl; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.DepthStratum; -import fr.ifremer.echobase.entities.references.Species; - -import java.io.Serializable; - -/** - * Bean used as a row for import of {@link EchotypeImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class EchotypeImportModelRow implements Serializable { - - private static final long serialVersionUID = 1L; - - public static final String PROPERTY_VOYAGE = "voyage"; - - protected Voyage voyage; - - protected final Echotype echotype; - - public EchotypeImportModelRow() { - echotype = new EchotypeImpl(); - } - - public Voyage getVoyage() { - return voyage; - } - - public void setVoyage(Voyage voyage) { - this.voyage = voyage; - } - - public Echotype getEchotype() { - return echotype; - } - - public void setName(String name) { - echotype.setName(name); - } - - public void setMeaning(String meaning) { - echotype.setMeaning(meaning); - } - - public void setDepthStratum(DepthStratum depthStratum) { - echotype.setDepthStratum(depthStratum); - } - - public void setSpecies(Species species) { - echotype.addSpecies(species); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EntityAssociationExportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EntityAssociationExportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EntityAssociationExportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,65 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractExportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.meta.AssociationMeta; -import org.nuiton.topia.persistence.TopiaEntity; -import org.nuiton.util.csv.ExportModel; - -/** - * A model to export associations of entities into csv files. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class EntityAssociationExportModel<E extends TopiaEntity> extends AbstractExportModel<E> { - - protected final AssociationMeta meta; - - public static <E extends TopiaEntity> ExportModel<E> newExportModel(char separator, - AssociationMeta meta - ) { - EntityAssociationExportModel<E> model = new EntityAssociationExportModel<E>( - separator, - meta); - - // topiaId <-> topiaId - model.newColumnForExport(TopiaEntity.TOPIA_ID); - - model.newColumnForExport( - meta.getName(), - EchobaseCsvUtil.newAssociationValueFormatter() - ); - return model; - } - - protected EntityAssociationExportModel(char separator, AssociationMeta meta) { - super(separator); - this.meta = meta; - } - - -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EntityAssociationImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EntityAssociationImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EntityAssociationImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,78 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.meta.AssociationMeta; -import org.nuiton.topia.persistence.TopiaEntity; -import org.nuiton.util.csv.ImportModel; - -import java.util.Map; - -/** - * A model to import associations of entities into csv files. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class EntityAssociationImportModel extends AbstractImportModel<Map<String, Object>> { - - protected final AssociationMeta meta; - - public static ImportModel<Map<String, Object>> newImportModel(char separator, - AssociationMeta meta - ) { - EntityAssociationImportModel model = new EntityAssociationImportModel( - separator, meta); - - // topiaId <-> topiaId - model.newMandatoryColumn( - TopiaEntity.TOPIA_ID, - EchobaseCsvUtil.<Map<String, Object>, String>newMapProperty(TopiaEntity.TOPIA_ID) - ); - - // add association -> target - model.newMandatoryColumn( - meta.getName(), - EchobaseCsvUtil.ASSOCIATION_VALUE_PARSER, - EchobaseCsvUtil.<Map<String, Object>, String[]>newMapProperty("target") - ); - - return model; - } - - @Override - public Map<String, Object> newEmptyInstance() { - return null; - } - - protected EntityAssociationImportModel(char separator, - AssociationMeta meta) { - super(separator); - this.meta = meta; - } - - -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EntityCsvModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EntityCsvModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EntityCsvModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,256 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import com.google.common.base.Function; -import com.google.common.collect.Maps; -import fr.ifremer.echobase.EchoBaseFunctions; -import fr.ifremer.echobase.csv.AbstractImportExportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.meta.TableMeta; -import org.nuiton.topia.persistence.TopiaEntity; -import org.nuiton.util.csv.ValueFormatter; -import org.nuiton.util.decorator.Decorator; - -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.Map; - -/** - * A model to import / export entities into csv files. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class EntityCsvModel<E extends TopiaEntity> extends AbstractImportExportModel<E> { - - protected final TableMeta tableMeta; - - public static <E extends TopiaEntity> EntityCsvModel<E> newModel( - char separator, - TableMeta tableMeta - ) { - return new EntityCsvModel<E>(separator, tableMeta); - } - - public static <E extends TopiaEntity> EntityCsvModel<E> newModel( - char separator, - TableMeta tableMeta, - String idHeader - ) { - return new EntityCsvModel<E>(separator, tableMeta, idHeader); - } - - @Override - public E newEmptyInstance() { - return (E) tableMeta.newEntity(); - } - - public void addForeignKeyForExport(String propertyName, - Class<TopiaEntity> entityType) { - - Map<String, TopiaEntity> universe = Collections.emptyMap(); - - newColumnForExport( - propertyName, - EchobaseCsvUtil.newForeignKeyValue(entityType, - propertyName, - universe) - ); - } - - public <T> void addDecoratedForeignKeyForExport(String headerName, String propertyName, Decorator<T> decorator) { - modelBuilder.newColumnForExport(headerName, propertyName, - new ForeignKeyDecoratedValue<T>(decorator)); - } - - public <E extends TopiaEntity> void addForeignKeyForImport(String headerName, - String propertyName, - Class<E> entityType, - Collection<E> entities, - Function<E, String> transform) { - - Map<String, E> universe = Maps.uniqueIndex(entities, transform); - - newMandatoryColumn( - headerName, - propertyName, - EchobaseCsvUtil.newForeignKeyValue(entityType, - propertyName, - universe) - ); - } - - public <E extends TopiaEntity> void addForeignKeyForAssociationForImport(String headerName, - String propertyName, - Class<E> entityType, - Collection<E> entities, - Function<E, String> transform) { - - Map<String, E> universe = Maps.uniqueIndex(entities, transform); - - newMandatoryColumn( - headerName, - propertyName, - EchobaseCsvUtil.newForeignKeyValueAssociation(entityType, - propertyName, - universe) - ); - } - - public <E extends TopiaEntity> void addForeignKeyForImport(String propertyName, - Class<E> entityType, - Collection<E> entities) { - - Map<String, E> universe = Maps.uniqueIndex( - entities, EchoBaseFunctions.TO_TOPIAID); - - newMandatoryColumn( - propertyName, - EchobaseCsvUtil.newForeignKeyValue(entityType, - propertyName, - universe) - ); - } - - public void addDefaultColumn(String propertyName, - Class<?> type) { - addDefaultColumn(propertyName, propertyName, type); - } - - public void addDefaultColumn(String headerName, - String propertyName, - Class<?> type) { - - if (Date.class.equals(type)) { - newColumnForImportExport( - headerName, - propertyName, - EchobaseCsvUtil.DAY_TIME_SECOND_WITH_TIMESTAMP - ); - } else if (double.class.equals(type)) { - newColumnForImportExport( - headerName, - propertyName, - EchobaseCsvUtil.DOUBLE_PRIMITIVE - ); - } else if (Double.class.equals(type)) { - newColumnForImportExport( - headerName, - propertyName, - EchobaseCsvUtil.DOUBLE - ); - } else if (long.class.equals(type)) { - newColumnForImportExport( - headerName, - propertyName, - EchobaseCsvUtil.PRIMITIVE_LONG - ); - } else if (Long.class.equals(type)) { - newColumnForImportExport( - headerName, - propertyName, - EchobaseCsvUtil.LONG - ); - } else if (float.class.equals(type)) { - newColumnForImportExport( - headerName, - propertyName, - EchobaseCsvUtil.PRIMITIVE_FLOAT - ); - } else if (Float.class.equals(type)) { - newColumnForImportExport( - headerName, - propertyName, - EchobaseCsvUtil.FLOAT - ); - } else if (int.class.equals(type)) { - newColumnForImportExport( - headerName, - propertyName, - EchobaseCsvUtil.PRIMITIVE_INTEGER - ); - } else if (Integer.class.equals(type)) { - newColumnForImportExport( - headerName, - propertyName, - EchobaseCsvUtil.INTEGER - ); - } else if (boolean.class.equals(type)) { - newColumnForImportExport( - headerName, - propertyName, - EchobaseCsvUtil.PRIMITIVE_BOOLEAN - ); - } else if (Boolean.class.equals(type)) { - newColumnForImportExport( - headerName, - propertyName, - EchobaseCsvUtil.BOOLEAN - ); - } else { - - // string - newColumnForImportExport( - headerName, - propertyName - ); - } - } - - public static class ForeignKeyDecoratedValue<E> implements ValueFormatter<E> { - - protected final Decorator<E> decorator; - - public ForeignKeyDecoratedValue(Decorator<E> decorator) { - this.decorator = decorator; - } - - @Override - public String format(E e) { - String value = ""; - if (e != null) { - value = decorator.toString(e); - } - return value; - } - } - - protected EntityCsvModel(char separator, - TableMeta tableMeta) { - super(separator); - this.tableMeta = tableMeta; - } - - protected EntityCsvModel(char separator, - TableMeta tableMeta, - String idHeader) { - this(separator, tableMeta); - newColumnForImportExport( - idHeader, - TopiaEntity.TOPIA_ID - ); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/ExportQueryCsvModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/ExportQueryCsvModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/ExportQueryCsvModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,50 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractExportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.services.ExportQueryService; - -import java.util.Map; - -/** - * Csv model to export sql in {@link ExportQueryService}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class ExportQueryCsvModel extends AbstractExportModel<Map<String, Object>> { - - public ExportQueryCsvModel(char separator, String[] columnHeaders) { - super(separator); - for (String columnHeader : columnHeaders) { - newColumnForExport( - columnHeader, - EchobaseCsvUtil.TO_STRING_FORMATTER - ); - } - } - -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/GearMetadataValueImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/GearMetadataValueImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/GearMetadataValueImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,71 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.entities.data.GearMetadataValue; -import fr.ifremer.echobase.entities.data.Operation; -import fr.ifremer.echobase.entities.references.Gear; -import fr.ifremer.echobase.entities.references.GearMetadata; -import fr.ifremer.echobase.entities.references.Vessel; - -import java.util.Map; - -/** - * Model to import {@link GearMetadataValue}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class GearMetadataValueImportModel extends AbstractImportModel<GearMetadataValueImportModelRow> { - - public GearMetadataValueImportModel(char separator, - Map<String, Vessel> vesselMap, - Map<String, GearMetadata> gearMetadataMap, - Map<String, Gear> gearMap, - Map<String, Operation> operationMap) { - super(separator); - - /* - vesselName - id - gearID - metadataType - gearMetadataValue - */ - - newForeignKeyColumn("vesselName", GearMetadataValueImportModelRow.PROPERTY_VESSEL, Vessel.class, Vessel.PROPERTY_NAME, vesselMap); - newForeignKeyColumn("operationID", GearMetadataValueImportModelRow.PROPERTY_OPERATION, Operation.class, Operation.PROPERTY_ID, operationMap); - - newForeignKeyColumn("metadataType", GearMetadataValue.PROPERTY_GEAR_METADATA, GearMetadata.class, GearMetadata.PROPERTY_NAME, gearMetadataMap); - newForeignKeyColumn("gearCode", GearMetadataValue.PROPERTY_GEAR, Gear.class, Gear.PROPERTY_CASINO_GEAR_NAME, gearMap); - newMandatoryColumn("gearMetadataValue", GearMetadataValue.PROPERTY_DATA_VALUE); - - } - - @Override - public GearMetadataValueImportModelRow newEmptyInstance() { - return new GearMetadataValueImportModelRow(); - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/GearMetadataValueImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/GearMetadataValueImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/GearMetadataValueImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,87 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.data.GearMetadataValue; -import fr.ifremer.echobase.entities.data.GearMetadataValueImpl; -import fr.ifremer.echobase.entities.data.Operation; -import fr.ifremer.echobase.entities.data.Transect; -import fr.ifremer.echobase.entities.references.Gear; -import fr.ifremer.echobase.entities.references.GearMetadata; -import fr.ifremer.echobase.entities.references.Vessel; - -/** - * Bean used as a row for import of {@link GearMetadataValueImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class GearMetadataValueImportModelRow { - - public static final String PROPERTY_VESSEL = Transect.PROPERTY_VESSEL; - - public static final String PROPERTY_OPERATION = Transect.PROPERTY_OPERATION; - - protected Vessel vessel; - - protected Operation operation; - - protected final GearMetadataValue gearMetadataValue; - - public GearMetadataValueImportModelRow() { - gearMetadataValue = new GearMetadataValueImpl(); - } - - public GearMetadataValue getGearMetadataValue() { - return gearMetadataValue; - } - - public void setGearMetadata(GearMetadata gearMetadata) { - gearMetadataValue.setGearMetadata(gearMetadata); - } - - public void setDataValue(String dataValue) { - gearMetadataValue.setDataValue(dataValue); - } - - public void setGear(Gear gear) { - gearMetadataValue.setGear(gear); - } - - public Operation getOperation() { - return operation; - } - - public void setOperation(Operation operation) { - this.operation = operation; - } - - public Vessel getVessel() { - return vessel; - } - - public void setVessel(Vessel vessel) { - this.vessel = vessel; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,72 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.LengthAgeKey; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.Species; -import fr.ifremer.echobase.entities.references.Strata; - -import java.util.Map; - -/** - * Model to import {@link LengthAgeKey}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class LengthAgeKeyImportModel extends AbstractImportModel<LengthAgeKeyImportModelRow> { - - protected final Map<String, Voyage> voyageMap; - - protected final Map<String, Strata> strataMap; - - protected final Map<String, Species> speciesMap; - - public LengthAgeKeyImportModel(char separator, - Map<String, Voyage> voyageMap, - Map<String, Strata> strataMap, - Map<String, Species> speciesMap) { - super(separator); - this.voyageMap = voyageMap; - this.strataMap = strataMap; - this.speciesMap = speciesMap; - - newForeignKeyColumn(LengthAgeKeyImportModelRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, voyageMap); - - newMandatoryColumn(LengthAgeKey.PROPERTY_AGE, EchobaseCsvUtil.PRIMITIVE_INTEGER); - newMandatoryColumn(LengthAgeKey.PROPERTY_PERCENT_AT_AGE, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(LengthAgeKey.PROPERTY_LENGTH, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(LengthAgeKey.PROPERTY_METADATA); - newForeignKeyColumn(LengthAgeKey.PROPERTY_STRATA, Strata.class, Strata.PROPERTY_NAME, strataMap); - newForeignKeyColumn("baracoudacode", LengthAgeKey.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); - } - - @Override - public LengthAgeKeyImportModelRow newEmptyInstance() { - return new LengthAgeKeyImportModelRow(); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,89 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.data.LengthAgeKey; -import fr.ifremer.echobase.entities.data.LengthAgeKeyImpl; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.Species; -import fr.ifremer.echobase.entities.references.Strata; - -import java.io.Serializable; - -/** - * Bean used as a row for import of {@link LengthAgeKeyImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class LengthAgeKeyImportModelRow implements Serializable { - - private static final long serialVersionUID = 1L; - - public static final String PROPERTY_VOYAGE = "voyage"; - - protected Voyage voyage; - - protected final LengthAgeKey lengthAgeKey; - - public LengthAgeKeyImportModelRow() { - lengthAgeKey = new LengthAgeKeyImpl(); - } - - public LengthAgeKey getLengthAgeKey() { - return lengthAgeKey; - } - - public Voyage getVoyage() { - return voyage; - } - - public void setVoyage(Voyage voyage) { - this.voyage = voyage; - } - - public void setAge(int age) { - lengthAgeKey.setAge(age); - } - - public void setLength(float length) { - lengthAgeKey.setLength(length); - } - - public void setPercentAtAge(float percentAtAge) { - lengthAgeKey.setPercentAtAge(percentAtAge); - } - - public void setMetadata(String metadata) { - lengthAgeKey.setMetadata(metadata); - } - - public void setStrata(Strata strata) { - lengthAgeKey.setStrata(strata); - } - - public void setSpecies(Species species) { - lengthAgeKey.setSpecies(species); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,78 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.LengthWeightKey; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.SizeCategory; -import fr.ifremer.echobase.entities.references.Species; - -import java.util.Map; - -/** - * Model to import {@link LengthWeightKey}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class LengthWeightKeyImportModel extends AbstractImportModel<LengthWeightKeyImportModelRow> { - - protected final Map<String, Voyage> voyageMap; - - protected final Map<String, SizeCategory> sizeCategoryMap; - - protected final Map<String, Species> speciesMap; - - public LengthWeightKeyImportModel(char separator, - Map<String, Voyage> voyageMap, - Map<String, SizeCategory> sizeCategoryMap, - Map<String, Species> speciesMap) { - super(separator); - this.voyageMap = voyageMap; - this.sizeCategoryMap = sizeCategoryMap; - this.speciesMap = speciesMap; - - /* - voyage - sizeCategory - aParameter - bParameter - codeMemo - */ - - newMandatoryColumn("aParameter", LengthWeightKey.PROPERTY_APARAMETER, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn("bParameter", LengthWeightKey.PROPERTY_BPARAMETER, EchobaseCsvUtil.PRIMITIVE_FLOAT); - - newForeignKeyColumn(LengthWeightKeyImportModelRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, voyageMap); - newForeignKeyColumn(LengthWeightKeyImportModelRow.PROPERTY_SIZE_CATEGORY, SizeCategory.class, SizeCategory.PROPERTY_NAME, sizeCategoryMap); - newForeignKeyColumn("baracoudacode", LengthWeightKeyImportModelRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); - } - - @Override - public LengthWeightKeyImportModelRow newEmptyInstance() { - return new LengthWeightKeyImportModelRow(); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,97 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.data.LengthWeightKey; -import fr.ifremer.echobase.entities.data.LengthWeightKeyImpl; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.SizeCategory; -import fr.ifremer.echobase.entities.references.Species; - -import java.io.Serializable; - -/** - * Bean used as a row for import of {@link LengthWeightKeyImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class LengthWeightKeyImportModelRow implements Serializable { - - private static final long serialVersionUID = 1L; - - public static final String PROPERTY_VOYAGE = "voyage"; - - public static final String PROPERTY_SPECIES = "species"; - - public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory"; - - protected Species species; - - protected SizeCategory sizeCategory; - - protected Voyage voyage; - - protected final LengthWeightKey lengthWeightKey; - - public LengthWeightKeyImportModelRow() { - lengthWeightKey = new LengthWeightKeyImpl(); - } - - public LengthWeightKey getLengthWeightKey() { - return lengthWeightKey; - } - - public Species getSpecies() { - return species; - } - - public void setSpecies(Species species) { - this.species = species; - } - - public SizeCategory getSizeCategory() { - return sizeCategory; - } - - public void setSizeCategory(SizeCategory sizeCategory) { - this.sizeCategory = sizeCategory; - } - - public Voyage getVoyage() { - return voyage; - } - - public void setVoyage(Voyage voyage) { - this.voyage = voyage; - } - - public void setBParameter(float BParameter) { - lengthWeightKey.setBParameter(BParameter); - } - - public void setAParameter(float AParameter) { - lengthWeightKey.setAParameter(AParameter); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,44 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; - -/** - * TODO - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class MapImportModel extends AbstractImportModel<MapImportModelRow> { - - public MapImportModel(char separator) { - super(separator); - } - - @Override - public MapImportModelRow newEmptyInstance() { - return new MapImportModelRow(); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,33 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -/** - * TODO - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class MapImportModelRow { -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,44 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; - -/** - * TODO - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class MapResultImportModel extends AbstractImportModel<MapResultImportModelRow> { - - public MapResultImportModel(char separator) { - super(separator); - } - - @Override - public MapResultImportModelRow newEmptyInstance() { - return new MapResultImportModelRow(); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,33 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -/** - * TODO - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class MapResultImportModelRow { -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,82 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.Operation; -import fr.ifremer.echobase.entities.references.DepthStratum; -import fr.ifremer.echobase.entities.references.Gear; -import fr.ifremer.echobase.entities.references.Vessel; - -import java.util.Map; - -/** - * Model to import {@link Operation}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class OperationImportModel extends AbstractImportModel<OperationImportModelRow> { - - public OperationImportModel(char separator, - Map<String, Vessel> vesselMap, - Map<String, Gear> gearMap, - Map<String, DepthStratum> depthStratumMap) { - super(separator); - - /* - vesselName // - id // - depthStratumID // - gearShootingStartTime // - midHaulLatitude // - midHaulLongitude // - gearShootingStartLatitude // - gearShootingStartLongitude // - gearShootingEndTime // - gearShootingEndLatitude // - gearShootingEndLongitude // - gearName // - */ - newForeignKeyColumn("vesselName", OperationImportModelRow.PROPERTY_VESSEL, Vessel.class, Vessel.PROPERTY_NAME, vesselMap); - - newForeignKeyColumn("gearCode", Operation.PROPERTY_GEAR, Gear.class, Gear.PROPERTY_CASINO_GEAR_NAME, gearMap); - newForeignKeyColumn("depthStratumID", Operation.PROPERTY_DEPTH_STRATUM, DepthStratum.class, DepthStratum.PROPERTY_ID, depthStratumMap); - newMandatoryColumn("operationID", Operation.PROPERTY_ID); - newMandatoryColumn(Operation.PROPERTY_MID_HAUL_LATITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(Operation.PROPERTY_MID_HAUL_LONGITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(Operation.PROPERTY_GEAR_SHOOTING_START_TIME, EchobaseCsvUtil.DAY_TIME_SECOND); - newMandatoryColumn(Operation.PROPERTY_GEAR_SHOOTING_END_TIME, EchobaseCsvUtil.DAY_TIME_SECOND); - newMandatoryColumn(Operation.PROPERTY_GEAR_SHOOTING_START_LATITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(Operation.PROPERTY_GEAR_SHOOTING_END_LATITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(Operation.PROPERTY_GEAR_SHOOTING_START_LONGITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(Operation.PROPERTY_GEAR_SHOOTING_END_LONGITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT); - } - - @Override - public OperationImportModelRow newEmptyInstance() { - return new OperationImportModelRow(); - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,108 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.data.Operation; -import fr.ifremer.echobase.entities.data.OperationImpl; -import fr.ifremer.echobase.entities.data.Transect; -import fr.ifremer.echobase.entities.references.DepthStratum; -import fr.ifremer.echobase.entities.references.Gear; -import fr.ifremer.echobase.entities.references.Vessel; - -import java.util.Date; - -/** - * Bean used as a row for import of {@link OperationImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class OperationImportModelRow { - - public static final String PROPERTY_VESSEL = Transect.PROPERTY_VESSEL; - - protected Vessel vessel; - - protected final Operation operation; - - public OperationImportModelRow() { - operation = new OperationImpl(); - } - - public Operation getOperation() { - return operation; - } - - public Vessel getVessel() { - return vessel; - } - - public void setVessel(Vessel vessel) { - this.vessel = vessel; - } - - public void setId(String id) { - operation.setId(id); - } - - public void setGearShootingStartTime(Date gearShootingStartTime) { - operation.setGearShootingStartTime(gearShootingStartTime); - } - - public void setGearShootingEndTime(Date gearShootingEndTime) { - operation.setGearShootingEndTime(gearShootingEndTime); - } - - public void setGearShootingStartLatitude(Float gearShootingStartLatitude) { - operation.setGearShootingStartLatitude(gearShootingStartLatitude); - } - - public void setGearShootingEndLatitude(Float gearShootingEndLatitude) { - operation.setGearShootingEndLatitude(gearShootingEndLatitude); - } - - public void setGearShootingStartLongitude(Float gearShootingStartLongitude) { - operation.setGearShootingStartLongitude(gearShootingStartLongitude); - } - - public void setGearShootingEndLongitude(Float gearShootingEndLongitude) { - operation.setGearShootingEndLongitude(gearShootingEndLongitude); - } - - public void setMidHaulLatitude(float midHauleLatitude) { - operation.setMidHaulLatitude(midHauleLatitude); - } - - public void setMidHaulLongitude(float midHauleLongitude) { - operation.setMidHaulLongitude(midHauleLongitude); - } - - public void setDepthStratum(DepthStratum depthStratum) { - operation.setDepthStratum(depthStratum); - } - - public void setGear(Gear gear) { - operation.setGear(gear); - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationMetadataValueImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationMetadataValueImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationMetadataValueImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,66 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.entities.data.Operation; -import fr.ifremer.echobase.entities.data.OperationMetadataValue; -import fr.ifremer.echobase.entities.references.OperationMetadata; -import fr.ifremer.echobase.entities.references.Vessel; - -import java.util.Map; - -/** - * Model to import {@link OperationMetadataValue}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class OperationMetadataValueImportModel extends AbstractImportModel<OperationMetadataValueImportModelRow> { - - public OperationMetadataValueImportModel(char separator, - Map<String, Vessel> vesselMap, - Map<String, OperationMetadata> operationMetadataMap, - Map<String, Operation> operationMap) { - super(separator); - - /* - vesselName/ - id/ - metadataType/ - operationMetadataValue/ - */ - - newForeignKeyColumn("vesselName", OperationMetadataValueImportModelRow.PROPERTY_VESSEL, Vessel.class, Vessel.PROPERTY_NAME, vesselMap); - newForeignKeyColumn("operationID", OperationMetadataValueImportModelRow.PROPERTY_OPERATION, Operation.class, Operation.PROPERTY_ID, operationMap); - - newForeignKeyColumn("metadataType", OperationMetadataValue.PROPERTY_OPERATION_METADATA, OperationMetadata.class, OperationMetadata.PROPERTY_NAME, operationMetadataMap); - newMandatoryColumn("operationMetadataValue", OperationMetadataValue.PROPERTY_DATA_VALUE); - } - - @Override - public OperationMetadataValueImportModelRow newEmptyInstance() { - return new OperationMetadataValueImportModelRow(); - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationMetadataValueImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationMetadataValueImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationMetadataValueImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,82 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.data.Operation; -import fr.ifremer.echobase.entities.data.OperationMetadataValue; -import fr.ifremer.echobase.entities.data.OperationMetadataValueImpl; -import fr.ifremer.echobase.entities.data.Transect; -import fr.ifremer.echobase.entities.references.OperationMetadata; -import fr.ifremer.echobase.entities.references.Vessel; - -/** - * Bean used as a row for import of {@link OperationMetadataValueImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class OperationMetadataValueImportModelRow { - - public static final String PROPERTY_VESSEL = Transect.PROPERTY_VESSEL; - - public static final String PROPERTY_OPERATION = Transect.PROPERTY_OPERATION; - - protected Operation operation; - - protected Vessel vessel; - - protected final OperationMetadataValue operationMetadataValue; - - public OperationMetadataValueImportModelRow() { - operationMetadataValue = new OperationMetadataValueImpl(); - } - - public OperationMetadataValue getOperationMetadataValue() { - return operationMetadataValue; - } - - public void setOperationMetadata(OperationMetadata operationMetadata) { - operationMetadataValue.setOperationMetadata(operationMetadata); - } - - public void setDataValue(String dataValue) { - operationMetadataValue.setDataValue(dataValue); - } - - public Operation getOperation() { - return operation; - } - - public void setOperation(Operation operation) { - this.operation = operation; - } - - public Vessel getVessel() { - return vessel; - } - - public void setVessel(Vessel vessel) { - this.vessel = vessel; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellAssociationImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellAssociationImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellAssociationImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,44 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; - -/** - * Model to import cells associations from region cells and esdu cells. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class RegionCellAssociationImportModel extends AbstractImportModel<RegionCellAssociationImportModelRow> { - - public RegionCellAssociationImportModel(char separator) { - super(separator); - } - - @Override - public RegionCellAssociationImportModelRow newEmptyInstance() { - return new RegionCellAssociationImportModelRow(); - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellAssociationImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellAssociationImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellAssociationImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,69 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.data.Cell; - -/** - * Bean used as a row for import of {@link RegionCellAssociationImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class RegionCellAssociationImportModelRow { - - protected Cell esduCell; - - protected Cell regionSurfaceCell; - - protected Cell regionBottomCell; - - public RegionCellAssociationImportModelRow() { - } - - - public Cell getEsduCell() { - return esduCell; - } - - public void setEsduCell(Cell esduCell) { - this.esduCell = esduCell; - } - - public Cell getRegionSurfaceCell() { - return regionSurfaceCell; - } - - public void setRegionSurfaceCell(Cell regionSurfaceCell) { - this.regionSurfaceCell = regionSurfaceCell; - } - - public Cell getRegionBottomCell() { - return regionBottomCell; - } - - public void setRegionBottomCell(Cell regionBottomCell) { - this.regionBottomCell = regionBottomCell; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,67 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.CellType; -import fr.ifremer.echobase.entities.references.DepthStratum; - -import java.util.Map; - -/** - * Model to import cells (with type "region"). - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class RegionCellImportModel extends AbstractImportModel<RegionCellImportModelRow> { - - protected final CellType cellType; - - public RegionCellImportModel(char separator, - CellType cellType, - Map<String, Voyage> voyageMap, - Map<String, DepthStratum> depthStramMap) { - super(separator); - this.cellType = cellType; - - newForeignKeyColumn(RegionCellImportModelRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, voyageMap); - newForeignKeyColumn(RegionCellImportModelRow.PROPERTY_DEPTH_STRATUM, DepthStratum.class, DepthStratum.PROPERTY_ID, depthStramMap); - - newMandatoryColumn(RegionCellImportModelRow.PROPERTY_NAME); - newMandatoryColumn("x", RegionCellImportModelRow.PROPERTY_DATA_X, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn("y", RegionCellImportModelRow.PROPERTY_DATA_Y, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn("z", RegionCellImportModelRow.PROPERTY_DATA_Z, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn("surface", RegionCellImportModelRow.PROPERTY_DATA_SURFACE, EchobaseCsvUtil.PRIMITIVE_FLOAT); - } - - @Override - public RegionCellImportModelRow newEmptyInstance() { - RegionCellImportModelRow row = new RegionCellImportModelRow(); - row.getCell().setCellType(cellType); - return row; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,126 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.data.Cell; -import fr.ifremer.echobase.entities.data.CellImpl; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.DepthStratum; - -/** - * A row when import region cells using model {@link RegionCellImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class RegionCellImportModelRow { - - public static final String PROPERTY_NAME = "name"; - - public static final String PROPERTY_VOYAGE = "voyage"; - - public static final String PROPERTY_DEPTH_STRATUM = "depthStratum"; - - public static final String PROPERTY_DATA_X = "dataX"; - - public static final String PROPERTY_DATA_Y = "dataY"; - - public static final String PROPERTY_DATA_Z = "dataZ"; - - public static final String PROPERTY_DATA_SURFACE = "dataSurface"; - - protected Voyage voyage; - - protected DepthStratum depthStratum; - - protected final Cell cell; - - protected float dataX; - - protected float dataY; - - protected float dataZ; - - protected float dataSurface; - - public RegionCellImportModelRow() { - this.cell = new CellImpl(); - } - - public Cell getCell() { - return cell; - } - - public Voyage getVoyage() { - return voyage; - } - - public DepthStratum getDepthStratum() { - return depthStratum; - } - - public float getDataX() { - return dataX; - } - - public float getDataY() { - return dataY; - } - - public float getDataZ() { - return dataZ; - } - - public float getDataSurface() { - return dataSurface; - } - - public void setName(String name) { - getCell().setName(name); - } - - public void setVoyage(Voyage voyage) { - this.voyage = voyage; - } - - public void setDepthStratum(DepthStratum depthStratum) { - this.depthStratum = depthStratum; - } - - public void setDataX(float dataX) { - this.dataX = dataX; - } - - public void setDataY(float dataY) { - this.dataY = dataY; - } - - public void setDataZ(float dataZ) { - this.dataZ = dataZ; - } - - public void setDataSurface(float dataSurface) { - this.dataSurface = dataSurface; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,44 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; - -/** - * TODO - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class RegionResultImportModel extends AbstractImportModel<RegionResultImportModelRow> { - - public RegionResultImportModel(char separator) { - super(separator); - } - - @Override - public RegionResultImportModelRow newEmptyInstance() { - return new RegionResultImportModelRow(); - } -} \ No newline at end of file Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,33 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -/** - * TODO - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class RegionResultImportModelRow { -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/SubSampleImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/SubSampleImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/SubSampleImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,88 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.Operation; -import fr.ifremer.echobase.entities.data.Sample; -import fr.ifremer.echobase.entities.data.SampleData; -import fr.ifremer.echobase.entities.references.SexCategory; -import fr.ifremer.echobase.entities.references.SizeCategory; -import fr.ifremer.echobase.entities.references.Species; - -import java.util.Map; - -/** - * Model to import {@link SampleData}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class SubSampleImportModel extends AbstractImportModel<SubSampleImportModelRow> { - - public SubSampleImportModel(char separator, - Map<String, Operation> operationMap, - Map<String, Species> speciesMap, - Map<String, SizeCategory> sizeCategoryMap, - Map<String, SexCategory> sexCategoryMap) { - super(separator); - - /* - operationID - subHaul - baracoudacode - sizeCategory - sexCategory - sampleWeight - numberSampled - - numberAtLength - weightAtLength - units - round - */ - - newIgnoredColumn("subHaul"); - newIgnoredColumn("units"); - newIgnoredColumn("round"); - - newForeignKeyColumn("operationID", SubSampleImportModelRow.PROPERTY_OPERATION, Operation.class, Operation.PROPERTY_ID, operationMap); - newForeignKeyColumn("baracoudacode", SubSampleImportModelRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); - newForeignKeyColumn(SubSampleImportModelRow.PROPERTY_SIZE_CATEGORY, SizeCategory.class, SizeCategory.PROPERTY_NAME, sizeCategoryMap); - newForeignKeyColumn(SubSampleImportModelRow.PROPERTY_SEX_CATEGORY, SexCategory.class, SexCategory.PROPERTY_NAME, sexCategoryMap); - - newMandatoryColumn(Sample.PROPERTY_SAMPLE_WEIGHT, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(Sample.PROPERTY_NUMBER_SAMPLED, EchobaseCsvUtil.PRIMITIVE_INTEGER); - - newMandatoryColumn(SubSampleImportModelRow.PROPERTY_NUMBER_AT_LENGTH, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(SubSampleImportModelRow.PROPERTY_WEIGHT_AT_LENGTH, EchobaseCsvUtil.NA_TO_FLOAT_PARSER); - newMandatoryColumn(SubSampleImportModelRow.PROPERTY_LENGTH_CLASS); - } - - @Override - public SubSampleImportModelRow newEmptyInstance() { - return new SubSampleImportModelRow(); - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/SubSampleImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/SubSampleImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/SubSampleImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,145 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.data.Operation; -import fr.ifremer.echobase.entities.data.Sample; -import fr.ifremer.echobase.entities.data.SampleImpl; -import fr.ifremer.echobase.entities.references.SexCategory; -import fr.ifremer.echobase.entities.references.SizeCategory; -import fr.ifremer.echobase.entities.references.Species; - -/** - * Bean used as a row for import of {@link SubSampleImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class SubSampleImportModelRow { - - - public static final String PROPERTY_OPERATION = "operation"; - - public static final String PROPERTY_SPECIES = "species"; - - public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory"; - - public static final String PROPERTY_SEX_CATEGORY = "sexCategory"; - - public static final String PROPERTY_SAMPLE = "sample"; - - public static final String PROPERTY_NUMBER_AT_LENGTH = "numberAtLength"; - - public static final String PROPERTY_WEIGHT_AT_LENGTH = "weightAtLength"; - - public static final String PROPERTY_LENGTH_CLASS = "lengthClass"; - - protected Operation operation; - - protected Species species; - - protected SizeCategory sizeCategory; - - protected SexCategory sexCategory; - - protected final Sample sample; - - protected float numberAtLength; - - protected Float weightAtLength; - - protected String lengthClass; - - public SubSampleImportModelRow() { - sample = new SampleImpl(); - } - - public Sample getSample() { - return sample; - } - - public Operation getOperation() { - return operation; - } - - public void setOperation(Operation operation) { - this.operation = operation; - } - - public Species getSpecies() { - return species; - } - - public void setSpecies(Species species) { - this.species = species; - } - - public SizeCategory getSizeCategory() { - return sizeCategory; - } - - public void setSizeCategory(SizeCategory sizeCategory) { - this.sizeCategory = sizeCategory; - } - - public void setNumberSampled(Integer numberSampled) { - sample.setNumberSampled(numberSampled); - } - - public void setSampleWeight(Float sampleWeight) { - sample.setSampleWeight(sampleWeight); - } - - public SexCategory getSexCategory() { - return sexCategory; - } - - public void setSexCategory(SexCategory sexCategory) { - this.sexCategory = sexCategory; - } - - public float getNumberAtLength() { - return numberAtLength; - } - - public void setNumberAtLength(float numberAtLength) { - this.numberAtLength = numberAtLength; - } - - public Float getWeightAtLength() { - return weightAtLength; - } - - public void setWeightAtLength(Float weightAtLength) { - this.weightAtLength = weightAtLength; - } - - public String getLengthClass() { - return lengthClass; - } - - public void setLengthClass(String lengthClass) { - this.lengthClass = lengthClass; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TotalSampleImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TotalSampleImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TotalSampleImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,78 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.Operation; -import fr.ifremer.echobase.entities.data.Sample; -import fr.ifremer.echobase.entities.references.SizeCategory; -import fr.ifremer.echobase.entities.references.Species; - -import java.util.Map; - -/** - * Model to import {@link Sample} of total type. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class TotalSampleImportModel extends AbstractImportModel<TotalSampleImportModelRow> { - - public TotalSampleImportModel(char separator, - Map<String, Operation> operationMap, - Map<String, Species> speciesMap, - Map<String, SizeCategory> sizeCategoryMap) { - super(separator); - - /* - operationID - baracoudacode - sizeCategory - sampleWeight - numberSampled - meanLength - meanWeight - noPerKg - sortedWeight - */ - - newForeignKeyColumn("operationID", TotalSampleImportModelRow.PROPERTY_OPERATION, Operation.class, Operation.PROPERTY_ID, operationMap); - newForeignKeyColumn("baracoudacode", TotalSampleImportModelRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); - newForeignKeyColumn(TotalSampleImportModelRow.PROPERTY_SIZE_CATEGORY, SizeCategory.class, SizeCategory.PROPERTY_NAME, sizeCategoryMap); - - newMandatoryColumn(Sample.PROPERTY_SAMPLE_WEIGHT, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(Sample.PROPERTY_NUMBER_SAMPLED, EchobaseCsvUtil.NA_TO_INTEGER_PARSER); - - newMandatoryColumn(TotalSampleImportModelRow.PROPERTY_MEAN_LENGTH, EchobaseCsvUtil.NA_TO_FLOAT_PARSER); - newMandatoryColumn(TotalSampleImportModelRow.PROPERTY_MEAN_WEIGHT, EchobaseCsvUtil.NA_TO_FLOAT_PARSER); - newMandatoryColumn(TotalSampleImportModelRow.PROPERTY_NO_PER_KG, EchobaseCsvUtil.NA_TO_FLOAT_PARSER); - newMandatoryColumn(TotalSampleImportModelRow.PROPERTY_SORTED_WEIGHT, EchobaseCsvUtil.PRIMITIVE_FLOAT); - } - - @Override - public TotalSampleImportModelRow newEmptyInstance() { - return new TotalSampleImportModelRow(); - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TotalSampleImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TotalSampleImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TotalSampleImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,143 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.data.Operation; -import fr.ifremer.echobase.entities.data.Sample; -import fr.ifremer.echobase.entities.data.SampleImpl; -import fr.ifremer.echobase.entities.references.SizeCategory; -import fr.ifremer.echobase.entities.references.Species; - -/** - * Bean used as a row for import of {@link TotalSampleImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class TotalSampleImportModelRow { - - public static final String PROPERTY_OPERATION = "operation"; - - public static final String PROPERTY_SPECIES = "species"; - - public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory"; - - public static final String PROPERTY_SAMPLE = "sample"; - - public static final String PROPERTY_MEAN_LENGTH = "meanLength"; - - public static final String PROPERTY_MEAN_WEIGHT = "meanWeight"; - - public static final String PROPERTY_NO_PER_KG = "noPerKg"; - - public static final String PROPERTY_SORTED_WEIGHT = "sortedWeight"; - - protected Float meanLength; - - protected Float meanWeight; - - protected Float noPerKg; - - protected float sortedWeight; - - protected Operation operation; - - protected Species species; - - protected SizeCategory sizeCategory; - - protected final Sample sample; - - public TotalSampleImportModelRow() { - sample = new SampleImpl(); - } - - public Sample getSample() { - return sample; - } - - public Operation getOperation() { - return operation; - } - - public void setOperation(Operation operation) { - this.operation = operation; - } - - public Species getSpecies() { - return species; - } - - public void setSpecies(Species species) { - this.species = species; - } - - public SizeCategory getSizeCategory() { - return sizeCategory; - } - - public void setSizeCategory(SizeCategory sizeCategory) { - this.sizeCategory = sizeCategory; - } - - public void setNumberSampled(Integer numberSampled) { - sample.setNumberSampled(numberSampled); - } - - public void setSampleWeight(Float sampleWeight) { - sample.setSampleWeight(sampleWeight); - } - - public Float getMeanLength() { - return meanLength; - } - - public void setMeanLength(Float meanLength) { - this.meanLength = meanLength; - } - - public Float getMeanWeight() { - return meanWeight; - } - - public void setMeanWeight(Float meanWeight) { - this.meanWeight = meanWeight; - } - - public Float getNoPerKg() { - return noPerKg; - } - - public void setNoPerKg(Float noPerKg) { - this.noPerKg = noPerKg; - } - - public float getSortedWeight() { - return sortedWeight; - } - - public void setSortedWeight(float sortedWeight) { - this.sortedWeight = sortedWeight; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransectImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransectImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransectImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,77 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.Transect; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.Vessel; - -import java.util.Map; - -/** - * Model to import transects. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class TransectImportModel extends AbstractImportModel<TransectImportModelRow> { - - public TransectImportModel(char separator, - Map<String, Voyage> voyageMap, - Map<String, Vessel> vesselMap) { - super(separator); - newForeignKeyColumn( - "voyageName", TransectImportModelRow.PROPERTY_VOYAGE, - Voyage.class, Voyage.PROPERTY_NAME, voyageMap); - - newForeignKeyColumn( - "vesselName", Transect.PROPERTY_VESSEL, - Vessel.class, Vessel.PROPERTY_NAME, vesselMap); - - newMandatoryColumn(Transect.PROPERTY_TITLE); - newMandatoryColumn(Transect.PROPERTY_TRANSECT_ABSTRACT); - newMandatoryColumn(Transect.PROPERTY_STRATUM); - newMandatoryColumn(Transect.PROPERTY_COMMENT); - - newMandatoryColumn(Transect.PROPERTY_DATE_CREATED, EchobaseCsvUtil.IMPORT_DAY_TIME2); - newMandatoryColumn(Transect.PROPERTY_TIME_COVERAGE_START, EchobaseCsvUtil.IMPORT_DAY_TIME2); - newMandatoryColumn(Transect.PROPERTY_TIME_COVERAGE_END, EchobaseCsvUtil.IMPORT_DAY_TIME2); - - newMandatoryColumn(Transect.PROPERTY_GEOSPATIAL_LON_MIN, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(Transect.PROPERTY_GEOSPATIAL_LAT_MIN, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(Transect.PROPERTY_GEOSPATIAL_VERTICAL_MIN, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(Transect.PROPERTY_GEOSPATIAL_LON_MAX, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(Transect.PROPERTY_GEOSPATIAL_LAT_MAX, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(Transect.PROPERTY_GEOSPATIAL_VERTICAL_MAX, EchobaseCsvUtil.PRIMITIVE_FLOAT); - newMandatoryColumn(Transect.PROPERTY_LINESTRING); - } - - @Override - public TransectImportModelRow newEmptyInstance() { - return new TransectImportModelRow(); - } - -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransectImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransectImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransectImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,125 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.data.Transect; -import fr.ifremer.echobase.entities.data.TransectImpl; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.Vessel; - -import java.io.Serializable; -import java.util.Date; - -/** - * Bean used as a row for import of {@link TransectImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class TransectImportModelRow implements Serializable { - - private static final long serialVersionUID = 1L; - - public static final String PROPERTY_VOYAGE = "voyage"; - - protected Voyage voyage; - - protected Transect transect; - - public TransectImportModelRow() { - transect = new TransectImpl(); - } - - public Transect getTransect() { - return transect; - } - - public Voyage getVoyage() { - return voyage; - } - - public void setVoyage(Voyage voyage) { - this.voyage = voyage; - } - - public void setTitle(String title) { - transect.setTitle(title); - } - - public void setTransectAbstract(String transectAbstract) { - transect.setTransectAbstract(transectAbstract); - } - - public void setComment(String comment) { - transect.setComment(comment); - } - - public void setDateCreated(Date dateCreated) { - transect.setDateCreated(dateCreated); - } - - public void setGeospatialLonMin(float geospatialLonMin) { - transect.setGeospatialLonMin(geospatialLonMin); - } - - public void setGeospatialLonMax(float geospatialLonMax) { - transect.setGeospatialLonMax(geospatialLonMax); - } - - public void setGeospatialLatMin(float geospatialLatMin) { - transect.setGeospatialLatMin(geospatialLatMin); - } - - public void setGeospatialLatMax(float geospatialLatMax) { - transect.setGeospatialLatMax(geospatialLatMax); - } - - public void setLinestring(String linestring) { - transect.setLinestring(linestring); - } - - public void setGeospatialVerticalMin(float geospatialVerticalMin) { - transect.setGeospatialVerticalMin(geospatialVerticalMin); - } - - public void setGeospatialVerticalMax(float geospatialVerticalMax) { - transect.setGeospatialVerticalMax(geospatialVerticalMax); - } - - public void setTimeCoverageStart(Date timeCoverageStart) { - transect.setTimeCoverageStart(timeCoverageStart); - } - - public void setTimeCoverageEnd(Date timeCoverageEnd) { - transect.setTimeCoverageEnd(timeCoverageEnd); - } - - public void setStratum(String stratum) { - transect.setStratum(stratum); - } - - public void setVessel(Vessel vessel) { - transect.setVessel(vessel); - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransitImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransitImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransitImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,58 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.Transit; -import fr.ifremer.echobase.entities.data.Voyage; - -import java.util.Map; - -/** - * Model to import Transits. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class TransitImportModel extends AbstractImportModel<TransitImportModelRow> { - - public static final String TRANSIT_VoyageId = "voyageName"; - - public TransitImportModel(char separator, - Map<String, Voyage> voyageMap) { - super(separator); - newForeignKeyColumn("voyageName", TransitImportModelRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, voyageMap); - newMandatoryColumn(Transit.PROPERTY_DESCRIPTION); - newMandatoryColumn(Transit.PROPERTY_START_TIME, EchobaseCsvUtil.DAY_TIME); - newMandatoryColumn(Transit.PROPERTY_END_TIME, EchobaseCsvUtil.DAY_TIME); - newMandatoryColumn(Transit.PROPERTY_START_LOCALITY); - newMandatoryColumn(Transit.PROPERTY_END_LOCALITY); - } - - @Override - public TransitImportModelRow newEmptyInstance() { - return new TransitImportModelRow(); - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransitImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransitImportModelRow.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransitImportModelRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,93 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.entities.data.Transit; -import fr.ifremer.echobase.entities.data.TransitImpl; -import fr.ifremer.echobase.entities.data.Voyage; - -import java.util.Date; - -/** - * Bean used as a row for import of {@link TransitImportModel}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class TransitImportModelRow { - - public static final String PROPERTY_VOYAGE = "voyage"; - - protected Voyage voyage; - - protected final Transit transit; - - protected String description; - - protected String relatedActivity; - - protected Date startTime; - - protected Date endTime; - - protected String startLocality; - - protected String endLocality; - - public TransitImportModelRow() { - transit = new TransitImpl(); - } - - public Transit getTransit() { - return transit; - } - - public Voyage getVoyage() { - return voyage; - } - - public void setVoyage(Voyage voyage) { - this.voyage = voyage; - } - - public void setDescription(String description) { - transit.setDescription(description); - } - - public void setStartTime(Date startTime) { - transit.setStartTime(startTime); - } - - public void setEndTime(Date endTime) { - transit.setEndTime(endTime); - } - - public void setStartLocality(String startLocality) { - transit.setStartLocality(startLocality); - } - - public void setEndLocality(String endLocality) { - transit.setEndLocality(endLocality); - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/VoyageImportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/VoyageImportModel.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/VoyageImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,52 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services.csv; - -import fr.ifremer.echobase.csv.AbstractImportModel; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.data.VoyageImpl; - -/** - * Model to import Voyages. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class VoyageImportModel extends AbstractImportModel<Voyage> { - - public VoyageImportModel(char separator) { - super(separator); - newMandatoryColumn(Voyage.PROPERTY_NAME); - newMandatoryColumn(Voyage.PROPERTY_START_DATE, EchobaseCsvUtil.DAY); - newMandatoryColumn(Voyage.PROPERTY_END_DATE, EchobaseCsvUtil.DAY); - newMandatoryColumn(Voyage.PROPERTY_START_PORT); - newMandatoryColumn(Voyage.PROPERTY_END_PORT); - } - - @Override - public Voyage newEmptyInstance() { - return new VoyageImpl(); - } -} Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportConfiguration.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AbstractImportConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,67 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata; + +import fr.ifremer.echobase.EchoBaseIOUtil; +import fr.ifremer.echobase.InputFile; +import fr.ifremer.echobase.services.AbstractEchobaseActionConfiguration; + +import java.io.File; + +/** + * Common import data configuration. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public abstract class AbstractImportConfiguration extends AbstractEchobaseActionConfiguration { + + private static final long serialVersionUID = 1L; + + protected File workingDirectory; + + public File getWorkingDirectory() { + return workingDirectory; + } + + public void setWorkingDirectory(File workingDirectory) { + this.workingDirectory = workingDirectory; + } + + public abstract InputFile[] getInputFiles(); + + public long computeNbSteps() { + long result = 0; + for (InputFile inputFile : getInputFiles()) { + + if (inputFile.hasFile()) { + int currentLines = EchoBaseIOUtil.countLines( + inputFile.getFile()); + result += currentLines; + } + } + setNbSteps(result); + return result; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportConfiguration.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -43,7 +43,6 @@ import fr.ifremer.echobase.entities.references.SpeciesCategoryDAO; import fr.ifremer.echobase.services.EchoBaseServiceSupport; import fr.ifremer.echobase.services.ImportException; -import fr.ifremer.echobase.services.configurations.AbstractImportConfiguration; import org.nuiton.topia.TopiaException; import org.nuiton.topia.persistence.TopiaDAO; import org.nuiton.topia.persistence.TopiaEntity; Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AcousticDataImportConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,267 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata; + +import fr.ifremer.echobase.InputFile; + +import java.util.Locale; + +import static org.nuiton.i18n.I18n.l_; + +/** + * Configuration of a "accoustic datas" import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class AcousticDataImportConfiguration extends AbstractImportConfiguration { + + private static final long serialVersionUID = 1L; + + /** Selected voyage id where to import datas. */ + protected String voyageId; + + /** Selected vessel id to find out transect where to import datas. */ + protected String vesselId; + + /** Flag to always add new dataAcquisition when a new instrument is found in movies file. */ + protected boolean addDataAcquisition = true; + + /** Manual transceiverAcquisitionAbsorptionDescription. */ + protected String transceiverAcquisitionAbsorptionDescription = "(i) Equation: Francois and garrison 1982,(ii) CTD, (iii) nominal value for entire data set"; + + /** Manual acquisitionSoftwareVersion (ER60 instrument). */ + protected String acquisitionSoftwareVersionER60; + + /** Manual acquisitionSoftwareVersion (ME70 instrument). */ + protected String acquisitionSoftwareVersionME70; + + /** Manual loggedDataFormat. */ + protected String loggedDataFormat = ".hac and .raw formats"; + + /** Manual loggedDataDatatype. */ + protected String loggedDataDatatype = "‘raw’ digitisation samples"; + + /** Manual pingDutyCycle. */ + protected String pingDutyCycle = "Ifremer's standard ping duty cycle"; + +// /** Manual echosounderSoundSpeed. */ +// protected String echosounderSoundSpeed = "Variable"; + + /** Manual soundSpeedCalculations (ER60 instrument). */ + protected String soundSpeedCalculationsER60 = "(i) Equation: Mackenzie (1980), (ii) CTD, (iii) nominal value for entire data set"; + + /** Manual soundSpeedCalculations (ME70 instrument). */ + protected String soundSpeedCalculationsME70 = "(i) Equation: Mackenzie (1980), (ii) Hull-mounted thermosalinometer, (iii) surface absorption value recomputed every 30s and applied to the entire data set"; + + /** Manual sounderConstant. */ + protected String sounderConstant = "NA"; + + /** Manual processingTemplate. */ + protected String processingTemplate; + + /** Manual processingDescription. */ + protected String processingDescription; + + /** Manual digitThreshold. */ + protected float digitThreshold = -100f; + + /** Manual acousticDensityUnit. */ + protected String acousticDensityUnit = "sA"; + + /** Manual notes. */ + protected String notes; + + /** Cell position reference for esdu cell datas. */ + protected CellPositionReference cellPositionReference; + + /** Movies file to import. */ + protected final InputFile moviesFile; + + + public AcousticDataImportConfiguration(Locale locale) { + moviesFile = InputFile.newFile(l_(locale, "echobase.common.moviesFile")); + } + + public String getVoyageId() { + return voyageId; + } + + public void setVoyageId(String voyageId) { + this.voyageId = voyageId; + } + + public String getVesselId() { + return vesselId; + } + + public void setVesselId(String vesselId) { + this.vesselId = vesselId; + } + + public boolean isAddDataAcquisition() { + return addDataAcquisition; + } + + public void setAddDataAcquisition(boolean addDataAcquisition) { + this.addDataAcquisition = addDataAcquisition; + } + + public String getTransceiverAcquisitionAbsorptionDescription() { + return transceiverAcquisitionAbsorptionDescription; + } + + public void setTransceiverAcquisitionAbsorptionDescription(String transceiverAcquisitionAbsorptionDescription) { + this.transceiverAcquisitionAbsorptionDescription = transceiverAcquisitionAbsorptionDescription; + } + + public String getAcquisitionSoftwareVersionER60() { + return acquisitionSoftwareVersionER60; + } + + public void setAcquisitionSoftwareVersionER60(String acquisitionSoftwareVersionER60) { + this.acquisitionSoftwareVersionER60 = acquisitionSoftwareVersionER60; + } + + public String getAcquisitionSoftwareVersionME70() { + return acquisitionSoftwareVersionME70; + } + + public void setAcquisitionSoftwareVersionME70(String acquisitionSoftwareVersionME70) { + this.acquisitionSoftwareVersionME70 = acquisitionSoftwareVersionME70; + } + + public String getLoggedDataFormat() { + return loggedDataFormat; + } + + public void setLoggedDataFormat(String loggedDataFormat) { + this.loggedDataFormat = loggedDataFormat; + } + + public String getLoggedDataDatatype() { + return loggedDataDatatype; + } + + public void setLoggedDataDatatype(String loggedDataDatatype) { + this.loggedDataDatatype = loggedDataDatatype; + } + + public String getPingDutyCycle() { + return pingDutyCycle; + } + + public void setPingDutyCycle(String pingDutyCycle) { + this.pingDutyCycle = pingDutyCycle; + } + +// public String getEchosounderSoundSpeed() { +// return echosounderSoundSpeed; +// } +// +// public void setEchosounderSoundSpeed(String echosounderSoundSpeed) { +// this.echosounderSoundSpeed = echosounderSoundSpeed; +// } + + public String getSoundSpeedCalculationsER60() { + return soundSpeedCalculationsER60; + } + + public void setSoundSpeedCalculationsER60(String soundSpeedCalculationsER60) { + this.soundSpeedCalculationsER60 = soundSpeedCalculationsER60; + } + + public String getSoundSpeedCalculationsME70() { + return soundSpeedCalculationsME70; + } + + public void setSoundSpeedCalculationsME70(String soundSpeedCalculationsME70) { + this.soundSpeedCalculationsME70 = soundSpeedCalculationsME70; + } + + public String getSounderConstant() { + return sounderConstant; + } + + public void setSounderConstant(String sounderConstant) { + this.sounderConstant = sounderConstant; + } + + public float getDigitThreshold() { + return digitThreshold; + } + + public void setDigitThreshold(float digitThreshold) { + this.digitThreshold = digitThreshold; + } + + public String getAcousticDensityUnit() { + return acousticDensityUnit; + } + + public void setAcousticDensityUnit(String acousticDensityUnit) { + this.acousticDensityUnit = acousticDensityUnit; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public InputFile getMoviesFile() { + return moviesFile; + } + + public String getProcessingTemplate() { + return processingTemplate; + } + + public void setProcessingTemplate(String processingTemplate) { + this.processingTemplate = processingTemplate; + } + + public String getProcessingDescription() { + return processingDescription; + } + + public void setProcessingDescription(String processingDescription) { + this.processingDescription = processingDescription; + } + + public CellPositionReference getCellPositionReference() { + return cellPositionReference; + } + + public void setCellPositionReference(CellPositionReference cellPositionReference) { + this.cellPositionReference = cellPositionReference; + } + + @Override + public InputFile[] getInputFiles() { + return new InputFile[]{moviesFile}; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -49,9 +49,8 @@ import fr.ifremer.echobase.entities.references.DataMetadata; import fr.ifremer.echobase.entities.references.Vessel; import fr.ifremer.echobase.services.ImportException; -import fr.ifremer.echobase.services.configurations.AcousticDataImportConfiguration; -import fr.ifremer.echobase.services.csv.AcousticDataImportModel; -import fr.ifremer.echobase.services.csv.AcousticDataImportModelRow; +import fr.ifremer.echobase.services.importdata.csv.AcousticDataImportModel; +import fr.ifremer.echobase.services.importdata.csv.AcousticDataImportRow; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -188,7 +187,7 @@ Locale locale = getLocale(); String dataProcessingId = null; try { - Import<AcousticDataImportModelRow> importer = + Import<AcousticDataImportRow> importer = EchoBaseImport.newImport(csvModel, reader); DataAcquisition dataAcquisition = null; DataProcessing dataProcessing = null; @@ -197,7 +196,7 @@ int rowNumber = 0; configuration.incrementsProgression(); - for (AcousticDataImportModelRow row : importer) { + for (AcousticDataImportRow row : importer) { configuration.incrementsProgression(); rowNumber++; @@ -421,7 +420,7 @@ protected void createEsduCellData(String suffix, Cell cell, Map<String, DataMetadata> dataMetadatas, - AcousticDataImportModelRow row, + AcousticDataImportRow row, DataDAO dao, CsvFileImportResult importResult) { @@ -488,7 +487,7 @@ Cell cell, Map<String, DataMetadata> dataMetadatas, boolean surface, - AcousticDataImportModelRow row, + AcousticDataImportRow row, DataDAO dao, CsvFileImportResult importResult) { @@ -574,7 +573,7 @@ AcousticInstrument instrument, String softwareVersion, String soundSpeedCalculations, - AcousticDataImportModelRow row, + AcousticDataImportRow row, DataAcquisitionDAO dataAcquisitionDAO) { String transceiverAcquisitionAbsorptionDescription = @@ -629,7 +628,7 @@ String id, String softwareVersion, String soundSpeedCalculations, - AcousticDataImportModelRow row, + AcousticDataImportRow row, DataProcessingDAO dataProcessingDAO) { String transceiverAcquisitionAbsorptionDescription = Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportConfiguration.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesDataImportConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,87 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata; + +import fr.ifremer.echobase.InputFile; + +import java.util.Locale; + +import static org.nuiton.i18n.I18n.l_; + +/** + * Configuration of a "catches data import". + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class CatchesDataImportConfiguration extends AbstractImportConfiguration { + + private static final long serialVersionUID = 1L; + + /** Selected voyage id where to import datas. */ + protected String voyageId; + + /** Sample file to import. */ + protected final InputFile totalSampleFile; + + /** Sub sample file to import. */ + protected final InputFile subSampleFile; + + /** Biometry sample file to import. */ + protected final InputFile biometrySampleFile; + + public CatchesDataImportConfiguration(Locale locale) { + totalSampleFile = InputFile.newFile( + l_(locale, "echobase.common.totalSampleFile")); + subSampleFile = InputFile.newFile( + l_(locale, "echobase.common.subSampleFile")); + biometrySampleFile = InputFile.newFile( + l_(locale, "echobase.common.biometrySampleFile")); + } + + public String getVoyageId() { + return voyageId; + } + + public void setVoyageId(String voyageId) { + this.voyageId = voyageId; + } + + public InputFile getTotalSampleFile() { + return totalSampleFile; + } + + public InputFile getSubSampleFile() { + return subSampleFile; + } + + public InputFile getBiometrySampleFile() { + return biometrySampleFile; + } + + @Override + public InputFile[] getInputFiles() { + return new InputFile[]{totalSampleFile, subSampleFile, biometrySampleFile}; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportConfiguration.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -49,13 +49,12 @@ import fr.ifremer.echobase.entities.references.SpeciesCategory; import fr.ifremer.echobase.entities.references.SpeciesCategoryDAO; import fr.ifremer.echobase.services.ImportException; -import fr.ifremer.echobase.services.configurations.CatchesDataImportConfiguration; -import fr.ifremer.echobase.services.csv.BiometrySampleImportModel; -import fr.ifremer.echobase.services.csv.BiometrySampleImportModelRow; -import fr.ifremer.echobase.services.csv.SubSampleImportModel; -import fr.ifremer.echobase.services.csv.SubSampleImportModelRow; -import fr.ifremer.echobase.services.csv.TotalSampleImportModel; -import fr.ifremer.echobase.services.csv.TotalSampleImportModelRow; +import fr.ifremer.echobase.services.importdata.csv.BiometrySampleImportModel; +import fr.ifremer.echobase.services.importdata.csv.BiometrySampleImportRow; +import fr.ifremer.echobase.services.importdata.csv.SubSampleImportModel; +import fr.ifremer.echobase.services.importdata.csv.SubSampleImportRow; +import fr.ifremer.echobase.services.importdata.csv.TotalSampleImportModel; +import fr.ifremer.echobase.services.importdata.csv.TotalSampleImportRow; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.util.csv.Import; @@ -193,11 +192,11 @@ Reader reader = getInputFileReader(inputFile); Locale locale = getLocale(); try { - Import<TotalSampleImportModelRow> importer = + Import<TotalSampleImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (TotalSampleImportModelRow row : importer) { + for (TotalSampleImportRow row : importer) { configuration.incrementsProgression(); Operation operation = row.getOperation(); @@ -354,11 +353,11 @@ Reader reader = getInputFileReader(inputFile); try { - Import<SubSampleImportModelRow> importer = + Import<SubSampleImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (SubSampleImportModelRow row : importer) { + for (SubSampleImportRow row : importer) { configuration.incrementsProgression(); Operation operation = row.getOperation(); @@ -458,11 +457,11 @@ Reader reader = getInputFileReader(inputFile); try { - Import<BiometrySampleImportModelRow> importer = + Import<BiometrySampleImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (BiometrySampleImportModelRow row : importer) { + for (BiometrySampleImportRow row : importer) { configuration.incrementsProgression(); Operation operation = row.getOperation(); Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CellPositionReference.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CellPositionReference.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CellPositionReference.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CellPositionReference.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,74 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata; + +import fr.ifremer.echobase.I18nAble; + +import static org.nuiton.i18n.I18n.n_; + +/** + * To define cell position reference in acoustic import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public enum CellPositionReference implements I18nAble { + + /** Begin. */ + START(n_("echobase.common.cellPositionReference.start")) { + @Override + public String getMetadataNameSuffix() { + return "Start"; + } + }, + + /** Mid. */ + MID(n_("echobase.common.cellPositionReference.mid")) { + @Override + public String getMetadataNameSuffix() { + return "Bary"; + } + }, + + /** End. */ + END(n_("echobase.common.cellPositionReference.end")) { + @Override + public String getMetadataNameSuffix() { + return "End"; + } + }; + + private final String i18nKey; + + CellPositionReference(String i18nKey) { + this.i18nKey = i18nKey; + } + + @Override + public String getI18nKey() { + return i18nKey; + } + + public abstract String getMetadataNameSuffix(); +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CellPositionReference.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportConfiguration.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,186 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata; + +import fr.ifremer.echobase.InputFile; + +import java.util.Locale; + +import static org.nuiton.i18n.I18n.l_; + +/** + * Configuration of a "common data complete" import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class CommonDataImportConfiguration extends AbstractImportConfiguration { + + private static final long serialVersionUID = 1L; + + /** Selected import mode. */ + protected CommonDataImportMode importMode; + + /** Selected mission id to use in voyage. */ + protected String missionId; + + /** Selected voyage id to use (in mode 2). */ + protected String voyageId; + + /** Selected area of operation to use for voyage. */ + protected String areaOfOperationId; + + /** Manual description of voyage. */ + protected String voyageDescription; + + /** transit related activity. */ + protected String transitRelatedActivity; + + /** transect license. */ + protected String transectLicence; + + /** transect geospatialVerticalPositive. */ + protected String transectGeospatialVerticalPositive = "down"; + + /** transect binUnitsPingAxis. */ + protected String transectBinUnitsPingAxis = "1 nautical mile"; + + /** Manual datum to use in voyage. */ + protected String datum = "WGS84"; + + /** Voyage file to import. */ + protected final InputFile voyageFile; + + /** Transit file to import. */ + protected final InputFile transitFile; + + /** Transect file to import. */ + protected final InputFile transectFile; + + public CommonDataImportConfiguration(Locale locale) { + voyageFile = InputFile.newFile( + l_(locale, "echobase.common.voyageFile")); + transitFile = InputFile.newFile( + l_(locale, "echobase.common.transitFile")); + transectFile = InputFile.newFile( + l_(locale, "echobase.common.transectFile")); + } + + public CommonDataImportMode getImportMode() { + return importMode; + } + + public void setImportMode(CommonDataImportMode importMode) { + this.importMode = importMode; + } + + public String getMissionId() { + return missionId; + } + + public void setMissionId(String missionId) { + this.missionId = missionId; + } + + public String getAreaOfOperationId() { + return areaOfOperationId; + } + + public void setAreaOfOperationId(String areaOfOperationId) { + this.areaOfOperationId = areaOfOperationId; + } + + public String getVoyageId() { + return voyageId; + } + + public void setVoyageId(String voyageId) { + this.voyageId = voyageId; + } + + public String getVoyageDescription() { + return voyageDescription; + } + + public void setVoyageDescription(String voyageDescription) { + this.voyageDescription = voyageDescription; + } + + public String getDatum() { + return datum; + } + + public void setDatum(String datum) { + this.datum = datum; + } + + public String getTransitRelatedActivity() { + return transitRelatedActivity; + } + + public void setTransitRelatedActivity(String transitRelatedActivity) { + this.transitRelatedActivity = transitRelatedActivity; + } + + public String getTransectLicence() { + return transectLicence; + } + + public void setTransectLicence(String transectLicence) { + this.transectLicence = transectLicence; + } + + public String getTransectGeospatialVerticalPositive() { + return transectGeospatialVerticalPositive; + } + + public void setTransectGeospatialVerticalPositive(String transectGeospatialVerticalPositive) { + this.transectGeospatialVerticalPositive = transectGeospatialVerticalPositive; + } + + public String getTransectBinUnitsPingAxis() { + return transectBinUnitsPingAxis; + } + + public void setTransectBinUnitsPingAxis(String transectBinUnitsPingAxis) { + this.transectBinUnitsPingAxis = transectBinUnitsPingAxis; + } + + public InputFile getVoyageFile() { + return voyageFile; + } + + public InputFile getTransitFile() { + return transitFile; + } + + public InputFile getTransectFile() { + return transectFile; + } + + @Override + public InputFile[] getInputFiles() { + return new InputFile[]{voyageFile, transitFile, transectFile}; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportConfiguration.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportMode.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,54 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata; + +import fr.ifremer.echobase.I18nAble; + +import static org.nuiton.i18n.I18n.n_; + +/** + * To define common data import mode. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public enum CommonDataImportMode implements I18nAble { + + /** Import Voyage / Transit / Transect. */ + ALL(n_("echobase.common.commonDataImportMode.all")), + + /** Import all common data from Transect to Operation. */ + TRANSECT(n_("echobase.common.commonDataImportMode.transect")); + + private final String i18nKey; + + CommonDataImportMode(String i18nKey) { + this.i18nKey = i18nKey; + } + + @Override + public String getI18nKey() { + return i18nKey; + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -44,13 +44,12 @@ import fr.ifremer.echobase.entities.references.MissionDAO; import fr.ifremer.echobase.entities.references.Vessel; import fr.ifremer.echobase.services.ImportException; -import fr.ifremer.echobase.services.configurations.CommonDataImportConfiguration; -import fr.ifremer.echobase.services.csv.TransectImportModel; -import fr.ifremer.echobase.services.csv.TransectImportModelRow; -import fr.ifremer.echobase.services.csv.TransitImportModel; -import fr.ifremer.echobase.services.csv.TransitImportModelRow; -import fr.ifremer.echobase.services.csv.VoyageImportModel; import fr.ifremer.echobase.services.exceptions.MissionNameAlreadyExistException; +import fr.ifremer.echobase.services.importdata.csv.TransectImportModel; +import fr.ifremer.echobase.services.importdata.csv.TransectImportRow; +import fr.ifremer.echobase.services.importdata.csv.TransitImportModel; +import fr.ifremer.echobase.services.importdata.csv.TransitImportRow; +import fr.ifremer.echobase.services.importdata.csv.VoyageImportModel; import org.nuiton.topia.TopiaException; import org.nuiton.util.csv.Import; import org.nuiton.util.csv.ImportModel; @@ -238,11 +237,11 @@ Reader reader = getInputFileReader(inputFile); try { - Import<TransitImportModelRow> importer = + Import<TransitImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (TransitImportModelRow row : importer) { + for (TransitImportRow row : importer) { configuration.incrementsProgression(); Transit transit = row.getTransit(); @@ -294,11 +293,11 @@ Reader reader = getInputFileReader(inputFile); try { - Import<TransectImportModelRow> importer = + Import<TransectImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (TransectImportModelRow row : importer) { + for (TransectImportRow row : importer) { configuration.incrementsProgression(); Transect transect = row.getTransect(); Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportConfiguration.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/OperationImportConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,89 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata; + +import fr.ifremer.echobase.InputFile; + +import java.util.Locale; + +import static org.nuiton.i18n.I18n.l_; + +/** + * Configuration of a "operation" import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class OperationImportConfiguration extends AbstractImportConfiguration { + + private static final long serialVersionUID = 1L; + + /** Selected voyage id where to import datas. */ + protected String voyageId; + + /** operation file to import. */ + protected final InputFile operationFile; + + /** operation metadatas file to import. */ + protected final InputFile operationMetadataFile; + + /** gear metadatas file to import. */ + protected final InputFile gearMetadataFile; + + public OperationImportConfiguration(Locale locale) { + operationFile = InputFile.newFile( + l_(locale, "echobase.common.operationFile")); + operationMetadataFile = InputFile.newFile( + l_(locale, "echobase.common.operationMetadataFile")); + gearMetadataFile = InputFile.newFile( + l_(locale, "echobase.common.gearMetadataFile")); + } + + public String getVoyageId() { + return voyageId; + } + + public void setVoyageId(String voyageId) { + this.voyageId = voyageId; + } + + public InputFile getOperationFile() { + return operationFile; + } + + public InputFile getOperationMetadataFile() { + return operationMetadataFile; + } + + public InputFile getGearMetadataFile() { + return gearMetadataFile; + } + + @Override + public InputFile[] getInputFiles() { + return new InputFile[]{operationFile, + operationMetadataFile, + gearMetadataFile}; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportConfiguration.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -46,13 +46,12 @@ import fr.ifremer.echobase.entities.references.OperationMetadata; import fr.ifremer.echobase.entities.references.Vessel; import fr.ifremer.echobase.services.ImportException; -import fr.ifremer.echobase.services.configurations.OperationImportConfiguration; -import fr.ifremer.echobase.services.csv.GearMetadataValueImportModel; -import fr.ifremer.echobase.services.csv.GearMetadataValueImportModelRow; -import fr.ifremer.echobase.services.csv.OperationImportModel; -import fr.ifremer.echobase.services.csv.OperationImportModelRow; -import fr.ifremer.echobase.services.csv.OperationMetadataValueImportModel; -import fr.ifremer.echobase.services.csv.OperationMetadataValueImportModelRow; +import fr.ifremer.echobase.services.importdata.csv.GearMetadataValueImportModel; +import fr.ifremer.echobase.services.importdata.csv.GearMetadataValueImportRow; +import fr.ifremer.echobase.services.importdata.csv.OperationImportModel; +import fr.ifremer.echobase.services.importdata.csv.OperationImportRow; +import fr.ifremer.echobase.services.importdata.csv.OperationMetadataValueImportModel; +import fr.ifremer.echobase.services.importdata.csv.OperationMetadataValueImportRow; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.util.csv.Import; @@ -169,11 +168,11 @@ Reader reader = getInputFileReader(inputFile); try { - Import<OperationImportModelRow> importer = + Import<OperationImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (OperationImportModelRow row : importer) { + for (OperationImportRow row : importer) { configuration.incrementsProgression(); Vessel vessel = row.getVessel(); @@ -232,11 +231,11 @@ Reader reader = getInputFileReader(inputFile); try { - Import<OperationMetadataValueImportModelRow> importer = + Import<OperationMetadataValueImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (OperationMetadataValueImportModelRow row : importer) { + for (OperationMetadataValueImportRow row : importer) { configuration.incrementsProgression(); Operation operation = row.getOperation(); @@ -288,11 +287,11 @@ Reader reader = getInputFileReader(inputFile); try { - Import<GearMetadataValueImportModelRow> importer = + Import<GearMetadataValueImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (GearMetadataValueImportModelRow row : importer) { + for (GearMetadataValueImportRow row : importer) { configuration.incrementsProgression(); Operation operation = row.getOperation(); Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -49,16 +49,14 @@ import fr.ifremer.echobase.entities.references.SpeciesCategoryDAO; import fr.ifremer.echobase.services.DecoratorService; import fr.ifremer.echobase.services.ImportException; -import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration; -import fr.ifremer.echobase.services.configurations.ResultsImportMode; -import fr.ifremer.echobase.services.csv.AcousticResultByEchotypeAndSpeciesCategoryImportModel; -import fr.ifremer.echobase.services.csv.AcousticResultByEchotypeAndSpeciesCategoryImportModelRow; -import fr.ifremer.echobase.services.csv.AcousticResultByEchotypeImportModel; -import fr.ifremer.echobase.services.csv.AcousticResultByEchotypeImportModelRow; -import fr.ifremer.echobase.services.csv.AcousticResultBySpeciesAndAgeCategoryImportModel; -import fr.ifremer.echobase.services.csv.AcousticResultBySpeciesAndAgeCategoryImportModelRow; -import fr.ifremer.echobase.services.csv.AcousticResultBySpeciesAndSizeCategoryImportModel; -import fr.ifremer.echobase.services.csv.AcousticResultBySpeciesAndSizeCategoryImportModelRow; +import fr.ifremer.echobase.services.importdata.csv.EsduResultByEchotypeAndSpeciesCategoryImportModel; +import fr.ifremer.echobase.services.importdata.csv.EsduResultByEchotypeAndSpeciesCategoryImportRow; +import fr.ifremer.echobase.services.importdata.csv.EsduResultByEchotypeImportModel; +import fr.ifremer.echobase.services.importdata.csv.EsduResultByEchotypeImportRow; +import fr.ifremer.echobase.services.importdata.csv.EsduResultBySpeciesAndAgeCategoryImportModel; +import fr.ifremer.echobase.services.importdata.csv.EsduResultBySpeciesAndAgeCategoryImportRow; +import fr.ifremer.echobase.services.importdata.csv.EsduResultBySpeciesAndSizeCategoryImportModel; +import fr.ifremer.echobase.services.importdata.csv.EsduResultBySpeciesAndSizeCategoryImportRow; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.topia.persistence.TopiaDAO; @@ -87,7 +85,8 @@ private static final Log log = LogFactory.getLog(ResultsEsduCellImportService.class); - public static final Pattern REMOVE_DOUBLE_QUOTES_PATTERN = Pattern.compile("\"(.+)\""); + public static final Pattern REMOVE_DOUBLE_QUOTES_PATTERN = + Pattern.compile("\"(.+)\""); @Override protected String getImportLabel() { @@ -102,22 +101,18 @@ ResultsImportMode importMode = configuration.getImportMode(); Map<String, Species> speciesMap = getEntitiesMap( - Species.class, - EchoBaseFunctions.SPECIES_BARACOUDA_CODE); + Species.class, EchoBaseFunctions.SPECIES_BARACOUDA_CODE); Map<String, SizeCategory> sizeCategoryMap = Maps.newTreeMap(); sizeCategoryMap.putAll(getEntitiesMap( - SizeCategory.class, - EchoBaseFunctions.SIZE_CATEGORY_NAME)); + SizeCategory.class, EchoBaseFunctions.SIZE_CATEGORY_NAME)); Map<String, AgeCategory> ageCategoryMap = Maps.newTreeMap(); ageCategoryMap.putAll(getEntitiesMap( - AgeCategory.class, - EchoBaseFunctions.AGE_CATEGORY_NAME)); + AgeCategory.class, EchoBaseFunctions.AGE_CATEGORY_NAME)); Map<String, DataMetadata> dataMetadataMap = getEntitiesMap( - DataMetadata.class, - EchoBaseFunctions.DATA_METADATA_NAME); + DataMetadata.class, EchoBaseFunctions.DATA_METADATA_NAME); // get selected voyage Voyage voyage = getEntityById(Voyage.class, @@ -125,34 +120,32 @@ // index all echotypes of thi voyage Map<String, Echotype> echotypeMap = Maps.uniqueIndex( - voyage.getEchotype(), - EchoBaseFunctions.ECHOTYPE_NAME); + voyage.getEchotype(), EchoBaseFunctions.ECHOTYPE_NAME); InputFile inputFile; CsvFileImportResult importResult; switch (importMode) { - case ACOUSTIC_BY_ECHOTYPE: { + case ESDU_BY_ECHOTYPE: { - inputFile = configuration.getAcousticByEchotypeFile(); + inputFile = configuration.getEsduByEchotypeFile(); - importResult = importAcousticByEchotypeFile( + importResult = importByEchotypeFile( configuration, inputFile, voyage, echotypeMap, dataMetadataMap ); - } break; - case ACOUSTIC_BY_ECHOTYPE_AND_SPECIES_CATEGORY: { + case ESDU_BY_ECHOTYPE_AND_SPECIES_CATEGORY: { inputFile = - configuration.getAcousticByEchotypeAndSpeciesCategoryFile(); - importResult = importAcousticByEchotypeAndSpeciesCategoryFile( + configuration.getEsduByEchotypeAndSpeciesCategoryFile(); + importResult = importByEchotypeAndSpeciesCategoryFile( configuration, inputFile, voyage, @@ -164,11 +157,11 @@ } break; - case ACOUSTIC_BY_SPECIES_AND_SIZE_CATEGORY: { + case ESDU_BY_SPECIES_AND_SIZE_CATEGORY: { inputFile = - configuration.getAcousticBySpeciesAndSizeCategoryFile(); - importResult = importAcousticBySpeciesAndSizeCategoryFile( + configuration.getEsduBySpeciesAndSizeCategoryFile(); + importResult = importBySpeciesAndSizeCategoryFile( configuration, inputFile, voyage, @@ -179,12 +172,12 @@ } break; - case ACOUSTIC_BY_SPECIES_AND_AGE_CATEGORY: { + case ESDU_BY_SPECIES_AND_AGE_CATEGORY: { inputFile = - configuration.getAcousticBySpeciesAndAgeCategoryFile(); + configuration.getEsduBySpeciesAndAgeCategoryFile(); - importResult = importAcousticBySpeciesAndAgeCategoryFile( + importResult = importBySpeciesAndAgeCategoryFile( configuration, inputFile, voyage, @@ -192,7 +185,6 @@ speciesMap, ageCategoryMap ); - } break; default: @@ -206,7 +198,7 @@ return result; } - private CsvFileImportResult importAcousticByEchotypeFile( + private CsvFileImportResult importByEchotypeFile( ResultsImportConfiguration configuration, InputFile inputFile, Voyage voyage, @@ -226,13 +218,13 @@ inputFile.getFileName()); List<DataMetadata> metas = getMetas( - AcousticResultByEchotypeImportModel.COLUMN_NAMES_TO_EXCLUDE, + EsduResultByEchotypeImportModel.COLUMN_NAMES_TO_EXCLUDE, dataMetadataMap, header); CellDAO cellDAO = (CellDAO) getDAO(Cell.class); - AcousticResultByEchotypeImportModel csvModel = new AcousticResultByEchotypeImportModel( + EsduResultByEchotypeImportModel csvModel = new EsduResultByEchotypeImportModel( serviceContext.getConfiguration().getCsvSeparator(), echotypeMap, voyage, @@ -249,13 +241,13 @@ Decorator<Category> categoryDecorator = decoratorService.getDecorator(getLocale(), Category.class, null); Reader reader = getInputFileReader(inputFile); try { - Import<AcousticResultByEchotypeImportModelRow> importer = + Import<EsduResultByEchotypeImportRow> importer = EchoBaseImport.newImport(csvModel, reader); int rowNumber = 0; configuration.incrementsProgression(); - for (AcousticResultByEchotypeImportModelRow row : importer) { + for (EsduResultByEchotypeImportRow row : importer) { configuration.incrementsProgression(); rowNumber++; @@ -272,7 +264,7 @@ if (rowNumber % 100 == 0) { if (log.isInfoEnabled()) { - log.info("Treate row " + rowNumber + " for esdu cell " + + log.info("Treat row " + rowNumber + " for esdu cell " + cell.getName() + " and category " + categoryDecorator.toString(category)); } @@ -302,7 +294,7 @@ } } - private CsvFileImportResult importAcousticByEchotypeAndSpeciesCategoryFile( + private CsvFileImportResult importByEchotypeAndSpeciesCategoryFile( ResultsImportConfiguration configuration, InputFile inputFile, Voyage voyage, @@ -326,7 +318,7 @@ List<DataMetadata> metas = getMetas( - AcousticResultByEchotypeAndSpeciesCategoryImportModel.COLUMN_NAMES_TO_EXCLUDE, + EsduResultByEchotypeAndSpeciesCategoryImportModel.COLUMN_NAMES_TO_EXCLUDE, dataMetadataMap, header); @@ -335,7 +327,7 @@ SpeciesCategoryDAO speciesCategoryDAO = getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class); - AcousticResultByEchotypeAndSpeciesCategoryImportModel csvModel = new AcousticResultByEchotypeAndSpeciesCategoryImportModel( + EsduResultByEchotypeAndSpeciesCategoryImportModel csvModel = new EsduResultByEchotypeAndSpeciesCategoryImportModel( serviceContext.getConfiguration().getCsvSeparator(), echotypeMap, speciesMap, @@ -353,13 +345,13 @@ Reader reader = getInputFileReader(inputFile); try { - EchoBaseImport<AcousticResultByEchotypeAndSpeciesCategoryImportModelRow> importer = + EchoBaseImport<EsduResultByEchotypeAndSpeciesCategoryImportRow> importer = EchoBaseImport.newImport(csvModel, reader); int rowNumber = 0; configuration.incrementsProgression(); - for (AcousticResultByEchotypeAndSpeciesCategoryImportModelRow row : importer) { + for (EsduResultByEchotypeAndSpeciesCategoryImportRow row : importer) { configuration.incrementsProgression(); rowNumber++; @@ -376,7 +368,7 @@ if (rowNumber % 100 == 0) { if (log.isInfoEnabled()) { - log.info("Treate row " + rowNumber + " for esdu cell " + + log.info("Treat row " + rowNumber + " for esdu cell " + cell.getName() + " and category " + categoryDecorator.toString(category)); } @@ -407,7 +399,7 @@ } } - private CsvFileImportResult importAcousticBySpeciesAndSizeCategoryFile( + private CsvFileImportResult importBySpeciesAndSizeCategoryFile( ResultsImportConfiguration configuration, InputFile inputFile, Voyage voyage, Map<String, DataMetadata> dataMetadataMap, @@ -429,7 +421,7 @@ List<DataMetadata> metas = getMetas( - AcousticResultBySpeciesAndSizeCategoryImportModel.COLUMN_NAMES_TO_EXCLUDE, + EsduResultBySpeciesAndSizeCategoryImportModel.COLUMN_NAMES_TO_EXCLUDE, dataMetadataMap, header); @@ -441,7 +433,7 @@ SizeCategoryDAO sizeCategoryDAO = getDAO(SizeCategory.class, SizeCategoryDAO.class); - AcousticResultBySpeciesAndSizeCategoryImportModel csvModel = new AcousticResultBySpeciesAndSizeCategoryImportModel( + EsduResultBySpeciesAndSizeCategoryImportModel csvModel = new EsduResultBySpeciesAndSizeCategoryImportModel( serviceContext.getConfiguration().getCsvSeparator(), speciesMap, voyage, @@ -457,13 +449,13 @@ Reader reader = getInputFileReader(inputFile); try { - EchoBaseImport<AcousticResultBySpeciesAndSizeCategoryImportModelRow> importer = + EchoBaseImport<EsduResultBySpeciesAndSizeCategoryImportRow> importer = EchoBaseImport.newImport(csvModel, reader); int rowNumber = 0; configuration.incrementsProgression(); - for (AcousticResultBySpeciesAndSizeCategoryImportModelRow row : importer) { + for (EsduResultBySpeciesAndSizeCategoryImportRow row : importer) { configuration.incrementsProgression(); rowNumber++; @@ -499,7 +491,7 @@ if (rowNumber % 100 == 0) { if (log.isInfoEnabled()) { - log.info("Treate row " + rowNumber + " for esdu cell " + + log.info("Treat row " + rowNumber + " for esdu cell " + cell.getName() + " and category " + categoryDecorator.toString(category)); } @@ -530,7 +522,7 @@ } } - private CsvFileImportResult importAcousticBySpeciesAndAgeCategoryFile( + private CsvFileImportResult importBySpeciesAndAgeCategoryFile( ResultsImportConfiguration configuration, InputFile inputFile, Voyage voyage, @@ -553,7 +545,7 @@ List<DataMetadata> metas = getMetas( - AcousticResultBySpeciesAndAgeCategoryImportModel.COLUMN_NAMES_TO_EXCLUDE, + EsduResultBySpeciesAndAgeCategoryImportModel.COLUMN_NAMES_TO_EXCLUDE, dataMetadataMap, header); @@ -566,7 +558,7 @@ getDAO(AgeCategory.class, AgeCategoryDAO.class); - AcousticResultBySpeciesAndAgeCategoryImportModel csvModel = new AcousticResultBySpeciesAndAgeCategoryImportModel( + EsduResultBySpeciesAndAgeCategoryImportModel csvModel = new EsduResultBySpeciesAndAgeCategoryImportModel( serviceContext.getConfiguration().getCsvSeparator(), speciesMap, voyage, @@ -582,13 +574,13 @@ Reader reader = getInputFileReader(inputFile); try { - EchoBaseImport<AcousticResultBySpeciesAndAgeCategoryImportModelRow> importer = + EchoBaseImport<EsduResultBySpeciesAndAgeCategoryImportRow> importer = EchoBaseImport.newImport(csvModel, reader); int rowNumber = 0; configuration.incrementsProgression(); - for (AcousticResultBySpeciesAndAgeCategoryImportModelRow row : importer) { + for (EsduResultBySpeciesAndAgeCategoryImportRow row : importer) { configuration.incrementsProgression(); rowNumber++; @@ -624,7 +616,7 @@ if (rowNumber % 100 == 0) { if (log.isInfoEnabled()) { - log.info("Treate row " + rowNumber + " for esdu cell " + + log.info("Treat row " + rowNumber + " for esdu cell " + cell.getName() + " and category " + categoryDecorator.toString(category)); } Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportConfiguration.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportConfiguration.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,208 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata; + +import fr.ifremer.echobase.InputFile; + +import java.util.Locale; + +import static org.nuiton.i18n.I18n.l_; + +/** + * Configuration of a "results" import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class ResultsImportConfiguration extends AbstractImportConfiguration { + + private static final long serialVersionUID = 1L; + + /** Selected voyage id where to import datas. */ + protected String voyageId; + + /** Selected vessel id to find out transect where to import datas. */ + protected String vesselId; + + /** resultLabel to store while importing acoustic result. */ + protected String resultLabel; + + /** Type of import. */ + protected ResultsImportMode importMode; + + /** Acoustic result by echotype import. */ + protected final InputFile esduByEchotypeFile; + + /** Acoustic result by echotype and species category import. */ + protected final InputFile esduByEchotypeAndSpeciesCategoryFile; + + /** Acoustic result by species and size category import. */ + protected final InputFile esduBySpeciesAndSizeCategoryFile; + + /** Acoustic result by species and age category import. */ + protected final InputFile esduBySpeciesAndAgeCategoryFile; + + /** Region file to import. */ + protected final InputFile regionsFile; + + /** Region cell associations file to import. */ + protected final InputFile regionAssociationFile; + + /** Region cell results file to import. */ + protected final InputFile regionResultFile; + + /** Map cells file to import. */ + protected final InputFile mapsFile; + + /** Map cell results file to import. */ + protected final InputFile mapResultFile; + + /** Echotype file to import. */ + protected final InputFile echotypeFile; + + /** LengthAgeKey file to import. */ + protected final InputFile lengthAgeKeyFile; + + /** LengthWeightKey file to import. */ + protected final InputFile lengthWeightKeyFile; + + public ResultsImportConfiguration(Locale locale) { + regionsFile = InputFile.newFile( + l_(locale, "echobase.common.cellRegionsFile")); + regionAssociationFile = InputFile.newFile( + l_(locale, "echobase.common.cellRegionAssociationFile")); + regionResultFile = InputFile.newFile( + l_(locale, "echobase.common.cellRegionResultFile")); + mapsFile = InputFile.newFile( + l_(locale, "echobase.common.cellMapsFile")); + mapResultFile = InputFile.newFile( + l_(locale, "echobase.common.cellMapResultFile")); + echotypeFile = InputFile.newFile( + l_(locale, "echobase.common.echotypeFile")); + lengthAgeKeyFile = InputFile.newFile( + l_(locale, "echobase.common.lengthAgeKeyFile")); + lengthWeightKeyFile = InputFile.newFile( + l_(locale, "echobase.common.lengthWeightKeyFile")); + esduByEchotypeFile = InputFile.newFile( + l_(locale, "echobase.common.esduByEchotypeFile")); + esduByEchotypeAndSpeciesCategoryFile = InputFile.newFile( + l_(locale, "echobase.common.esduByEchotypeAndSpeciesCategoryFile")); + esduBySpeciesAndSizeCategoryFile = InputFile.newFile( + l_(locale, "echobase.common.esduBySpeciesAndSizeCategoryFile")); + esduBySpeciesAndAgeCategoryFile = InputFile.newFile( + l_(locale, "echobase.common.esduBySpeciesAndAgeCategoryFile")); + } + + public String getVoyageId() { + return voyageId; + } + + public void setVoyageId(String voyageId) { + this.voyageId = voyageId; + } + + public String getVesselId() { + return vesselId; + } + + public void setVesselId(String vesselId) { + this.vesselId = vesselId; + } + + public ResultsImportMode getImportMode() { + return importMode; + } + + public void setImportMode(ResultsImportMode importMode) { + this.importMode = importMode; + } + + public String getResultLabel() { + return resultLabel; + } + + public void setResultLabel(String resultLabel) { + this.resultLabel = resultLabel; + } + + public InputFile getRegionsFile() { + return regionsFile; + } + + public InputFile getRegionAssociationFile() { + return regionAssociationFile; + } + + public InputFile getRegionResultFile() { + return regionResultFile; + } + + public InputFile getMapsFile() { + return mapsFile; + } + + public InputFile getMapResultFile() { + return mapResultFile; + } + + public InputFile getEchotypeFile() { + return echotypeFile; + } + + public InputFile getLengthAgeKeyFile() { + return lengthAgeKeyFile; + } + + public InputFile getLengthWeightKeyFile() { + return lengthWeightKeyFile; + } + + public InputFile getEsduByEchotypeFile() { + return esduByEchotypeFile; + } + + public InputFile getEsduByEchotypeAndSpeciesCategoryFile() { + return esduByEchotypeAndSpeciesCategoryFile; + } + + public InputFile getEsduBySpeciesAndSizeCategoryFile() { + return esduBySpeciesAndSizeCategoryFile; + } + + public InputFile getEsduBySpeciesAndAgeCategoryFile() { + return esduBySpeciesAndAgeCategoryFile; + } + + @Override + public InputFile[] getInputFiles() { + return new InputFile[]{regionsFile, regionAssociationFile, + regionResultFile, + mapsFile, mapResultFile, echotypeFile, + lengthAgeKeyFile, lengthWeightKeyFile, + esduByEchotypeFile, + esduByEchotypeAndSpeciesCategoryFile, + esduBySpeciesAndSizeCategoryFile, + esduBySpeciesAndAgeCategoryFile}; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportConfiguration.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportMode.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportMode.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportMode.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportMode.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,69 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata; + +import fr.ifremer.echobase.I18nAble; + +import static org.nuiton.i18n.I18n.n_; + +/** + * To define results import mode. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public enum ResultsImportMode implements I18nAble { + + /** Import results at voyage level. */ + VOYAGE(n_("echobase.common.resultsImportMode.voyage")), + + /** Import cells Region. */ + REGION(n_("echobase.common.resultsImportMode.region")), + + /** Import cells Map. */ + MAP(n_("echobase.common.resultsImportMode.map")), + + /** Import esdu results by echotype. */ + ESDU_BY_ECHOTYPE(n_("echobase.common.resultsImportMode.esdu.byEchotype")), + + /** Import esdu results by echotype and species category. */ + ESDU_BY_ECHOTYPE_AND_SPECIES_CATEGORY(n_("echobase.common.resultsImportMode.esdu.byEchotypeAndSpeciesCategory")), + + /** Import esdu results by species and size category. */ + ESDU_BY_SPECIES_AND_SIZE_CATEGORY(n_("echobase.common.resultsImportMode.esdu.bySpeciesAndSizeCategory")), + + /** Import esdu results by species and age category. */ + ESDU_BY_SPECIES_AND_AGE_CATEGORY(n_("echobase.common.resultsImportMode.esdu.bySpeciesAndAgeCategory")); + + private final String i18nKey; + + ResultsImportMode(String i18nKey) { + this.i18nKey = i18nKey; + } + + @Override + public String getI18nKey() { + return i18nKey; + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportMode.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -27,8 +27,6 @@ import fr.ifremer.echobase.csv.CsvFileImportResult; import fr.ifremer.echobase.entities.EchoBaseUser; import fr.ifremer.echobase.services.ImportException; -import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration; -import fr.ifremer.echobase.services.configurations.ResultsImportMode; import java.util.List; @@ -61,31 +59,30 @@ service = getService(ResultsVoyageImportService.class); break; - case ACOUSTIC_BY_ECHOTYPE: - case ACOUSTIC_BY_ECHOTYPE_AND_SPECIES_CATEGORY: - case ACOUSTIC_BY_SPECIES_AND_SIZE_CATEGORY: - case ACOUSTIC_BY_SPECIES_AND_AGE_CATEGORY: + case ESDU_BY_ECHOTYPE: + case ESDU_BY_ECHOTYPE_AND_SPECIES_CATEGORY: + case ESDU_BY_SPECIES_AND_SIZE_CATEGORY: + case ESDU_BY_SPECIES_AND_AGE_CATEGORY: service = getService(ResultsEsduCellImportService.class); break; case REGION: - service = getService(ResultsEsduCellImportService.class); + service = getService(ResultsRegionCellImportService.class); break; case MAP: - service = getService(ResultsEsduCellImportService.class); + service = getService(ResultsMapCellImportService.class); break; default: throw new EchoBaseTechnicalException( "Can not treate import result of type " + importMode); } - List<CsvFileImportResult> result = service.startImport(configuration, - user); - + List<CsvFileImportResult> result; + result = service.startImport(configuration, user); return result; } Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,7 +23,10 @@ */ package fr.ifremer.echobase.services.importdata; +import com.google.common.base.Preconditions; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import fr.ifremer.echobase.EchoBaseFunctions; import fr.ifremer.echobase.InputFile; import fr.ifremer.echobase.csv.CsvFileImportResult; import fr.ifremer.echobase.csv.EchoBaseImport; @@ -31,19 +34,25 @@ import fr.ifremer.echobase.entities.EchoBaseUser; import fr.ifremer.echobase.entities.data.Cell; import fr.ifremer.echobase.entities.data.CellDAO; +import fr.ifremer.echobase.entities.data.Data; +import fr.ifremer.echobase.entities.data.DataDAO; import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.CellType; +import fr.ifremer.echobase.entities.references.DataMetadata; +import fr.ifremer.echobase.entities.references.DepthStratum; import fr.ifremer.echobase.services.ImportException; -import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration; -import fr.ifremer.echobase.services.csv.MapImportModel; -import fr.ifremer.echobase.services.csv.MapImportModelRow; -import fr.ifremer.echobase.services.csv.MapResultImportModel; -import fr.ifremer.echobase.services.csv.MapResultImportModelRow; +import fr.ifremer.echobase.services.importdata.csv.MapCellImportModel; +import fr.ifremer.echobase.services.importdata.csv.MapCellImportRow; +import fr.ifremer.echobase.services.importdata.csv.MapCellResultImportModel; +import fr.ifremer.echobase.services.importdata.csv.MapCellResultImportRow; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.util.csv.ImportRuntimeException; import java.io.Reader; +import java.util.Arrays; import java.util.List; +import java.util.Map; import static org.nuiton.i18n.I18n.l_; @@ -98,9 +107,43 @@ protected CsvFileImportResult importMapFile(ResultsImportConfiguration configuration, InputFile inputFile, Voyage voyage) throws ImportException { - MapImportModel csvModel = new MapImportModel( - serviceContext.getConfiguration().getCsvSeparator()); + CellType cellType = getEntityByProperty( + CellType.class, CellType.PROPERTY_ID, "Map"); + Preconditions.checkNotNull(cellType); + + DataMetadata dataXMeta = getEntityByProperty( + DataMetadata.class, DataMetadata.PROPERTY_NAME, "LongitudeEnd"); + Preconditions.checkNotNull(dataXMeta); + + DataMetadata dataYMeta = getEntityByProperty( + DataMetadata.class, DataMetadata.PROPERTY_NAME, "LatitudeEnd"); + Preconditions.checkNotNull(dataYMeta); + + DataMetadata dataDepthSurfaceMeta = getEntityByProperty( + DataMetadata.class, DataMetadata.PROPERTY_NAME, "DepthRefSurfaceEnd"); + Preconditions.checkNotNull(dataDepthSurfaceMeta); + + DataMetadata dataDepthBottomMeta = getEntityByProperty( + DataMetadata.class, DataMetadata.PROPERTY_NAME, "DepthRefBottomEnd"); + Preconditions.checkNotNull(dataDepthBottomMeta); + + DataMetadata dataSurfaceMeta = getEntityByProperty( + DataMetadata.class, DataMetadata.PROPERTY_NAME, "Surface"); + Preconditions.checkNotNull(dataSurfaceMeta); + + // authorize only the selected voyage to be imported + Map<String, Voyage> voyageMap = Maps.uniqueIndex(Arrays.asList( + voyage), EchoBaseFunctions.VOYAGE_NAME); + + Map<String, DepthStratum> depthStratumMap = getEntitiesMap( + DepthStratum.class, + EchoBaseFunctions.DEPTH_STRATUM_ID); + + MapCellImportModel csvModel = new MapCellImportModel( + serviceContext.getConfiguration().getCsvSeparator(), cellType, + voyageMap, depthStratumMap); + if (log.isInfoEnabled()) { log.info("Starts import of Map cells from file " + inputFile.getFileName()); @@ -110,19 +153,79 @@ inputFile.getFileName()); CellDAO dao = getDAO(Cell.class, CellDAO.class); + DataDAO dataDao = getDAO(Data.class, DataDAO.class); Reader reader = getInputFileReader(inputFile); try { - EchoBaseImport<MapImportModelRow> importer = + EchoBaseImport<MapCellImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (MapImportModelRow row : importer) { + int rowNumber = 0; + for (MapCellImportRow row : importer) { + + rowNumber++; configuration.incrementsProgression(); - //TODO - importResult.incrementsNumberUpdated(EchoBaseEntityEnum.Cell); + //TODO Do me + + Cell cell = create(dao, row.getCell()); + + voyage.addPostCell(cell); + importResult.incrementsNumberCreated(EchoBaseEntityEnum.Cell); + + createCellData(dataDao, + cell, + dataXMeta, + String.valueOf(row.getDataX()), + importResult + ); + + createCellData(dataDao, + cell, + dataYMeta, + String.valueOf(row.getDataY()), + importResult + ); + + String depthStratumId = row.getDepthStratum().getId(); + + DataMetadata depth = null; + + if ("SURF".equals(depthStratumId)) { + + depth = dataDepthSurfaceMeta; + } else if ("CLAS".equals(depthStratumId)) { + depth = dataDepthBottomMeta; + + } else { + throw new ImportException( + "[Line " + rowNumber + + "] Depth stratum should be 'SURF' or 'CLAS', " + + "but was " + depthStratumId); + } + + createCellData(dataDao, + cell, + depth, + String.valueOf(row.getDataZ()), + importResult + ); + + createCellData(dataDao, + cell, + dataSurfaceMeta, + String.valueOf(row.getDataLag()), + importResult + ); + + createCellData(dataDao, + cell, + dataSurfaceMeta, + String.valueOf(row.getDataValue()), + importResult + ); } return importResult; @@ -136,7 +239,7 @@ protected CsvFileImportResult importMapResultFile(ResultsImportConfiguration configuration, InputFile inputFile, Voyage voyage) throws ImportException { - MapResultImportModel csvModel = new MapResultImportModel( + MapCellResultImportModel csvModel = new MapCellResultImportModel( serviceContext.getConfiguration().getCsvSeparator()); if (log.isInfoEnabled()) { @@ -153,15 +256,16 @@ Reader reader = getInputFileReader(inputFile); try { - EchoBaseImport<MapResultImportModelRow> importer = + EchoBaseImport<MapCellResultImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (MapResultImportModelRow row : importer) { + for (MapCellResultImportRow row : importer) { configuration.incrementsProgression(); - //TODO + //TODO Do me + importResult.incrementsNumberUpdated(EchoBaseEntityEnum.Cell); } @@ -174,4 +278,17 @@ } + private void createCellData(DataDAO dao, + Cell cell, + DataMetadata dataMetaData, + String dataValue, + CsvFileImportResult importResult) { + + Data data = create(dao); + data.setDataMetadata(dataMetaData); + data.setDataValue(dataValue); + cell.addData(data); + + importResult.incrementsNumberCreated(EchoBaseEntityEnum.Data); + } } Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -41,13 +41,12 @@ import fr.ifremer.echobase.entities.references.DataMetadata; import fr.ifremer.echobase.entities.references.DepthStratum; import fr.ifremer.echobase.services.ImportException; -import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration; -import fr.ifremer.echobase.services.csv.MapImportModel; -import fr.ifremer.echobase.services.csv.MapImportModelRow; -import fr.ifremer.echobase.services.csv.MapResultImportModel; -import fr.ifremer.echobase.services.csv.MapResultImportModelRow; -import fr.ifremer.echobase.services.csv.RegionCellImportModel; -import fr.ifremer.echobase.services.csv.RegionCellImportModelRow; +import fr.ifremer.echobase.services.importdata.csv.RegionCellAssociationImportModel; +import fr.ifremer.echobase.services.importdata.csv.RegionCellAssociationImportRow; +import fr.ifremer.echobase.services.importdata.csv.RegionCellImportModel; +import fr.ifremer.echobase.services.importdata.csv.RegionCellImportRow; +import fr.ifremer.echobase.services.importdata.csv.RegionCellResultImportModel; +import fr.ifremer.echobase.services.importdata.csv.RegionCellResultImportRow; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.util.csv.ImportRuntimeException; @@ -171,12 +170,12 @@ Reader reader = getInputFileReader(inputFile); try { - EchoBaseImport<RegionCellImportModelRow> importer = + EchoBaseImport<RegionCellImportRow> importer = EchoBaseImport.newImport(csvModel, reader); int rowNumber = 0; configuration.incrementsProgression(); - for (RegionCellImportModelRow row : importer) { + for (RegionCellImportRow row : importer) { rowNumber++; configuration.incrementsProgression(); @@ -257,7 +256,7 @@ protected CsvFileImportResult importRegionAssociationFile(ResultsImportConfiguration configuration, InputFile inputFile, Voyage voyage) throws ImportException { - MapImportModel csvModel = new MapImportModel( + RegionCellAssociationImportModel csvModel = new RegionCellAssociationImportModel( serviceContext.getConfiguration().getCsvSeparator()); if (log.isInfoEnabled()) { @@ -272,15 +271,16 @@ Reader reader = getInputFileReader(inputFile); try { - EchoBaseImport<MapImportModelRow> importer = + EchoBaseImport<RegionCellAssociationImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (MapImportModelRow row : importer) { + for (RegionCellAssociationImportRow row : importer) { configuration.incrementsProgression(); - //TODO + //TODO Do me + importResult.incrementsNumberUpdated(EchoBaseEntityEnum.Cell); } @@ -295,7 +295,7 @@ protected CsvFileImportResult importRegionResultFile(ResultsImportConfiguration configuration, InputFile inputFile, Voyage voyage) throws ImportException { - MapResultImportModel csvModel = new MapResultImportModel( + RegionCellResultImportModel csvModel = new RegionCellResultImportModel( serviceContext.getConfiguration().getCsvSeparator()); if (log.isInfoEnabled()) { @@ -311,15 +311,16 @@ Reader reader = getInputFileReader(inputFile); try { - EchoBaseImport<MapResultImportModelRow> importer = + EchoBaseImport<RegionCellResultImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (MapResultImportModelRow row : importer) { + for (RegionCellResultImportRow row : importer) { configuration.incrementsProgression(); - //TODO + //TODO Do me + importResult.incrementsNumberUpdated(EchoBaseEntityEnum.Cell); } Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsVoyageImportService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsVoyageImportService.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsVoyageImportService.java 2012-03-27 23:02:51 UTC (rev 420) @@ -46,13 +46,12 @@ import fr.ifremer.echobase.entities.references.SpeciesCategoryDAO; import fr.ifremer.echobase.entities.references.Strata; import fr.ifremer.echobase.services.ImportException; -import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration; -import fr.ifremer.echobase.services.csv.EchotypeImportModel; -import fr.ifremer.echobase.services.csv.EchotypeImportModelRow; -import fr.ifremer.echobase.services.csv.LengthAgeKeyImportModel; -import fr.ifremer.echobase.services.csv.LengthAgeKeyImportModelRow; -import fr.ifremer.echobase.services.csv.LengthWeightKeyImportModel; -import fr.ifremer.echobase.services.csv.LengthWeightKeyImportModelRow; +import fr.ifremer.echobase.services.importdata.csv.EchotypeImportModel; +import fr.ifremer.echobase.services.importdata.csv.EchotypeImportRow; +import fr.ifremer.echobase.services.importdata.csv.LengthAgeKeyImportModel; +import fr.ifremer.echobase.services.importdata.csv.LengthAgeKeyImportRow; +import fr.ifremer.echobase.services.importdata.csv.LengthWeightKeyImportModel; +import fr.ifremer.echobase.services.importdata.csv.LengthWeightKeyImportRow; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.topia.persistence.TopiaDAO; @@ -107,7 +106,7 @@ if (inputFile.hasFile()) { CsvFileImportResult importResult = importLenthAgeKey( - configuration, + configuration, inputFile, voyageMap, speciesMap @@ -175,11 +174,11 @@ Reader reader = getInputFileReader(inputFile); try { - Import<LengthWeightKeyImportModelRow> importer = + Import<LengthWeightKeyImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (LengthWeightKeyImportModelRow row : importer) { + for (LengthWeightKeyImportRow row : importer) { configuration.incrementsProgression(); Voyage voyage = row.getVoyage(); @@ -248,12 +247,12 @@ Reader reader = getInputFileReader(inputFile); try { - Import<LengthAgeKeyImportModelRow> importer = + Import<LengthAgeKeyImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (LengthAgeKeyImportModelRow row : importer) { + for (LengthAgeKeyImportRow row : importer) { configuration.incrementsProgression(); @@ -303,12 +302,12 @@ Reader reader = getInputFileReader(inputFile); try { - Import<EchotypeImportModelRow> importer = + Import<EchotypeImportRow> importer = EchoBaseImport.newImport(csvModel, reader); configuration.incrementsProgression(); - for (EchotypeImportModelRow row : importer) { + for (EchotypeImportRow row : importer) { configuration.incrementsProgression(); Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,164 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Cell; +import fr.ifremer.echobase.entities.data.Data; +import fr.ifremer.echobase.entities.data.DataAcquisition; +import fr.ifremer.echobase.entities.data.DataProcessing; +import fr.ifremer.echobase.entities.references.AcousticInstrument; + +import java.util.Map; + +/** + * To import acoustic datas (says {@link DataAcquisition}, + * {@link DataProcessing}, {@link Cell} and {@link Data}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class AcousticDataImportModel extends AbstractImportModel<AcousticDataImportRow> { + + + /* +ESDU Data + +Latitude MOVIES_EILayer\\cellset\\lat, OK +Longitude MOVIES_EILayer\\cellset\\long OK +depth MOVIES_EILayer\\shipnav\\depth OK +timeStart MOVIES_EILayer\\cellset\\datestart OK +timeEnd MOVIES_EILayer\\cellset\\dateend OK +NASC MOVIES_EILayer\\eilayer\\sa OK +Volume MOVIES_EILayer\\cellset\\volume OK +Surface MOVIES_EILayer\\cellset\\area OK +NumberOfSamplesRecorded MOVIES_EILayer\\cellset\\nt OK +NumberOfSamplesEchoIntegrated MOVIES_EILayer\\cellset\\ni"OK + + +Elementary Data + +Latitude MOVIES_EILayer\\cellset\\lat +Longitude MOVIES_EILayer\\cellset\\long +depthStart (surface ou bottom) MOVIES_EILayer\\cellset\\depthstart +depthEnd (surface ou bottom) MOVIES_EILayer\\cellset\\depthend +timeStart MOVIES_EILayer\\cellset\\datestart +timeEnd MOVIES_EILayer\\cellset\\dateend +NASC MOVIES_EILayer\\eilayer\\sa +Volume MOVIES_EILayer\\cellset\\volume +Surface MOVIES_EILayer\\cellset\\area +NumberOfSamplesRecorded MOVIES_EILayer\\cellset\\nt +NumberOfSamplesEchoIntegrated MOVIES_EILayer\\cellset\\ni +minEIthr MOVIES_EILayer\cellset\thresholdlow +maxEIthr MOVIES_EILayer\cellset\thresholdup + */ + public AcousticDataImportModel(char separator, + Map<String, AcousticInstrument> instrumentsById) { + super(separator); + + newMandatoryColumn("MOVIES_EILayer", AcousticDataImportRow.PROPERTY_EI_LAYER);//A + newIgnoredColumn("MOVIES_EILayer\\sndset");//B + newIgnoredColumn("MOVIES_EILayer\\sndset\\sndname");//C + newIgnoredColumn("MOVIES_EILayer\\sndset\\sndident");//D + newForeignKeyColumn("MOVIES_EILayer\\sndset\\softChannelId", AcousticDataImportRow.PROPERTY_ACOUSTIC_INSTRUMENT, AcousticInstrument.class, AcousticInstrument.PROPERTY_ID, instrumentsById); //E + newIgnoredColumn("MOVIES_EILayer\\sndset\\channelName");//F + newIgnoredColumn("MOVIES_EILayer\\sndset\\dataType");//G + newIgnoredColumn("MOVIES_EILayer\\sndset\\beamType");//H + newIgnoredColumn("MOVIES_EILayer\\sndset\\acousticFrequency");//I + newIgnoredColumn("MOVIES_EILayer\\sndset\\startSample");//J + newIgnoredColumn("MOVIES_EILayer\\sndset\\mainBeamAlongSteeringAngle");//K + newIgnoredColumn("MOVIES_EILayer\\sndset\\mainBeamAthwartSteeringAngle");//L + newMandatoryColumn("MOVIES_EILayer\\sndset\\absorptionCoef", AcousticDataImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_ABSORPTION, EchobaseCsvUtil.FLOAT);//M + newMandatoryColumn("MOVIES_EILayer\\sndset\\transmissionPower", AcousticDataImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_POWER, EchobaseCsvUtil.INTEGER);//N + newMandatoryColumn("MOVIES_EILayer\\sndset\\beamAlongAngleSensitivity", AcousticDataImportRow.PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ALONGSHIP, EchobaseCsvUtil.FLOAT);//O + newMandatoryColumn("MOVIES_EILayer\\sndset\\beamAthwartAngleSensitivity", AcousticDataImportRow.PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ATHWARTSHIP, EchobaseCsvUtil.FLOAT);//P + newIgnoredColumn("MOVIES_EILayer\\sndset\\beam3dBWidthAlong");//Q + newIgnoredColumn("MOVIES_EILayer\\sndset\\beam3dBWidthAthwart");//R + newMandatoryColumn("MOVIES_EILayer\\sndset\\beamEquTwoWayAngle", AcousticDataImportRow.PROPERTY_TRANSDUCER_ACQUISITION_PSI, EchobaseCsvUtil.FLOAT);//S + newMandatoryColumn("MOVIES_EILayer\\sndset\\beamGain", AcousticDataImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_GAIN, EchobaseCsvUtil.FLOAT);//T + newMandatoryColumn("MOVIES_EILayer\\sndset\\beamSACorrection", AcousticDataImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_SACORRECTION, EchobaseCsvUtil.FLOAT);//U + newIgnoredColumn("MOVIES_EILayer\\sndset\\bottomDetectionMinDepth");//V + newIgnoredColumn("MOVIES_EILayer\\sndset\\bottomDetectionMaxDepth");//W + newIgnoredColumn("MOVIES_EILayer\\sndset\\bottomDetectionMinLevel");//X + newIgnoredColumn("MOVIES_EILayer\\sndset\\AlongTXRXWeightId");//Y + newIgnoredColumn("MOVIES_EILayer\\sndset\\AthwartTXRXWeightId");//Z + newIgnoredColumn("MOVIES_EILayer\\sndset\\SplitBeamAlongTXRXWeightId");//AA + newIgnoredColumn("MOVIES_EILayer\\sndset\\SplitBeamAthwartTXRXWeightId");//AB + newIgnoredColumn("MOVIES_EILayer\\sndset\\bandWidth");//AC + newIgnoredColumn("MOVIES_EILayer\\sndset\\tvgminrange");//AD + newIgnoredColumn("MOVIES_EILayer\\sndset\\tvgmaxrange");//AE + newMandatoryColumn("MOVIES_EILayer\\sndset\\pulseduration", AcousticDataImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_PULSE_LENGTH, EchobaseCsvUtil.FLOAT);//AF + newIgnoredColumn("MOVIES_EILayer\\shipnav");//AG + newIgnoredColumn("MOVIES_EILayer\\shipnav\\lat");//AH + newIgnoredColumn("MOVIES_EILayer\\shipnav\\long");//AI + newIgnoredColumn("MOVIES_EILayer\\shipnav\\alt");//AJ + newIgnoredColumn("MOVIES_EILayer\\shipnav\\gndspeed");//AK + newIgnoredColumn("MOVIES_EILayer\\shipnav\\gndcourse");//AL + newIgnoredColumn("MOVIES_EILayer\\shipnav\\surfspeed");//AM + newIgnoredColumn("MOVIES_EILayer\\shipnav\\surfcourse");//AN + newIgnoredColumn("MOVIES_EILayer\\shipnav\\driftspeed");//AO + newIgnoredColumn("MOVIES_EILayer\\shipnav\\driftcourse");//AP + newIgnoredColumn("MOVIES_EILayer\\shipnav\\heading");//AQ + newIgnoredColumn("MOVIES_EILayer\\shipnav\\roll");//AR + newIgnoredColumn("MOVIES_EILayer\\shipnav\\pitch");//AS + newIgnoredColumn("MOVIES_EILayer\\shipnav\\heave");//AT + newMandatoryColumn("MOVIES_EILayer\\shipnav\\depth", AcousticDataImportRow.PROPERTY_ESDU_CELL_DATA_DEPTH);//AU + newIgnoredColumn("MOVIES_EILayer\\shipnav\\draught");//AV + + // Cell elementary Datas + newIgnoredColumn("MOVIES_EILayer\\cellset");//AW + newMandatoryColumn("MOVIES_EILayer\\cellset\\cellnum", AcousticDataImportRow.PROPERTY_CELL_NUM, EchobaseCsvUtil.PRIMITIVE_INTEGER);//AX + newMandatoryColumn("MOVIES_EILayer\\cellset\\celltype", AcousticDataImportRow.PROPERTY_CELL_TYPE, EchobaseCsvUtil.PRIMITIVE_INTEGER);//AY + newMandatoryColumn("MOVIES_EILayer\\cellset\\depthstart", AcousticDataImportRow.PROPERTY_CELL_DEPTH_START, EchobaseCsvUtil.PRIMITIVE_FLOAT);//AZ + newMandatoryColumn("MOVIES_EILayer\\cellset\\depthend", AcousticDataImportRow.PROPERTY_CELL_DEPTH_END, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BA + newIgnoredColumn("MOVIES_EILayer\\cellset\\indexstart");//BB + newIgnoredColumn("MOVIES_EILayer\\cellset\\indexend");//BC + newMandatoryColumn("MOVIES_EILayer\\cellset\\datestart", AcousticDataImportRow.PROPERTY_CELL_DATE_START, EchobaseCsvUtil.IMPORT_DAY_TIME3);//BD + newMandatoryColumn("MOVIES_EILayer\\cellset\\dateend", AcousticDataImportRow.PROPERTY_CELL_DATE_END, EchobaseCsvUtil.IMPORT_DAY_TIME3);//BE + + newMandatoryColumn("MOVIES_EILayer\\cellset\\lat", AcousticDataImportRow.PROPERTY_CELL_LATITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BF + newMandatoryColumn("MOVIES_EILayer\\cellset\\long", AcousticDataImportRow.PROPERTY_CELL_LONGITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BG + newMandatoryColumn("MOVIES_EILayer\\cellset\\volume", AcousticDataImportRow.PROPERTY_CELL_VOLUME, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BH + newMandatoryColumn("MOVIES_EILayer\\cellset\\area", AcousticDataImportRow.PROPERTY_CELL_SURFACE, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BI + newIgnoredColumn("MOVIES_EILayer\\cellset\\diststart");//BJ + newIgnoredColumn("MOVIES_EILayer\\cellset\\distend");//BK + newMandatoryColumn("MOVIES_EILayer\\cellset\\thresholdup", AcousticDataImportRow.PROPERTY_E_ITHRESHOLD_HIGH, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BL + newMandatoryColumn("MOVIES_EILayer\\cellset\\thresholdlow", AcousticDataImportRow.PROPERTY_E_ITHRESHOLD_LOW, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BM + newIgnoredColumn("MOVIES_EILayer\\eilayer");//BN + newMandatoryColumn("MOVIES_EILayer\\eilayer\\sa", AcousticDataImportRow.PROPERTY_CELL_NASC, EchobaseCsvUtil.NA_TO_FLOAT_PARSER);//BO + newIgnoredColumn("MOVIES_EILayer\\eilayer\\sv");//BP + newMandatoryColumn("MOVIES_EILayer\\eilayer\\ni", AcousticDataImportRow.PROPERTY_CELL_NUMBER_OF_SAMPLES_ECHO_INTEGRATED, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BQ + newMandatoryColumn("MOVIES_EILayer\\eilayer\\nt", AcousticDataImportRow.PROPERTY_CELL_NUMBER_OF_SAMPLES_RECORDED, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BR + newIgnoredColumn("MOVIES_EILayer\\boterr");//BR + newIgnoredColumn("MOVIES_EILayer\\boterr\\sa");//BT + newIgnoredColumn("MOVIES_EILayer\\boterr\\ni");//BU + newMandatoryColumn("MOVIES_EILayer\\sndset\\soundcelerity", AcousticDataImportRow.PROPERTY_SOUND_CELERITY);//BV + } + + @Override + public AcousticDataImportRow newEmptyInstance() { + return new AcousticDataImportRow(); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,365 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.references.AcousticInstrument; + +import java.util.Date; + +/** + * Bean of a row for {@link AcousticDataImportModel} import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class AcousticDataImportRow { + + public static final String PROPERTY_ACOUSTIC_INSTRUMENT = "acousticInstrument"; + + public static final String PROPERTY_EI_LAYER = "eiLayer"; + + public static final String PROPERTY_CELL_TYPE = "cellType"; + + public static final String PROPERTY_CELL_NUM = "cellNum"; + + public static final String PROPERTY_ESDU_CELL_DATA_DEPTH = "esduCellDataDepth"; + + public static final String PROPERTY_CELL_DATE_START = "cellDateStart"; + + public static final String PROPERTY_CELL_DATE_END = "cellDateEnd"; + + public static final String PROPERTY_CELL_DEPTH_START = "cellDepthStart"; + + public static final String PROPERTY_CELL_DEPTH_END = "cellDepthEnd"; + + public static final String PROPERTY_CELL_NASC = "cellNasc"; + + public static final String PROPERTY_TRANSCEIVER_ACQUISITION_PULSE_LENGTH = "transceiverAcquisitionPulseLength"; + + public static final String PROPERTY_TRANSCEIVER_ACQUISITION_GAIN = "transceiverAcquisitionGain"; + + public static final String PROPERTY_TRANSCEIVER_ACQUISITION_ABSORPTION = "transceiverAcquisitionAbsorption"; + + public static final String PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ATHWARTSHIP = "transducerAcquisitionBeamAngleAthwartship"; + + public static final String PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ALONGSHIP = "transducerAcquisitionBeamAngleAlongship"; + + public static final String PROPERTY_TRANSDUCER_ACQUISITION_PSI = "transducerAcquisitionPsi"; + + public static final String PROPERTY_TRANSCEIVER_ACQUISITION_POWER = "transceiverAcquisitionPower"; + + public static final String PROPERTY_TRANSCEIVER_ACQUISITION_SACORRECTION = "transceiverAcquisitionSacorrection"; + + public static final String PROPERTY_E_ITHRESHOLD_LOW = "eIThresholdLow"; + + public static final String PROPERTY_E_ITHRESHOLD_HIGH = "eIThresholdHigh"; + + public static final String PROPERTY_CELL_VOLUME = "cellVolume"; + + public static final String PROPERTY_CELL_SURFACE = "cellSurface"; + + public static final String PROPERTY_CELL_NUMBER_OF_SAMPLES_RECORDED = "cellNumberOfSamplesRecorded"; + + public static final String PROPERTY_CELL_NUMBER_OF_SAMPLES_ECHO_INTEGRATED = "cellNumberOfSamplesEchoIntegrated"; + + public static final String PROPERTY_SOUND_CELERITY = "soundCelerity"; + + public static final String PROPERTY_CELL_LATITUDE = "cellLatitude"; + + public static final String PROPERTY_CELL_LONGITUDE = "cellLongitude"; + + protected String eiLayer; + + protected String esduCellDataDepth; + + protected Date cellDateStart; + + protected Date cellDateEnd; + + protected float cellLatitude; + + protected float cellLongitude; + + protected Float cellVolume; + + protected int cellSurface; + + protected Integer cellNumberOfSamplesRecorded; + + protected Integer cellNumberOfSamplesEchoIntegrated; + + protected int cellType; + + protected int cellNum; + + protected float cellDepthStart; + + protected float cellDepthEnd; + + protected Float cellNasc; + + protected float transceiverAcquisitionPulseLength; + + protected float transceiverAcquisitionGain; + + protected float transceiverAcquisitionAbsorption; + + protected float transceiverAcquisitionPower; + + protected float transceiverAcquisitionSacorrection; + + protected float transducerAcquisitionBeamAngleAthwartship; + + protected float transducerAcquisitionBeamAngleAlongship; + + protected float transducerAcquisitionPsi; + + protected int eIThresholdLow; + + protected int eIThresholdHigh; + + protected String soundCelerity; + + protected AcousticInstrument acousticInstrument; + + public boolean isCellToAdd() { + return cellNasc != null; + } + + public String getEiLayer() { + return eiLayer; + } + + public void setEiLayer(String eiLayer) { + this.eiLayer = eiLayer; + } + + public AcousticInstrument getAcousticInstrument() { + return acousticInstrument; + } + + public void setAcousticInstrument(AcousticInstrument acousticInstrument) { + this.acousticInstrument = acousticInstrument; + } + + public Date getCellDateStart() { + return cellDateStart; + } + + public void setCellDateStart(Date cellDateStart) { + this.cellDateStart = cellDateStart; + } + + public int getCellType() { + return cellType; + } + + public void setCellType(int cellType) { + this.cellType = cellType; + } + + public int getCellNum() { + return cellNum; + } + + public void setCellNum(int cellNum) { + this.cellNum = cellNum; + } + + public String getEsduCellDataDepth() { + return esduCellDataDepth; + } + + public void setEsduCellDataDepth(String esduCellDataDepth) { + this.esduCellDataDepth = esduCellDataDepth; + } + + public float getCellDepthStart() { + return cellDepthStart; + } + + public void setCellDepthStart(float cellDepthStart) { + this.cellDepthStart = cellDepthStart; + } + + public float getCellDepthEnd() { + return cellDepthEnd; + } + + public void setCellDepthEnd(float cellDepthEnd) { + this.cellDepthEnd = cellDepthEnd; + } + + public Float getCellNasc() { + return cellNasc; + } + + public void setCellNasc(Float cellNasc) { + this.cellNasc = cellNasc; + } + + public float getTransceiverAcquisitionPulseLength() { + return transceiverAcquisitionPulseLength; + } + + public void setTransceiverAcquisitionPulseLength(float transceiverAcquisitionPulseLength) { + this.transceiverAcquisitionPulseLength = transceiverAcquisitionPulseLength; + } + + public float getTransceiverAcquisitionGain() { + return transceiverAcquisitionGain; + } + + public void setTransceiverAcquisitionGain(float transceiverAcquisitionGain) { + this.transceiverAcquisitionGain = transceiverAcquisitionGain; + } + + public float getTransceiverAcquisitionAbsorption() { + return transceiverAcquisitionAbsorption; + } + + public void setTransceiverAcquisitionAbsorption(float transceiverAcquisitionAbsorption) { + this.transceiverAcquisitionAbsorption = transceiverAcquisitionAbsorption; + } + + public float getTransceiverAcquisitionPower() { + return transceiverAcquisitionPower; + } + + public void setTransceiverAcquisitionPower(float transceiverAcquisitionPower) { + this.transceiverAcquisitionPower = transceiverAcquisitionPower; + } + + public float getTransceiverAcquisitionSacorrection() { + return transceiverAcquisitionSacorrection; + } + + public void setTransceiverAcquisitionSacorrection(float transceiverAcquisitionSacorrection) { + this.transceiverAcquisitionSacorrection = transceiverAcquisitionSacorrection; + } + + public float getTransducerAcquisitionBeamAngleAthwartship() { + return transducerAcquisitionBeamAngleAthwartship; + } + + public void setTransducerAcquisitionBeamAngleAthwartship(float transducerAcquisitionBeamAngleAthwartship) { + this.transducerAcquisitionBeamAngleAthwartship = transducerAcquisitionBeamAngleAthwartship; + } + + public float getTransducerAcquisitionBeamAngleAlongship() { + return transducerAcquisitionBeamAngleAlongship; + } + + public void setTransducerAcquisitionBeamAngleAlongship(float transducerAcquisitionBeamAngleAlongship) { + this.transducerAcquisitionBeamAngleAlongship = transducerAcquisitionBeamAngleAlongship; + } + + public float getTransducerAcquisitionPsi() { + return transducerAcquisitionPsi; + } + + public void setTransducerAcquisitionPsi(float transducerAcquisitionPsi) { + this.transducerAcquisitionPsi = transducerAcquisitionPsi; + } + + public float getCellLatitude() { + return cellLatitude; + } + + public void setCellLatitude(float cellLatitude) { + this.cellLatitude = cellLatitude; + } + + public float getCellLongitude() { + return cellLongitude; + } + + public void setCellLongitude(float cellLongitude) { + this.cellLongitude = cellLongitude; + } + + public int geteIThresholdLow() { + return eIThresholdLow; + } + + public void seteIThresholdLow(int eIThresholdLow) { + this.eIThresholdLow = eIThresholdLow; + } + + public int geteIThresholdHigh() { + return eIThresholdHigh; + } + + public void seteIThresholdHigh(int eIThresholdHigh) { + this.eIThresholdHigh = eIThresholdHigh; + } + + public Date getCellDateEnd() { + return cellDateEnd; + } + + public void setCellDateEnd(Date cellDateEnd) { + this.cellDateEnd = cellDateEnd; + } + + public Float getCellVolume() { + return cellVolume; + } + + public void setCellVolume(Float cellVolume) { + this.cellVolume = cellVolume; + } + + public int getCellSurface() { + return cellSurface; + } + + public void setCellSurface(int cellSurface) { + this.cellSurface = cellSurface; + } + + public Integer getCellNumberOfSamplesRecorded() { + return cellNumberOfSamplesRecorded; + } + + public void setCellNumberOfSamplesRecorded(Integer cellNumberOfSamplesRecorded) { + this.cellNumberOfSamplesRecorded = cellNumberOfSamplesRecorded; + } + + public Integer getCellNumberOfSamplesEchoIntegrated() { + return cellNumberOfSamplesEchoIntegrated; + } + + public void setCellNumberOfSamplesEchoIntegrated(Integer cellNumberOfSamplesEchoIntegrated) { + this.cellNumberOfSamplesEchoIntegrated = cellNumberOfSamplesEchoIntegrated; + } + + public String getSoundCelerity() { + return soundCelerity; + } + + public void setSoundCelerity(String soundCelerity) { + this.soundCelerity = soundCelerity; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/BiometrySampleImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/BiometrySampleImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/BiometrySampleImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/BiometrySampleImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,72 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Operation; +import fr.ifremer.echobase.entities.data.Sample; +import fr.ifremer.echobase.entities.data.SampleData; +import fr.ifremer.echobase.entities.references.SampleDataType; +import fr.ifremer.echobase.entities.references.Species; + +import java.util.Map; + +/** + * Model to import {@link Sample} of total biometry. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class BiometrySampleImportModel extends AbstractImportModel<BiometrySampleImportRow> { + + public BiometrySampleImportModel(char separator, Map<String, Operation> operationMap, + Map<String, Species> speciesMap, + Map<String, SampleDataType> sampleDataTypeMap) { + super(separator); + + /* + operationID + baracoudacode + numFish + dataLabel + dataValue + name + */ + + newForeignKeyColumn("operationID", BiometrySampleImportRow.PROPERTY_OPERATION, Operation.class, Operation.PROPERTY_ID, operationMap); + newForeignKeyColumn("baracoudacode", BiometrySampleImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); + + newMandatoryColumn(BiometrySampleImportRow.PROPERTY_NUM_FISH, EchobaseCsvUtil.PRIMITIVE_INTEGER); + + newForeignKeyColumn("name", SampleData.PROPERTY_SAMPLE_DATA_TYPE, SampleDataType.class, SampleDataType.PROPERTY_NAME, sampleDataTypeMap); + newMandatoryColumn(SampleData.PROPERTY_DATA_LABEL); + newMandatoryColumn(SampleData.PROPERTY_DATA_VALUE, EchobaseCsvUtil.NA_TO_FLOAT_PARSER); + } + + @Override + public BiometrySampleImportRow newEmptyInstance() { + return new BiometrySampleImportRow(); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/BiometrySampleImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/BiometrySampleImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/BiometrySampleImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/BiometrySampleImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/BiometrySampleImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,97 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.Operation; +import fr.ifremer.echobase.entities.data.SampleData; +import fr.ifremer.echobase.entities.data.SampleDataImpl; +import fr.ifremer.echobase.entities.references.SampleDataType; +import fr.ifremer.echobase.entities.references.Species; + +/** + * Bean used as a row for import of {@link BiometrySampleImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class BiometrySampleImportRow { + + public static final String PROPERTY_NUM_FISH = "numFish"; + + public static final String PROPERTY_OPERATION = "operation"; + + public static final String PROPERTY_SPECIES = "species"; + + protected final SampleData sampleData; + + protected Operation operation; + + protected Species species; + + protected int numFish; + + public BiometrySampleImportRow() { + sampleData = new SampleDataImpl(); + } + + public Operation getOperation() { + return operation; + } + + public void setOperation(Operation operation) { + this.operation = operation; + } + + public Species getSpecies() { + return species; + } + + public void setSpecies(Species species) { + this.species = species; + } + + public int getNumFish() { + return numFish; + } + + public void setNumFish(int numfish) { + this.numFish = numfish; + } + + public void setDataValue(Float dataValue) { + sampleData.setDataValue(dataValue); + } + + public void setSampleDataType(SampleDataType sampleDataType) { + sampleData.setSampleDataType(sampleDataType); + } + + public void setDataLabel(String dataLabel) { + sampleData.setDataLabel(dataLabel); + } + + public SampleData getSampleData() { + return sampleData; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/BiometrySampleImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EchotypeImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EchotypeImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EchotypeImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,77 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.entities.data.Echotype; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.DepthStratum; +import fr.ifremer.echobase.entities.references.Species; + +import java.util.Map; + +/** + * Model to import echotypes. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class EchotypeImportModel extends AbstractImportModel<EchotypeImportRow> { + + protected final Map<String, Voyage> voyageMap; + + protected final Map<String, DepthStratum> depthStratumMap; + + protected final Map<String, Species> speciesMap; + + public EchotypeImportModel(char separator, + Map<String, Voyage> voyageMap, + Map<String, DepthStratum> depthStratumMap, + Map<String, Species> speciesMap) { + super(separator); + this.voyageMap = voyageMap; + this.depthStratumMap = depthStratumMap; + this.speciesMap = speciesMap; + + /* + voyage + echotypeName + DepthStratumID + meaning + baracoudacode + */ + + newMandatoryColumn("echotypeName", Echotype.PROPERTY_NAME); + newMandatoryColumn("meaning", Echotype.PROPERTY_MEANING); + newForeignKeyColumn(EchotypeImportRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, voyageMap); + newForeignKeyColumn("DepthStratumID", Echotype.PROPERTY_DEPTH_STRATUM, DepthStratum.class, DepthStratum.PROPERTY_ID, depthStratumMap); + newForeignKeyColumn("baracoudacode", Echotype.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); + + } + + @Override + public EchotypeImportRow newEmptyInstance() { + return new EchotypeImportRow(); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EchotypeImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EchotypeImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EchotypeImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EchotypeImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,81 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.Echotype; +import fr.ifremer.echobase.entities.data.EchotypeImpl; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.DepthStratum; +import fr.ifremer.echobase.entities.references.Species; + +import java.io.Serializable; + +/** + * Bean used as a row for import of {@link EchotypeImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class EchotypeImportRow implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final String PROPERTY_VOYAGE = "voyage"; + + protected Voyage voyage; + + protected final Echotype echotype; + + public EchotypeImportRow() { + echotype = new EchotypeImpl(); + } + + public Voyage getVoyage() { + return voyage; + } + + public void setVoyage(Voyage voyage) { + this.voyage = voyage; + } + + public Echotype getEchotype() { + return echotype; + } + + public void setName(String name) { + echotype.setName(name); + } + + public void setMeaning(String meaning) { + echotype.setMeaning(meaning); + } + + public void setDepthStratum(DepthStratum depthStratum) { + echotype.setDepthStratum(depthStratum); + } + + public void setSpecies(Species species) { + echotype.addSpecies(species); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EchotypeImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeAndSpeciesCategoryImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,83 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.CellDAO; +import fr.ifremer.echobase.entities.data.Echotype; +import fr.ifremer.echobase.entities.data.Result; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.DataMetadata; +import fr.ifremer.echobase.entities.references.SizeCategory; +import fr.ifremer.echobase.entities.references.Species; + +import java.util.List; +import java.util.Map; + +/** + * Model to import {@link Result} for esdu cell and echotypes. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class EsduResultByEchotypeAndSpeciesCategoryImportModel extends AbstractImportModel<EsduResultByEchotypeAndSpeciesCategoryImportRow> { + + public static final String[] COLUMN_NAMES_TO_EXCLUDE = { + "name", + "baracoudaCode", + "sizeCategory", + EsduResultByEchotypeImportRow.PROPERTY_ECHOTYPE + }; + + public EsduResultByEchotypeAndSpeciesCategoryImportModel( + char separator, + Map<String, Echotype> echotypeMap, + Map<String, Species> speciesMap, + Map<String, SizeCategory> sizeCategoryMap, + Voyage voyage, + CellDAO cellDAO, + List<DataMetadata> dataMetadatas) { + super(separator); + + newForeignKeyColumn(EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_ECHOTYPE, Echotype.class, Echotype.PROPERTY_NAME, echotypeMap); + newForeignKeyColumn("baracoudaCode", EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); + newForeignKeyColumn(EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_SIZE_CATEGORY, SizeCategory.class, SizeCategory.PROPERTY_NAME, sizeCategoryMap); + newMandatoryColumn("name", EsduResultByEchotypeAndSpeciesCategoryImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, cellDAO)); + + for (DataMetadata metadata : dataMetadatas) { + String name = metadata.getName(); + newMandatoryColumn( + name, + EchobaseCsvUtil.newResultValueParser(metadata), + EchobaseCsvUtil.<EsduResultByEchotypeAndSpeciesCategoryImportRow>newResultValueSetter()); + } + } + + @Override + public EsduResultByEchotypeAndSpeciesCategoryImportRow newEmptyInstance() { + return new EsduResultByEchotypeAndSpeciesCategoryImportRow(); + } + +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeAndSpeciesCategoryImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,104 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import com.google.common.collect.Lists; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Cell; +import fr.ifremer.echobase.entities.data.Echotype; +import fr.ifremer.echobase.entities.data.Result; +import fr.ifremer.echobase.entities.references.SizeCategory; +import fr.ifremer.echobase.entities.references.Species; + +import java.util.List; + +/** + * Bean used as a row for import of + * {@link EsduResultByEchotypeAndSpeciesCategoryImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class EsduResultByEchotypeAndSpeciesCategoryImportRow implements EchobaseCsvUtil.ResultAble { + + public static final String PROPERTY_ECHOTYPE = "echotype"; + + public static final String PROPERTY_CELL = "cell"; + + public static final String PROPERTY_SPECIES = "species"; + + public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory"; + + protected Echotype echotype; + + protected Cell cell; + + protected List<Result> result = Lists.newArrayList(); + + protected Species species; + + private SizeCategory sizeCategory; + + public Echotype getEchotype() { + return echotype; + } + + public void setEchotype(Echotype echotype) { + this.echotype = echotype; + } + + public Cell getCell() { + return cell; + } + + public void setCell(Cell cell) { + this.cell = cell; + } + + public List<Result> getResult() { + return result; + } + + @Override + public void addResult(Result result) { + this.result.add(result); + } + + public Species getSpecies() { + return species; + } + + public void setSpecies(Species species) { + this.species = species; + } + + public SizeCategory getSizeCategory() { + return sizeCategory; + } + + public void setSizeCategory(SizeCategory sizeCategory) { + this.sizeCategory = sizeCategory; + } + +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeAndSpeciesCategoryImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,75 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.CellDAO; +import fr.ifremer.echobase.entities.data.Echotype; +import fr.ifremer.echobase.entities.data.Result; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.DataMetadata; + +import java.util.List; +import java.util.Map; + +/** + * Model to import {@link Result} for esdu cell and echotypes. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class EsduResultByEchotypeImportModel extends AbstractImportModel<EsduResultByEchotypeImportRow> { + + public static final String[] COLUMN_NAMES_TO_EXCLUDE = { + "name", + EsduResultByEchotypeImportRow.PROPERTY_ECHOTYPE + }; + + public EsduResultByEchotypeImportModel( + char separator, + Map<String, Echotype> echotypeMap, + Voyage voyage, + CellDAO cellDAO, + List<DataMetadata> dataMetadatas) { + super(separator); + + newForeignKeyColumn(EsduResultByEchotypeImportRow.PROPERTY_ECHOTYPE, Echotype.class, Echotype.PROPERTY_NAME, echotypeMap); + newMandatoryColumn("name", EsduResultByEchotypeImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, cellDAO)); + + for (DataMetadata metadata : dataMetadatas) { + String name = metadata.getName(); + newMandatoryColumn( + name, + EchobaseCsvUtil.newResultValueParser(metadata), + EchobaseCsvUtil.<EsduResultByEchotypeImportRow>newResultValueSetter()); + } + } + + @Override + public EsduResultByEchotypeImportRow newEmptyInstance() { + return new EsduResultByEchotypeImportRow(); + } + +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultByEchotypeImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,76 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import com.google.common.collect.Lists; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Cell; +import fr.ifremer.echobase.entities.data.Echotype; +import fr.ifremer.echobase.entities.data.Result; + +import java.util.List; + +/** + * Bean used as a row for import of {@link EsduResultByEchotypeImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class EsduResultByEchotypeImportRow implements EchobaseCsvUtil.ResultAble { + + public static final String PROPERTY_ECHOTYPE = "echotype"; + + public static final String PROPERTY_CELL = "cell"; + + protected Echotype echotype; + + protected Cell cell; + + protected List<Result> result = Lists.newArrayList(); + + public Echotype getEchotype() { + return echotype; + } + + public void setEchotype(Echotype echotype) { + this.echotype = echotype; + } + + public Cell getCell() { + return cell; + } + + public void setCell(Cell cell) { + this.cell = cell; + } + + public List<Result> getResult() { + return result; + } + + @Override + public void addResult(Result result) { + this.result.add(result); + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultByEchotypeImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndAgeCategoryImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,79 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.CellDAO; +import fr.ifremer.echobase.entities.data.Result; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.DataMetadata; +import fr.ifremer.echobase.entities.references.Species; + +import java.util.List; +import java.util.Map; + +/** + * Model to import {@link Result} for esdu cell and species and size category. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class EsduResultBySpeciesAndAgeCategoryImportModel extends AbstractImportModel<EsduResultBySpeciesAndAgeCategoryImportRow> { + + public static final String[] COLUMN_NAMES_TO_EXCLUDE = { + "name", + "baracoudaCode", + EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_AGE_CATEGORY, + EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_AGE_CATEGORY_MEANING, + }; + + public EsduResultBySpeciesAndAgeCategoryImportModel( + char separator, + Map<String, Species> speciesMap, + Voyage voyage, + CellDAO cellDAO, + List<DataMetadata> dataMetadatas) { + super(separator); + + newMandatoryColumn("name", EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, cellDAO)); + newMandatoryColumn(EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_AGE_CATEGORY); + newMandatoryColumn(EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_AGE_CATEGORY_MEANING); + newForeignKeyColumn("baracoudaCode", EsduResultBySpeciesAndAgeCategoryImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); + + for (DataMetadata metadata : dataMetadatas) { + String name = metadata.getName(); + newMandatoryColumn( + name, + EchobaseCsvUtil.newResultValueParser(metadata), + EchobaseCsvUtil.<EsduResultBySpeciesAndAgeCategoryImportRow>newResultValueSetter()); + } + } + + @Override + public EsduResultBySpeciesAndAgeCategoryImportRow newEmptyInstance() { + return new EsduResultBySpeciesAndAgeCategoryImportRow(); + } + +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndAgeCategoryImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,101 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import com.google.common.collect.Lists; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Cell; +import fr.ifremer.echobase.entities.data.Result; +import fr.ifremer.echobase.entities.references.Species; + +import java.util.List; + +/** + * Bean used as a row for import of + * {@link EsduResultBySpeciesAndAgeCategoryImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class EsduResultBySpeciesAndAgeCategoryImportRow implements EchobaseCsvUtil.ResultAble { + + public static final String PROPERTY_CELL = "cell"; + + public static final String PROPERTY_SPECIES = "species"; + + public static final String PROPERTY_AGE_CATEGORY = "ageCategory"; + + public static final String PROPERTY_AGE_CATEGORY_MEANING = "ageCategoryMeaning"; + + protected Cell cell; + + protected List<Result> result = Lists.newArrayList(); + + protected Species species; + + private String ageCategory; + + private String ageCategoryMeaning; + + public Species getSpecies() { + return species; + } + + public void setSpecies(Species species) { + this.species = species; + } + + public Cell getCell() { + return cell; + } + + public void setCell(Cell cell) { + this.cell = cell; + } + + public String getAgeCategory() { + return ageCategory; + } + + public void setAgeCategory(String ageCategory) { + this.ageCategory = ageCategory; + } + + public String getAgeCategoryMeaning() { + return ageCategoryMeaning; + } + + public void setAgeCategoryMeaning(String ageCategoryMeaning) { + this.ageCategoryMeaning = ageCategoryMeaning; + } + + public List<Result> getResult() { + return result; + } + + @Override + public void addResult(Result result) { + this.result.add(result); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndAgeCategoryImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndSizeCategoryImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,79 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.CellDAO; +import fr.ifremer.echobase.entities.data.Result; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.DataMetadata; +import fr.ifremer.echobase.entities.references.Species; + +import java.util.List; +import java.util.Map; + +/** + * Model to import {@link Result} for esdu cell and species and size category. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class EsduResultBySpeciesAndSizeCategoryImportModel extends AbstractImportModel<EsduResultBySpeciesAndSizeCategoryImportRow> { + + public static final String[] COLUMN_NAMES_TO_EXCLUDE = { + "name", + "baracoudaCode", + EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SIZE_CATEGORY, + EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SIZE_CATEGORY_MEANING + }; + + public EsduResultBySpeciesAndSizeCategoryImportModel( + char separator, + Map<String, Species> speciesMap, + Voyage voyage, + CellDAO cellDAO, + List<DataMetadata> dataMetadatas) { + super(separator); + + newMandatoryColumn("name", EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_CELL, EchobaseCsvUtil.newCellValueParser(voyage, cellDAO)); + newMandatoryColumn(EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SIZE_CATEGORY); + newMandatoryColumn(EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SIZE_CATEGORY_MEANING); + newForeignKeyColumn("baracoudaCode", EsduResultBySpeciesAndSizeCategoryImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); + + for (DataMetadata metadata : dataMetadatas) { + String name = metadata.getName(); + newMandatoryColumn( + name, + EchobaseCsvUtil.newResultValueParser(metadata), + EchobaseCsvUtil.<EsduResultBySpeciesAndSizeCategoryImportRow>newResultValueSetter()); + } + } + + @Override + public EsduResultBySpeciesAndSizeCategoryImportRow newEmptyInstance() { + return new EsduResultBySpeciesAndSizeCategoryImportRow(); + } + +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticResultBySpeciesAndSizeCategoryImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,101 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import com.google.common.collect.Lists; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Cell; +import fr.ifremer.echobase.entities.data.Result; +import fr.ifremer.echobase.entities.references.Species; + +import java.util.List; + +/** + * Bean used as a row for import of + * {@link EsduResultBySpeciesAndSizeCategoryImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class EsduResultBySpeciesAndSizeCategoryImportRow implements EchobaseCsvUtil.ResultAble { + + public static final String PROPERTY_CELL = "cell"; + + public static final String PROPERTY_SPECIES = "species"; + + public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory"; + + public static final String PROPERTY_SIZE_CATEGORY_MEANING = "sizeCategoryMeaning"; + + protected Cell cell; + + protected List<Result> result = Lists.newArrayList(); + + protected Species species; + + private String sizeCategory; + + private String sizeCategoryMeaning; + + public Species getSpecies() { + return species; + } + + public void setSpecies(Species species) { + this.species = species; + } + + public Cell getCell() { + return cell; + } + + public void setCell(Cell cell) { + this.cell = cell; + } + + public String getSizeCategory() { + return sizeCategory; + } + + public void setSizeCategory(String sizeCategory) { + this.sizeCategory = sizeCategory; + } + + public String getSizeCategoryMeaning() { + return sizeCategoryMeaning; + } + + public void setSizeCategoryMeaning(String sizeCategoryMeaning) { + this.sizeCategoryMeaning = sizeCategoryMeaning; + } + + public List<Result> getResult() { + return result; + } + + @Override + public void addResult(Result result) { + this.result.add(result); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/EsduResultBySpeciesAndSizeCategoryImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/GearMetadataValueImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/GearMetadataValueImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/GearMetadataValueImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/GearMetadataValueImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,71 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.entities.data.GearMetadataValue; +import fr.ifremer.echobase.entities.data.Operation; +import fr.ifremer.echobase.entities.references.Gear; +import fr.ifremer.echobase.entities.references.GearMetadata; +import fr.ifremer.echobase.entities.references.Vessel; + +import java.util.Map; + +/** + * Model to import {@link GearMetadataValue}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class GearMetadataValueImportModel extends AbstractImportModel<GearMetadataValueImportRow> { + + public GearMetadataValueImportModel(char separator, + Map<String, Vessel> vesselMap, + Map<String, GearMetadata> gearMetadataMap, + Map<String, Gear> gearMap, + Map<String, Operation> operationMap) { + super(separator); + + /* + vesselName + id + gearID + metadataType + gearMetadataValue + */ + + newForeignKeyColumn("vesselName", GearMetadataValueImportRow.PROPERTY_VESSEL, Vessel.class, Vessel.PROPERTY_NAME, vesselMap); + newForeignKeyColumn("operationID", GearMetadataValueImportRow.PROPERTY_OPERATION, Operation.class, Operation.PROPERTY_ID, operationMap); + + newForeignKeyColumn("metadataType", GearMetadataValue.PROPERTY_GEAR_METADATA, GearMetadata.class, GearMetadata.PROPERTY_NAME, gearMetadataMap); + newForeignKeyColumn("gearCode", GearMetadataValue.PROPERTY_GEAR, Gear.class, Gear.PROPERTY_CASINO_GEAR_NAME, gearMap); + newMandatoryColumn("gearMetadataValue", GearMetadataValue.PROPERTY_DATA_VALUE); + + } + + @Override + public GearMetadataValueImportRow newEmptyInstance() { + return new GearMetadataValueImportRow(); + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/GearMetadataValueImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/GearMetadataValueImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/GearMetadataValueImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/GearMetadataValueImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/GearMetadataValueImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,87 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.GearMetadataValue; +import fr.ifremer.echobase.entities.data.GearMetadataValueImpl; +import fr.ifremer.echobase.entities.data.Operation; +import fr.ifremer.echobase.entities.data.Transect; +import fr.ifremer.echobase.entities.references.Gear; +import fr.ifremer.echobase.entities.references.GearMetadata; +import fr.ifremer.echobase.entities.references.Vessel; + +/** + * Bean used as a row for import of {@link GearMetadataValueImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class GearMetadataValueImportRow { + + public static final String PROPERTY_VESSEL = Transect.PROPERTY_VESSEL; + + public static final String PROPERTY_OPERATION = Transect.PROPERTY_OPERATION; + + protected Vessel vessel; + + protected Operation operation; + + protected final GearMetadataValue gearMetadataValue; + + public GearMetadataValueImportRow() { + gearMetadataValue = new GearMetadataValueImpl(); + } + + public GearMetadataValue getGearMetadataValue() { + return gearMetadataValue; + } + + public void setGearMetadata(GearMetadata gearMetadata) { + gearMetadataValue.setGearMetadata(gearMetadata); + } + + public void setDataValue(String dataValue) { + gearMetadataValue.setDataValue(dataValue); + } + + public void setGear(Gear gear) { + gearMetadataValue.setGear(gear); + } + + public Operation getOperation() { + return operation; + } + + public void setOperation(Operation operation) { + this.operation = operation; + } + + public Vessel getVessel() { + return vessel; + } + + public void setVessel(Vessel vessel) { + this.vessel = vessel; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/GearMetadataValueImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthAgeKeyImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthAgeKeyImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthAgeKeyImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,72 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.LengthAgeKey; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.Species; +import fr.ifremer.echobase.entities.references.Strata; + +import java.util.Map; + +/** + * Model to import {@link LengthAgeKey}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class LengthAgeKeyImportModel extends AbstractImportModel<LengthAgeKeyImportRow> { + + protected final Map<String, Voyage> voyageMap; + + protected final Map<String, Strata> strataMap; + + protected final Map<String, Species> speciesMap; + + public LengthAgeKeyImportModel(char separator, + Map<String, Voyage> voyageMap, + Map<String, Strata> strataMap, + Map<String, Species> speciesMap) { + super(separator); + this.voyageMap = voyageMap; + this.strataMap = strataMap; + this.speciesMap = speciesMap; + + newForeignKeyColumn(LengthAgeKeyImportRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, voyageMap); + + newMandatoryColumn(LengthAgeKey.PROPERTY_AGE, EchobaseCsvUtil.PRIMITIVE_INTEGER); + newMandatoryColumn(LengthAgeKey.PROPERTY_PERCENT_AT_AGE, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(LengthAgeKey.PROPERTY_LENGTH, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(LengthAgeKey.PROPERTY_METADATA); + newForeignKeyColumn(LengthAgeKey.PROPERTY_STRATA, Strata.class, Strata.PROPERTY_NAME, strataMap); + newForeignKeyColumn("baracoudacode", LengthAgeKey.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); + } + + @Override + public LengthAgeKeyImportRow newEmptyInstance() { + return new LengthAgeKeyImportRow(); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthAgeKeyImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthAgeKeyImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthAgeKeyImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthAgeKeyImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,89 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.LengthAgeKey; +import fr.ifremer.echobase.entities.data.LengthAgeKeyImpl; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.Species; +import fr.ifremer.echobase.entities.references.Strata; + +import java.io.Serializable; + +/** + * Bean used as a row for import of {@link LengthAgeKeyImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class LengthAgeKeyImportRow implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final String PROPERTY_VOYAGE = "voyage"; + + protected Voyage voyage; + + protected final LengthAgeKey lengthAgeKey; + + public LengthAgeKeyImportRow() { + lengthAgeKey = new LengthAgeKeyImpl(); + } + + public LengthAgeKey getLengthAgeKey() { + return lengthAgeKey; + } + + public Voyage getVoyage() { + return voyage; + } + + public void setVoyage(Voyage voyage) { + this.voyage = voyage; + } + + public void setAge(int age) { + lengthAgeKey.setAge(age); + } + + public void setLength(float length) { + lengthAgeKey.setLength(length); + } + + public void setPercentAtAge(float percentAtAge) { + lengthAgeKey.setPercentAtAge(percentAtAge); + } + + public void setMetadata(String metadata) { + lengthAgeKey.setMetadata(metadata); + } + + public void setStrata(Strata strata) { + lengthAgeKey.setStrata(strata); + } + + public void setSpecies(Species species) { + lengthAgeKey.setSpecies(species); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthAgeKeyImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthWeightKeyImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthWeightKeyImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthWeightKeyImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,78 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.LengthWeightKey; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.SizeCategory; +import fr.ifremer.echobase.entities.references.Species; + +import java.util.Map; + +/** + * Model to import {@link LengthWeightKey}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class LengthWeightKeyImportModel extends AbstractImportModel<LengthWeightKeyImportRow> { + + protected final Map<String, Voyage> voyageMap; + + protected final Map<String, SizeCategory> sizeCategoryMap; + + protected final Map<String, Species> speciesMap; + + public LengthWeightKeyImportModel(char separator, + Map<String, Voyage> voyageMap, + Map<String, SizeCategory> sizeCategoryMap, + Map<String, Species> speciesMap) { + super(separator); + this.voyageMap = voyageMap; + this.sizeCategoryMap = sizeCategoryMap; + this.speciesMap = speciesMap; + + /* + voyage + sizeCategory + aParameter + bParameter + codeMemo + */ + + newMandatoryColumn("aParameter", LengthWeightKey.PROPERTY_APARAMETER, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn("bParameter", LengthWeightKey.PROPERTY_BPARAMETER, EchobaseCsvUtil.PRIMITIVE_FLOAT); + + newForeignKeyColumn(LengthWeightKeyImportRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, voyageMap); + newForeignKeyColumn(LengthWeightKeyImportRow.PROPERTY_SIZE_CATEGORY, SizeCategory.class, SizeCategory.PROPERTY_NAME, sizeCategoryMap); + newForeignKeyColumn("baracoudacode", LengthWeightKeyImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); + } + + @Override + public LengthWeightKeyImportRow newEmptyInstance() { + return new LengthWeightKeyImportRow(); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthWeightKeyImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthWeightKeyImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthWeightKeyImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthWeightKeyImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,97 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.LengthWeightKey; +import fr.ifremer.echobase.entities.data.LengthWeightKeyImpl; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.SizeCategory; +import fr.ifremer.echobase.entities.references.Species; + +import java.io.Serializable; + +/** + * Bean used as a row for import of {@link LengthWeightKeyImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class LengthWeightKeyImportRow implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final String PROPERTY_VOYAGE = "voyage"; + + public static final String PROPERTY_SPECIES = "species"; + + public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory"; + + protected Species species; + + protected SizeCategory sizeCategory; + + protected Voyage voyage; + + protected final LengthWeightKey lengthWeightKey; + + public LengthWeightKeyImportRow() { + lengthWeightKey = new LengthWeightKeyImpl(); + } + + public LengthWeightKey getLengthWeightKey() { + return lengthWeightKey; + } + + public Species getSpecies() { + return species; + } + + public void setSpecies(Species species) { + this.species = species; + } + + public SizeCategory getSizeCategory() { + return sizeCategory; + } + + public void setSizeCategory(SizeCategory sizeCategory) { + this.sizeCategory = sizeCategory; + } + + public Voyage getVoyage() { + return voyage; + } + + public void setVoyage(Voyage voyage) { + this.voyage = voyage; + } + + public void setBParameter(float BParameter) { + lengthWeightKey.setBParameter(BParameter); + } + + public void setAParameter(float AParameter) { + lengthWeightKey.setAParameter(AParameter); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/LengthWeightKeyImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,68 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.CellType; +import fr.ifremer.echobase.entities.references.DepthStratum; + +import java.util.Map; + +/** + * Model to import cells of type 'Map'. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class MapCellImportModel extends AbstractImportModel<MapCellImportRow> { + + protected final CellType cellType; + + public MapCellImportModel(char separator, + CellType cellType, + Map<String, Voyage> voyageMap, + Map<String, DepthStratum> depthStramMap) { + super(separator); + this.cellType = cellType; + + newForeignKeyColumn(MapCellImportRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, voyageMap); + newForeignKeyColumn(MapCellImportRow.PROPERTY_DEPTH_STRATUM, DepthStratum.class, DepthStratum.PROPERTY_ID, depthStramMap); + + newMandatoryColumn(MapCellImportRow.PROPERTY_NAME); + newMandatoryColumn("x", MapCellImportRow.PROPERTY_DATA_X, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn("y", MapCellImportRow.PROPERTY_DATA_Y, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn("z", MapCellImportRow.PROPERTY_DATA_Z, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn("lag", MapCellImportRow.PROPERTY_DATA_LAG, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn("value", MapCellImportRow.PROPERTY_DATA_VALUE, EchobaseCsvUtil.PRIMITIVE_FLOAT); + } + + @Override + public MapCellImportRow newEmptyInstance() { + MapCellImportRow row = new MapCellImportRow(); + row.getCell().setCellType(cellType); + return row; + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,138 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.Cell; +import fr.ifremer.echobase.entities.data.CellImpl; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.DepthStratum; + +/** + * Bean used as a row for import of {@link MapCellImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class MapCellImportRow { + + public static final String PROPERTY_NAME = "name"; + + public static final String PROPERTY_VOYAGE = "voyage"; + + public static final String PROPERTY_DEPTH_STRATUM = "depthStratum"; + + public static final String PROPERTY_DATA_X = "dataX"; + + public static final String PROPERTY_DATA_Y = "dataY"; + + public static final String PROPERTY_DATA_Z = "dataZ"; + + public static final String PROPERTY_DATA_LAG = "dataLag"; + + public static final String PROPERTY_DATA_VALUE = "dataValue"; + + protected Voyage voyage; + + protected DepthStratum depthStratum; + + protected final Cell cell; + + protected float dataX; + + protected float dataY; + + protected float dataZ; + + protected float dataLag; + + protected float dataValue; + + public MapCellImportRow() { + this.cell = new CellImpl(); + } + + public Cell getCell() { + return cell; + } + + public Voyage getVoyage() { + return voyage; + } + + public DepthStratum getDepthStratum() { + return depthStratum; + } + + public float getDataX() { + return dataX; + } + + public float getDataY() { + return dataY; + } + + public float getDataZ() { + return dataZ; + } + + public float getDataLag() { + return dataLag; + } + + public float getDataValue() { + return dataValue; + } + + public void setName(String name) { + getCell().setName(name); + } + + public void setVoyage(Voyage voyage) { + this.voyage = voyage; + } + + public void setDepthStratum(DepthStratum depthStratum) { + this.depthStratum = depthStratum; + } + + public void setDataX(float dataX) { + this.dataX = dataX; + } + + public void setDataY(float dataY) { + this.dataY = dataY; + } + + public void setDataZ(float dataZ) { + this.dataZ = dataZ; + } + + public void setDataLag(float dataLag) { + this.dataLag = dataLag; + } + + public void setDataValue(float dataValue) { + this.dataValue = dataValue; + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,44 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; + +/** + * Model to import results of cell of type 'Map'. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class MapCellResultImportModel extends AbstractImportModel<MapCellResultImportRow> { + + public MapCellResultImportModel(char separator) { + super(separator); + } + + @Override + public MapCellResultImportRow newEmptyInstance() { + return new MapCellResultImportRow(); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,33 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +/** + * Bean used as a row for import of {@link MapCellResultImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class MapCellResultImportRow { +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/MapCellResultImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,82 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Operation; +import fr.ifremer.echobase.entities.references.DepthStratum; +import fr.ifremer.echobase.entities.references.Gear; +import fr.ifremer.echobase.entities.references.Vessel; + +import java.util.Map; + +/** + * Model to import {@link Operation}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class OperationImportModel extends AbstractImportModel<OperationImportRow> { + + public OperationImportModel(char separator, + Map<String, Vessel> vesselMap, + Map<String, Gear> gearMap, + Map<String, DepthStratum> depthStratumMap) { + super(separator); + + /* + vesselName // + id // + depthStratumID // + gearShootingStartTime // + midHaulLatitude // + midHaulLongitude // + gearShootingStartLatitude // + gearShootingStartLongitude // + gearShootingEndTime // + gearShootingEndLatitude // + gearShootingEndLongitude // + gearName // + */ + newForeignKeyColumn("vesselName", OperationImportRow.PROPERTY_VESSEL, Vessel.class, Vessel.PROPERTY_NAME, vesselMap); + + newForeignKeyColumn("gearCode", Operation.PROPERTY_GEAR, Gear.class, Gear.PROPERTY_CASINO_GEAR_NAME, gearMap); + newForeignKeyColumn("depthStratumID", Operation.PROPERTY_DEPTH_STRATUM, DepthStratum.class, DepthStratum.PROPERTY_ID, depthStratumMap); + newMandatoryColumn("operationID", Operation.PROPERTY_ID); + newMandatoryColumn(Operation.PROPERTY_MID_HAUL_LATITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(Operation.PROPERTY_MID_HAUL_LONGITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(Operation.PROPERTY_GEAR_SHOOTING_START_TIME, EchobaseCsvUtil.DAY_TIME_SECOND); + newMandatoryColumn(Operation.PROPERTY_GEAR_SHOOTING_END_TIME, EchobaseCsvUtil.DAY_TIME_SECOND); + newMandatoryColumn(Operation.PROPERTY_GEAR_SHOOTING_START_LATITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(Operation.PROPERTY_GEAR_SHOOTING_END_LATITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(Operation.PROPERTY_GEAR_SHOOTING_START_LONGITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(Operation.PROPERTY_GEAR_SHOOTING_END_LONGITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT); + } + + @Override + public OperationImportRow newEmptyInstance() { + return new OperationImportRow(); + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,108 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.Operation; +import fr.ifremer.echobase.entities.data.OperationImpl; +import fr.ifremer.echobase.entities.data.Transect; +import fr.ifremer.echobase.entities.references.DepthStratum; +import fr.ifremer.echobase.entities.references.Gear; +import fr.ifremer.echobase.entities.references.Vessel; + +import java.util.Date; + +/** + * Bean used as a row for import of {@link OperationImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class OperationImportRow { + + public static final String PROPERTY_VESSEL = Transect.PROPERTY_VESSEL; + + protected Vessel vessel; + + protected final Operation operation; + + public OperationImportRow() { + operation = new OperationImpl(); + } + + public Operation getOperation() { + return operation; + } + + public Vessel getVessel() { + return vessel; + } + + public void setVessel(Vessel vessel) { + this.vessel = vessel; + } + + public void setId(String id) { + operation.setId(id); + } + + public void setGearShootingStartTime(Date gearShootingStartTime) { + operation.setGearShootingStartTime(gearShootingStartTime); + } + + public void setGearShootingEndTime(Date gearShootingEndTime) { + operation.setGearShootingEndTime(gearShootingEndTime); + } + + public void setGearShootingStartLatitude(Float gearShootingStartLatitude) { + operation.setGearShootingStartLatitude(gearShootingStartLatitude); + } + + public void setGearShootingEndLatitude(Float gearShootingEndLatitude) { + operation.setGearShootingEndLatitude(gearShootingEndLatitude); + } + + public void setGearShootingStartLongitude(Float gearShootingStartLongitude) { + operation.setGearShootingStartLongitude(gearShootingStartLongitude); + } + + public void setGearShootingEndLongitude(Float gearShootingEndLongitude) { + operation.setGearShootingEndLongitude(gearShootingEndLongitude); + } + + public void setMidHaulLatitude(float midHauleLatitude) { + operation.setMidHaulLatitude(midHauleLatitude); + } + + public void setMidHaulLongitude(float midHauleLongitude) { + operation.setMidHaulLongitude(midHauleLongitude); + } + + public void setDepthStratum(DepthStratum depthStratum) { + operation.setDepthStratum(depthStratum); + } + + public void setGear(Gear gear) { + operation.setGear(gear); + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationMetadataValueImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationMetadataValueImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationMetadataValueImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationMetadataValueImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,66 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.entities.data.Operation; +import fr.ifremer.echobase.entities.data.OperationMetadataValue; +import fr.ifremer.echobase.entities.references.OperationMetadata; +import fr.ifremer.echobase.entities.references.Vessel; + +import java.util.Map; + +/** + * Model to import {@link OperationMetadataValue}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class OperationMetadataValueImportModel extends AbstractImportModel<OperationMetadataValueImportRow> { + + public OperationMetadataValueImportModel(char separator, + Map<String, Vessel> vesselMap, + Map<String, OperationMetadata> operationMetadataMap, + Map<String, Operation> operationMap) { + super(separator); + + /* + vesselName/ + id/ + metadataType/ + operationMetadataValue/ + */ + + newForeignKeyColumn("vesselName", OperationMetadataValueImportRow.PROPERTY_VESSEL, Vessel.class, Vessel.PROPERTY_NAME, vesselMap); + newForeignKeyColumn("operationID", OperationMetadataValueImportRow.PROPERTY_OPERATION, Operation.class, Operation.PROPERTY_ID, operationMap); + + newForeignKeyColumn("metadataType", OperationMetadataValue.PROPERTY_OPERATION_METADATA, OperationMetadata.class, OperationMetadata.PROPERTY_NAME, operationMetadataMap); + newMandatoryColumn("operationMetadataValue", OperationMetadataValue.PROPERTY_DATA_VALUE); + } + + @Override + public OperationMetadataValueImportRow newEmptyInstance() { + return new OperationMetadataValueImportRow(); + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationMetadataValueImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationMetadataValueImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/OperationMetadataValueImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationMetadataValueImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationMetadataValueImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,82 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.Operation; +import fr.ifremer.echobase.entities.data.OperationMetadataValue; +import fr.ifremer.echobase.entities.data.OperationMetadataValueImpl; +import fr.ifremer.echobase.entities.data.Transect; +import fr.ifremer.echobase.entities.references.OperationMetadata; +import fr.ifremer.echobase.entities.references.Vessel; + +/** + * Bean used as a row for import of {@link OperationMetadataValueImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class OperationMetadataValueImportRow { + + public static final String PROPERTY_VESSEL = Transect.PROPERTY_VESSEL; + + public static final String PROPERTY_OPERATION = Transect.PROPERTY_OPERATION; + + protected Operation operation; + + protected Vessel vessel; + + protected final OperationMetadataValue operationMetadataValue; + + public OperationMetadataValueImportRow() { + operationMetadataValue = new OperationMetadataValueImpl(); + } + + public OperationMetadataValue getOperationMetadataValue() { + return operationMetadataValue; + } + + public void setOperationMetadata(OperationMetadata operationMetadata) { + operationMetadataValue.setOperationMetadata(operationMetadata); + } + + public void setDataValue(String dataValue) { + operationMetadataValue.setDataValue(dataValue); + } + + public Operation getOperation() { + return operation; + } + + public void setOperation(Operation operation) { + this.operation = operation; + } + + public Vessel getVessel() { + return vessel; + } + + public void setVessel(Vessel vessel) { + this.vessel = vessel; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/OperationMetadataValueImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellAssociationImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellAssociationImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellAssociationImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellAssociationImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,44 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; + +/** + * Model to import cells associations from region cells and esdu cells. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class RegionCellAssociationImportModel extends AbstractImportModel<RegionCellAssociationImportRow> { + + public RegionCellAssociationImportModel(char separator) { + super(separator); + } + + @Override + public RegionCellAssociationImportRow newEmptyInstance() { + return new RegionCellAssociationImportRow(); + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellAssociationImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellAssociationImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellAssociationImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellAssociationImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellAssociationImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,69 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.Cell; + +/** + * Bean used as a row for import of {@link RegionCellAssociationImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class RegionCellAssociationImportRow { + + protected Cell esduCell; + + protected Cell regionSurfaceCell; + + protected Cell regionBottomCell; + + public RegionCellAssociationImportRow() { + } + + + public Cell getEsduCell() { + return esduCell; + } + + public void setEsduCell(Cell esduCell) { + this.esduCell = esduCell; + } + + public Cell getRegionSurfaceCell() { + return regionSurfaceCell; + } + + public void setRegionSurfaceCell(Cell regionSurfaceCell) { + this.regionSurfaceCell = regionSurfaceCell; + } + + public Cell getRegionBottomCell() { + return regionBottomCell; + } + + public void setRegionBottomCell(Cell regionBottomCell) { + this.regionBottomCell = regionBottomCell; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellAssociationImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportModel.java (from rev 417, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,67 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.CellType; +import fr.ifremer.echobase.entities.references.DepthStratum; + +import java.util.Map; + +/** + * Model to import cells (with type "region"). + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class RegionCellImportModel extends AbstractImportModel<RegionCellImportRow> { + + protected final CellType cellType; + + public RegionCellImportModel(char separator, + CellType cellType, + Map<String, Voyage> voyageMap, + Map<String, DepthStratum> depthStramMap) { + super(separator); + this.cellType = cellType; + + newForeignKeyColumn(RegionCellImportRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, voyageMap); + newForeignKeyColumn(RegionCellImportRow.PROPERTY_DEPTH_STRATUM, DepthStratum.class, DepthStratum.PROPERTY_ID, depthStramMap); + + newMandatoryColumn(RegionCellImportRow.PROPERTY_NAME); + newMandatoryColumn("x", RegionCellImportRow.PROPERTY_DATA_X, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn("y", RegionCellImportRow.PROPERTY_DATA_Y, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn("z", RegionCellImportRow.PROPERTY_DATA_Z, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn("surface", RegionCellImportRow.PROPERTY_DATA_SURFACE, EchobaseCsvUtil.PRIMITIVE_FLOAT); + } + + @Override + public RegionCellImportRow newEmptyInstance() { + RegionCellImportRow row = new RegionCellImportRow(); + row.getCell().setCellType(cellType); + return row; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportRow.java (from rev 417, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,126 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.Cell; +import fr.ifremer.echobase.entities.data.CellImpl; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.DepthStratum; + +/** + * Bean used as a row for import of {@link RegionCellImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class RegionCellImportRow { + + public static final String PROPERTY_NAME = "name"; + + public static final String PROPERTY_VOYAGE = "voyage"; + + public static final String PROPERTY_DEPTH_STRATUM = "depthStratum"; + + public static final String PROPERTY_DATA_X = "dataX"; + + public static final String PROPERTY_DATA_Y = "dataY"; + + public static final String PROPERTY_DATA_Z = "dataZ"; + + public static final String PROPERTY_DATA_SURFACE = "dataSurface"; + + protected Voyage voyage; + + protected DepthStratum depthStratum; + + protected final Cell cell; + + protected float dataX; + + protected float dataY; + + protected float dataZ; + + protected float dataSurface; + + public RegionCellImportRow() { + this.cell = new CellImpl(); + } + + public Cell getCell() { + return cell; + } + + public Voyage getVoyage() { + return voyage; + } + + public DepthStratum getDepthStratum() { + return depthStratum; + } + + public float getDataX() { + return dataX; + } + + public float getDataY() { + return dataY; + } + + public float getDataZ() { + return dataZ; + } + + public float getDataSurface() { + return dataSurface; + } + + public void setName(String name) { + getCell().setName(name); + } + + public void setVoyage(Voyage voyage) { + this.voyage = voyage; + } + + public void setDepthStratum(DepthStratum depthStratum) { + this.depthStratum = depthStratum; + } + + public void setDataX(float dataX) { + this.dataX = dataX; + } + + public void setDataY(float dataY) { + this.dataY = dataY; + } + + public void setDataZ(float dataZ) { + this.dataZ = dataZ; + } + + public void setDataSurface(float dataSurface) { + this.dataSurface = dataSurface; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,44 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; + +/** + * Model to import results of cell of type 'Region'. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class RegionCellResultImportModel extends AbstractImportModel<RegionCellResultImportRow> { + + public RegionCellResultImportModel(char separator) { + super(separator); + } + + @Override + public RegionCellResultImportRow newEmptyInstance() { + return new RegionCellResultImportRow(); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,33 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +/** + * Bean used as a row for import of {@link RegionCellResultImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class RegionCellResultImportRow { +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/RegionCellResultImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/SubSampleImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/SubSampleImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/SubSampleImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/SubSampleImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,88 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Operation; +import fr.ifremer.echobase.entities.data.Sample; +import fr.ifremer.echobase.entities.data.SampleData; +import fr.ifremer.echobase.entities.references.SexCategory; +import fr.ifremer.echobase.entities.references.SizeCategory; +import fr.ifremer.echobase.entities.references.Species; + +import java.util.Map; + +/** + * Model to import {@link SampleData}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class SubSampleImportModel extends AbstractImportModel<SubSampleImportRow> { + + public SubSampleImportModel(char separator, + Map<String, Operation> operationMap, + Map<String, Species> speciesMap, + Map<String, SizeCategory> sizeCategoryMap, + Map<String, SexCategory> sexCategoryMap) { + super(separator); + + /* + operationID + subHaul + baracoudacode + sizeCategory + sexCategory + sampleWeight + numberSampled + + numberAtLength + weightAtLength + units + round + */ + + newIgnoredColumn("subHaul"); + newIgnoredColumn("units"); + newIgnoredColumn("round"); + + newForeignKeyColumn("operationID", SubSampleImportRow.PROPERTY_OPERATION, Operation.class, Operation.PROPERTY_ID, operationMap); + newForeignKeyColumn("baracoudacode", SubSampleImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); + newForeignKeyColumn(SubSampleImportRow.PROPERTY_SIZE_CATEGORY, SizeCategory.class, SizeCategory.PROPERTY_NAME, sizeCategoryMap); + newForeignKeyColumn(SubSampleImportRow.PROPERTY_SEX_CATEGORY, SexCategory.class, SexCategory.PROPERTY_NAME, sexCategoryMap); + + newMandatoryColumn(Sample.PROPERTY_SAMPLE_WEIGHT, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(Sample.PROPERTY_NUMBER_SAMPLED, EchobaseCsvUtil.PRIMITIVE_INTEGER); + + newMandatoryColumn(SubSampleImportRow.PROPERTY_NUMBER_AT_LENGTH, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(SubSampleImportRow.PROPERTY_WEIGHT_AT_LENGTH, EchobaseCsvUtil.NA_TO_FLOAT_PARSER); + newMandatoryColumn(SubSampleImportRow.PROPERTY_LENGTH_CLASS); + } + + @Override + public SubSampleImportRow newEmptyInstance() { + return new SubSampleImportRow(); + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/SubSampleImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/SubSampleImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/SubSampleImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/SubSampleImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/SubSampleImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,145 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.Operation; +import fr.ifremer.echobase.entities.data.Sample; +import fr.ifremer.echobase.entities.data.SampleImpl; +import fr.ifremer.echobase.entities.references.SexCategory; +import fr.ifremer.echobase.entities.references.SizeCategory; +import fr.ifremer.echobase.entities.references.Species; + +/** + * Bean used as a row for import of {@link SubSampleImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class SubSampleImportRow { + + + public static final String PROPERTY_OPERATION = "operation"; + + public static final String PROPERTY_SPECIES = "species"; + + public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory"; + + public static final String PROPERTY_SEX_CATEGORY = "sexCategory"; + + public static final String PROPERTY_SAMPLE = "sample"; + + public static final String PROPERTY_NUMBER_AT_LENGTH = "numberAtLength"; + + public static final String PROPERTY_WEIGHT_AT_LENGTH = "weightAtLength"; + + public static final String PROPERTY_LENGTH_CLASS = "lengthClass"; + + protected Operation operation; + + protected Species species; + + protected SizeCategory sizeCategory; + + protected SexCategory sexCategory; + + protected final Sample sample; + + protected float numberAtLength; + + protected Float weightAtLength; + + protected String lengthClass; + + public SubSampleImportRow() { + sample = new SampleImpl(); + } + + public Sample getSample() { + return sample; + } + + public Operation getOperation() { + return operation; + } + + public void setOperation(Operation operation) { + this.operation = operation; + } + + public Species getSpecies() { + return species; + } + + public void setSpecies(Species species) { + this.species = species; + } + + public SizeCategory getSizeCategory() { + return sizeCategory; + } + + public void setSizeCategory(SizeCategory sizeCategory) { + this.sizeCategory = sizeCategory; + } + + public void setNumberSampled(Integer numberSampled) { + sample.setNumberSampled(numberSampled); + } + + public void setSampleWeight(Float sampleWeight) { + sample.setSampleWeight(sampleWeight); + } + + public SexCategory getSexCategory() { + return sexCategory; + } + + public void setSexCategory(SexCategory sexCategory) { + this.sexCategory = sexCategory; + } + + public float getNumberAtLength() { + return numberAtLength; + } + + public void setNumberAtLength(float numberAtLength) { + this.numberAtLength = numberAtLength; + } + + public Float getWeightAtLength() { + return weightAtLength; + } + + public void setWeightAtLength(Float weightAtLength) { + this.weightAtLength = weightAtLength; + } + + public String getLengthClass() { + return lengthClass; + } + + public void setLengthClass(String lengthClass) { + this.lengthClass = lengthClass; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/SubSampleImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TotalSampleImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TotalSampleImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TotalSampleImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TotalSampleImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,78 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Operation; +import fr.ifremer.echobase.entities.data.Sample; +import fr.ifremer.echobase.entities.references.SizeCategory; +import fr.ifremer.echobase.entities.references.Species; + +import java.util.Map; + +/** + * Model to import {@link Sample} of total type. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class TotalSampleImportModel extends AbstractImportModel<TotalSampleImportRow> { + + public TotalSampleImportModel(char separator, + Map<String, Operation> operationMap, + Map<String, Species> speciesMap, + Map<String, SizeCategory> sizeCategoryMap) { + super(separator); + + /* + operationID + baracoudacode + sizeCategory + sampleWeight + numberSampled + meanLength + meanWeight + noPerKg + sortedWeight + */ + + newForeignKeyColumn("operationID", TotalSampleImportRow.PROPERTY_OPERATION, Operation.class, Operation.PROPERTY_ID, operationMap); + newForeignKeyColumn("baracoudacode", TotalSampleImportRow.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, speciesMap); + newForeignKeyColumn(TotalSampleImportRow.PROPERTY_SIZE_CATEGORY, SizeCategory.class, SizeCategory.PROPERTY_NAME, sizeCategoryMap); + + newMandatoryColumn(Sample.PROPERTY_SAMPLE_WEIGHT, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(Sample.PROPERTY_NUMBER_SAMPLED, EchobaseCsvUtil.NA_TO_INTEGER_PARSER); + + newMandatoryColumn(TotalSampleImportRow.PROPERTY_MEAN_LENGTH, EchobaseCsvUtil.NA_TO_FLOAT_PARSER); + newMandatoryColumn(TotalSampleImportRow.PROPERTY_MEAN_WEIGHT, EchobaseCsvUtil.NA_TO_FLOAT_PARSER); + newMandatoryColumn(TotalSampleImportRow.PROPERTY_NO_PER_KG, EchobaseCsvUtil.NA_TO_FLOAT_PARSER); + newMandatoryColumn(TotalSampleImportRow.PROPERTY_SORTED_WEIGHT, EchobaseCsvUtil.PRIMITIVE_FLOAT); + } + + @Override + public TotalSampleImportRow newEmptyInstance() { + return new TotalSampleImportRow(); + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TotalSampleImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TotalSampleImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TotalSampleImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TotalSampleImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TotalSampleImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,143 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.Operation; +import fr.ifremer.echobase.entities.data.Sample; +import fr.ifremer.echobase.entities.data.SampleImpl; +import fr.ifremer.echobase.entities.references.SizeCategory; +import fr.ifremer.echobase.entities.references.Species; + +/** + * Bean used as a row for import of {@link TotalSampleImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class TotalSampleImportRow { + + public static final String PROPERTY_OPERATION = "operation"; + + public static final String PROPERTY_SPECIES = "species"; + + public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory"; + + public static final String PROPERTY_SAMPLE = "sample"; + + public static final String PROPERTY_MEAN_LENGTH = "meanLength"; + + public static final String PROPERTY_MEAN_WEIGHT = "meanWeight"; + + public static final String PROPERTY_NO_PER_KG = "noPerKg"; + + public static final String PROPERTY_SORTED_WEIGHT = "sortedWeight"; + + protected Float meanLength; + + protected Float meanWeight; + + protected Float noPerKg; + + protected float sortedWeight; + + protected Operation operation; + + protected Species species; + + protected SizeCategory sizeCategory; + + protected final Sample sample; + + public TotalSampleImportRow() { + sample = new SampleImpl(); + } + + public Sample getSample() { + return sample; + } + + public Operation getOperation() { + return operation; + } + + public void setOperation(Operation operation) { + this.operation = operation; + } + + public Species getSpecies() { + return species; + } + + public void setSpecies(Species species) { + this.species = species; + } + + public SizeCategory getSizeCategory() { + return sizeCategory; + } + + public void setSizeCategory(SizeCategory sizeCategory) { + this.sizeCategory = sizeCategory; + } + + public void setNumberSampled(Integer numberSampled) { + sample.setNumberSampled(numberSampled); + } + + public void setSampleWeight(Float sampleWeight) { + sample.setSampleWeight(sampleWeight); + } + + public Float getMeanLength() { + return meanLength; + } + + public void setMeanLength(Float meanLength) { + this.meanLength = meanLength; + } + + public Float getMeanWeight() { + return meanWeight; + } + + public void setMeanWeight(Float meanWeight) { + this.meanWeight = meanWeight; + } + + public Float getNoPerKg() { + return noPerKg; + } + + public void setNoPerKg(Float noPerKg) { + this.noPerKg = noPerKg; + } + + public float getSortedWeight() { + return sortedWeight; + } + + public void setSortedWeight(float sortedWeight) { + this.sortedWeight = sortedWeight; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TotalSampleImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransectImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransectImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransectImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransectImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,77 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Transect; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.Vessel; + +import java.util.Map; + +/** + * Model to import transects. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class TransectImportModel extends AbstractImportModel<TransectImportRow> { + + public TransectImportModel(char separator, + Map<String, Voyage> voyageMap, + Map<String, Vessel> vesselMap) { + super(separator); + newForeignKeyColumn( + "voyageName", TransectImportRow.PROPERTY_VOYAGE, + Voyage.class, Voyage.PROPERTY_NAME, voyageMap); + + newForeignKeyColumn( + "vesselName", Transect.PROPERTY_VESSEL, + Vessel.class, Vessel.PROPERTY_NAME, vesselMap); + + newMandatoryColumn(Transect.PROPERTY_TITLE); + newMandatoryColumn(Transect.PROPERTY_TRANSECT_ABSTRACT); + newMandatoryColumn(Transect.PROPERTY_STRATUM); + newMandatoryColumn(Transect.PROPERTY_COMMENT); + + newMandatoryColumn(Transect.PROPERTY_DATE_CREATED, EchobaseCsvUtil.IMPORT_DAY_TIME2); + newMandatoryColumn(Transect.PROPERTY_TIME_COVERAGE_START, EchobaseCsvUtil.IMPORT_DAY_TIME2); + newMandatoryColumn(Transect.PROPERTY_TIME_COVERAGE_END, EchobaseCsvUtil.IMPORT_DAY_TIME2); + + newMandatoryColumn(Transect.PROPERTY_GEOSPATIAL_LON_MIN, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(Transect.PROPERTY_GEOSPATIAL_LAT_MIN, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(Transect.PROPERTY_GEOSPATIAL_VERTICAL_MIN, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(Transect.PROPERTY_GEOSPATIAL_LON_MAX, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(Transect.PROPERTY_GEOSPATIAL_LAT_MAX, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(Transect.PROPERTY_GEOSPATIAL_VERTICAL_MAX, EchobaseCsvUtil.PRIMITIVE_FLOAT); + newMandatoryColumn(Transect.PROPERTY_LINESTRING); + } + + @Override + public TransectImportRow newEmptyInstance() { + return new TransectImportRow(); + } + +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransectImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransectImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransectImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransectImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransectImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,125 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.Transect; +import fr.ifremer.echobase.entities.data.TransectImpl; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.Vessel; + +import java.io.Serializable; +import java.util.Date; + +/** + * Bean used as a row for import of {@link TransectImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class TransectImportRow implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final String PROPERTY_VOYAGE = "voyage"; + + protected Voyage voyage; + + protected Transect transect; + + public TransectImportRow() { + transect = new TransectImpl(); + } + + public Transect getTransect() { + return transect; + } + + public Voyage getVoyage() { + return voyage; + } + + public void setVoyage(Voyage voyage) { + this.voyage = voyage; + } + + public void setTitle(String title) { + transect.setTitle(title); + } + + public void setTransectAbstract(String transectAbstract) { + transect.setTransectAbstract(transectAbstract); + } + + public void setComment(String comment) { + transect.setComment(comment); + } + + public void setDateCreated(Date dateCreated) { + transect.setDateCreated(dateCreated); + } + + public void setGeospatialLonMin(float geospatialLonMin) { + transect.setGeospatialLonMin(geospatialLonMin); + } + + public void setGeospatialLonMax(float geospatialLonMax) { + transect.setGeospatialLonMax(geospatialLonMax); + } + + public void setGeospatialLatMin(float geospatialLatMin) { + transect.setGeospatialLatMin(geospatialLatMin); + } + + public void setGeospatialLatMax(float geospatialLatMax) { + transect.setGeospatialLatMax(geospatialLatMax); + } + + public void setLinestring(String linestring) { + transect.setLinestring(linestring); + } + + public void setGeospatialVerticalMin(float geospatialVerticalMin) { + transect.setGeospatialVerticalMin(geospatialVerticalMin); + } + + public void setGeospatialVerticalMax(float geospatialVerticalMax) { + transect.setGeospatialVerticalMax(geospatialVerticalMax); + } + + public void setTimeCoverageStart(Date timeCoverageStart) { + transect.setTimeCoverageStart(timeCoverageStart); + } + + public void setTimeCoverageEnd(Date timeCoverageEnd) { + transect.setTimeCoverageEnd(timeCoverageEnd); + } + + public void setStratum(String stratum) { + transect.setStratum(stratum); + } + + public void setVessel(Vessel vessel) { + transect.setVessel(vessel); + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransectImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransitImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransitImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransitImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransitImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,58 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Transit; +import fr.ifremer.echobase.entities.data.Voyage; + +import java.util.Map; + +/** + * Model to import Transits. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class TransitImportModel extends AbstractImportModel<TransitImportRow> { + + public static final String TRANSIT_VoyageId = "voyageName"; + + public TransitImportModel(char separator, + Map<String, Voyage> voyageMap) { + super(separator); + newForeignKeyColumn("voyageName", TransitImportRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, voyageMap); + newMandatoryColumn(Transit.PROPERTY_DESCRIPTION); + newMandatoryColumn(Transit.PROPERTY_START_TIME, EchobaseCsvUtil.DAY_TIME); + newMandatoryColumn(Transit.PROPERTY_END_TIME, EchobaseCsvUtil.DAY_TIME); + newMandatoryColumn(Transit.PROPERTY_START_LOCALITY); + newMandatoryColumn(Transit.PROPERTY_END_LOCALITY); + } + + @Override + public TransitImportRow newEmptyInstance() { + return new TransitImportRow(); + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransitImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransitImportRow.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/TransitImportModelRow.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransitImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransitImportRow.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,93 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.entities.data.Transit; +import fr.ifremer.echobase.entities.data.TransitImpl; +import fr.ifremer.echobase.entities.data.Voyage; + +import java.util.Date; + +/** + * Bean used as a row for import of {@link TransitImportModel}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class TransitImportRow { + + public static final String PROPERTY_VOYAGE = "voyage"; + + protected Voyage voyage; + + protected final Transit transit; + + protected String description; + + protected String relatedActivity; + + protected Date startTime; + + protected Date endTime; + + protected String startLocality; + + protected String endLocality; + + public TransitImportRow() { + transit = new TransitImpl(); + } + + public Transit getTransit() { + return transit; + } + + public Voyage getVoyage() { + return voyage; + } + + public void setVoyage(Voyage voyage) { + this.voyage = voyage; + } + + public void setDescription(String description) { + transit.setDescription(description); + } + + public void setStartTime(Date startTime) { + transit.setStartTime(startTime); + } + + public void setEndTime(Date endTime) { + transit.setEndTime(endTime); + } + + public void setStartLocality(String startLocality) { + transit.setStartLocality(startLocality); + } + + public void setEndLocality(String endLocality) { + transit.setEndLocality(endLocality); + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/TransitImportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/VoyageImportModel.java (from rev 416, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/VoyageImportModel.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/VoyageImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/VoyageImportModel.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,52 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services.importdata.csv; + +import fr.ifremer.echobase.csv.AbstractImportModel; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.data.VoyageImpl; + +/** + * Model to import Voyages. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class VoyageImportModel extends AbstractImportModel<Voyage> { + + public VoyageImportModel(char separator) { + super(separator); + newMandatoryColumn(Voyage.PROPERTY_NAME); + newMandatoryColumn(Voyage.PROPERTY_START_DATE, EchobaseCsvUtil.DAY); + newMandatoryColumn(Voyage.PROPERTY_END_DATE, EchobaseCsvUtil.DAY); + newMandatoryColumn(Voyage.PROPERTY_START_PORT); + newMandatoryColumn(Voyage.PROPERTY_END_PORT); + } + + @Override + public Voyage newEmptyInstance() { + return new VoyageImpl(); + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/VoyageImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-services/src/main/resources/i18n/echobase-services_en_GB.properties =================================================================== --- trunk/echobase-services/src/main/resources/i18n/echobase-services_en_GB.properties 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/resources/i18n/echobase-services_en_GB.properties 2012-03-27 23:02:51 UTC (rev 420) @@ -1,7 +1,3 @@ -echobase.common.acousticByEchotypeAndSpeciesCategoryFile= -echobase.common.acousticByEchotypeFile= -echobase.common.acousticBySpeciesAndAgeCategoryFile= -echobase.common.acousticBySpeciesAndSizeCategoryFile= echobase.common.biometrySampleFile= echobase.common.cellMapResultFile= echobase.common.cellMapsFile= @@ -14,6 +10,10 @@ echobase.common.commonDataImportMode.all= echobase.common.commonDataImportMode.transect= echobase.common.echotypeFile= +echobase.common.esduByEchotypeAndSpeciesCategoryFile= +echobase.common.esduByEchotypeFile= +echobase.common.esduBySpeciesAndAgeCategoryFile= +echobase.common.esduBySpeciesAndSizeCategoryFile= echobase.common.gearMetadataFile= echobase.common.importDataMode.accousticData= echobase.common.importDataMode.catchesData= @@ -26,10 +26,10 @@ echobase.common.moviesFile= echobase.common.operationFile= echobase.common.operationMetadataFile= -echobase.common.resultsImportMode.acoustic.byEchotype= -echobase.common.resultsImportMode.acoustic.byEchotypeAndSpeciesCategory= -echobase.common.resultsImportMode.acoustic.bySpeciesAndAgeCategory= -echobase.common.resultsImportMode.acoustic.bySpeciesAndSizeCategory= +echobase.common.resultsImportMode.esdu.byEchotype= +echobase.common.resultsImportMode.esdu.byEchotypeAndSpeciesCategory= +echobase.common.resultsImportMode.esdu.bySpeciesAndAgeCategory= +echobase.common.resultsImportMode.esdu.bySpeciesAndSizeCategory= echobase.common.resultsImportMode.map= echobase.common.resultsImportMode.region= echobase.common.resultsImportMode.voyage= Modified: trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties =================================================================== --- trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties 2012-03-27 23:02:51 UTC (rev 420) @@ -1,7 +1,3 @@ -echobase.common.acousticByEchotypeAndSpeciesCategoryFile=Fichier d'import -echobase.common.acousticByEchotypeFile=Fichier d'import -echobase.common.acousticBySpeciesAndAgeCategoryFile=Fichier d'import -echobase.common.acousticBySpeciesAndSizeCategoryFile=Fichier d'import echobase.common.biometrySampleFile=Fichier BiometrySample echobase.common.cellMapResultFile=Fichier de résultats de cellules Carte echobase.common.cellMapsFile=Fichier des cellules Cartes @@ -14,6 +10,10 @@ echobase.common.commonDataImportMode.all=Import Voyage / Transit / Transects echobase.common.commonDataImportMode.transect=Import Transects echobase.common.echotypeFile=Fichier echotype +echobase.common.esduByEchotypeAndSpeciesCategoryFile=Fichier d'import +echobase.common.esduByEchotypeFile=Fichier d'import +echobase.common.esduBySpeciesAndAgeCategoryFile=Fichier d'import +echobase.common.esduBySpeciesAndSizeCategoryFile=Fichier d'import echobase.common.gearMetadataFile=Fichier Méta-données d'engin echobase.common.importDataMode.accousticData=Import des données accoustiques echobase.common.importDataMode.catchesData=Import des données de pêche @@ -26,10 +26,10 @@ echobase.common.moviesFile=Fichier Movies echobase.common.operationFile=Fichier Opérations echobase.common.operationMetadataFile=Fichier Méta-données opération -echobase.common.resultsImportMode.acoustic.byEchotype=Import des résultats acoustiques par echotype -echobase.common.resultsImportMode.acoustic.byEchotypeAndSpeciesCategory=Import des résultats acoustiques par echotype et catégorie d'espèce -echobase.common.resultsImportMode.acoustic.bySpeciesAndAgeCategory=Import des résultats acoustiques par espèce et catégorie d'age -echobase.common.resultsImportMode.acoustic.bySpeciesAndSizeCategory=Import des résultats acoustiques par espèce et catégorie de taille +echobase.common.resultsImportMode.esdu.byEchotype=Import des résultats de cellule esdu par echotype +echobase.common.resultsImportMode.esdu.byEchotypeAndSpeciesCategory=Import des résultats de cellule esdu par echotype et catégorie d'espèce +echobase.common.resultsImportMode.esdu.bySpeciesAndAgeCategory=Import des résultats de cellule esdu par espèce et catégorie d'age +echobase.common.resultsImportMode.esdu.bySpeciesAndSizeCategory=Import des résultats de cellule esdu par espèce et catégorie de taille echobase.common.resultsImportMode.map=Import des cellules de type Carte echobase.common.resultsImportMode.region=Import des cellules de type Région echobase.common.resultsImportMode.voyage=Import des résultats du voyage Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EchoBaseTestServiceSupport.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EchoBaseTestServiceSupport.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EchoBaseTestServiceSupport.java 2012-03-27 23:02:51 UTC (rev 420) @@ -30,7 +30,6 @@ import fr.ifremer.echobase.entities.EchoBaseUser; import fr.ifremer.echobase.entities.EchoBaseUserImpl; import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.services.configurations.ProgressionModel; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceIT.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceIT.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceIT.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,7 +23,6 @@ */ package fr.ifremer.echobase.services; -import fr.ifremer.echobase.services.configurations.EmbeddedApplicationConfiguration; import fr.ifremer.echobase.services.importdata.AbstractImportDataServiceIT; import org.apache.commons.io.FileUtils; import org.junit.Assert; Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/ExportDbServiceTest.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/ExportDbServiceTest.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/ExportDbServiceTest.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,7 +23,6 @@ */ package fr.ifremer.echobase.services; -import fr.ifremer.echobase.services.configurations.ExportDbConfiguration; import fr.ifremer.echobase.services.importdata.AbstractImportDataServiceIT; import org.junit.Test; import org.nuiton.util.FileUtil; Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/ImportDbServiceTest.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/ImportDbServiceTest.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/ImportDbServiceTest.java 2012-03-27 23:02:51 UTC (rev 420) @@ -25,7 +25,6 @@ import fr.ifremer.echobase.entities.EchoBaseUser; import fr.ifremer.echobase.entities.EchoBaseUserImpl; -import fr.ifremer.echobase.services.configurations.ImportDbConfiguration; import org.junit.Assert; import org.junit.Test; import org.nuiton.topia.TopiaException; Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java 2012-03-27 23:02:51 UTC (rev 420) @@ -43,7 +43,6 @@ import fr.ifremer.echobase.entities.data.Voyage; import fr.ifremer.echobase.services.EchoBaseTestServiceSupport; import fr.ifremer.echobase.services.ImportException; -import fr.ifremer.echobase.services.configurations.AbstractImportConfiguration; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Assert; @@ -130,18 +129,6 @@ public static final int NB_ECHOTYPE = 8; - public static final int NB_ESDU_RESULT_BY_ECHOTYPE = 43533; - - public static final int NB_ESDU_RESULT_BY_ECHOTYPE_AND_SPECIES = 396990; - - public static final int NB_ESDU_RESULT_BY_SPECIES_AND_SIZE_CATEGORY = 68108; - - public static final int NB_ESDU_RESULT_BY_SPECIES_AND_AGE_CATEGORY = 10021; - - public static final int NB_REGION_CELLS = 228; - - public static final int NB_REGION_DATAS = NB_REGION_CELLS * 4; - public void assertImportCommonData() throws TopiaException { assertNbEntities(Voyage.class, NB_VOYAGE); assertNbEntities(Transit.class, NB_TRANSIT); Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticDataImportServiceIT.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticDataImportServiceIT.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticDataImportServiceIT.java 2012-03-27 23:02:51 UTC (rev 420) @@ -24,17 +24,11 @@ package fr.ifremer.echobase.services.importdata; import fr.ifremer.echobase.csv.CsvFileImportResult; -import fr.ifremer.echobase.entities.EchoBaseUser; import fr.ifremer.echobase.entities.data.Cell; import fr.ifremer.echobase.entities.data.Data; import fr.ifremer.echobase.entities.data.DataAcquisition; import fr.ifremer.echobase.entities.data.DataProcessing; import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; -import fr.ifremer.echobase.services.ImportException; -import fr.ifremer.echobase.services.configurations.AbstractImportConfiguration; -import fr.ifremer.echobase.services.configurations.AcousticDataImportConfiguration; -import fr.ifremer.echobase.services.configurations.CellPositionReference; -import org.junit.Assert; import org.junit.Test; import java.util.List; @@ -102,5 +96,4 @@ } - } Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesDataImportServiceIT.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesDataImportServiceIT.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesDataImportServiceIT.java 2012-03-27 23:02:51 UTC (rev 420) @@ -27,7 +27,6 @@ import fr.ifremer.echobase.entities.data.Sample; import fr.ifremer.echobase.entities.data.SampleData; import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; -import fr.ifremer.echobase.services.configurations.CatchesDataImportConfiguration; import org.junit.Ignore; import org.junit.Test; Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonData2ImportServiceIT.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonData2ImportServiceIT.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonData2ImportServiceIT.java 2012-03-27 23:02:51 UTC (rev 420) @@ -27,8 +27,6 @@ import fr.ifremer.echobase.entities.data.Transect; import fr.ifremer.echobase.entities.data.Transit; import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; -import fr.ifremer.echobase.services.configurations.CommonDataImportConfiguration; -import fr.ifremer.echobase.services.configurations.CommonDataImportMode; import org.junit.Test; import java.util.Iterator; Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonDataImportServiceIT.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonDataImportServiceIT.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonDataImportServiceIT.java 2012-03-27 23:02:51 UTC (rev 420) @@ -28,8 +28,6 @@ import fr.ifremer.echobase.entities.data.Transit; import fr.ifremer.echobase.entities.data.Voyage; import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; -import fr.ifremer.echobase.services.configurations.CommonDataImportConfiguration; -import fr.ifremer.echobase.services.configurations.CommonDataImportMode; import org.junit.Test; import java.util.Iterator; Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/OperationImportServiceIT.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/OperationImportServiceIT.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/OperationImportServiceIT.java 2012-03-27 23:02:51 UTC (rev 420) @@ -28,7 +28,6 @@ import fr.ifremer.echobase.entities.data.Operation; import fr.ifremer.echobase.entities.data.OperationMetadataValue; import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; -import fr.ifremer.echobase.services.configurations.OperationImportConfiguration; import org.junit.Test; import java.util.Iterator; Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportServiceIT.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportServiceIT.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportServiceIT.java 2012-03-27 23:02:51 UTC (rev 420) @@ -31,6 +31,7 @@ import fr.ifremer.echobase.csv.CsvFileImportResult; import fr.ifremer.echobase.csv.EchoBaseImport; import fr.ifremer.echobase.entities.EchoBaseEntityEnum; +import fr.ifremer.echobase.entities.data.Category; import fr.ifremer.echobase.entities.data.Cell; import fr.ifremer.echobase.entities.data.CellDAO; import fr.ifremer.echobase.entities.data.DataAcquisition; @@ -41,9 +42,9 @@ import fr.ifremer.echobase.entities.data.Voyage; import fr.ifremer.echobase.entities.references.AgeCategory; import fr.ifremer.echobase.entities.references.DataMetadata; +import fr.ifremer.echobase.entities.references.SizeCategory; +import fr.ifremer.echobase.entities.references.SpeciesCategory; import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; -import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration; -import fr.ifremer.echobase.services.configurations.ResultsImportMode; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Test; @@ -73,7 +74,7 @@ } protected String[] getImportPath(String filename) { - return new String[]{"/import-data", "result", filename}; + return new String[]{"/import-data", "result", "esdu", filename}; } @Test @@ -91,19 +92,19 @@ conf.setResultLabel("resultLabel"); conf.setVoyageId(getVoyageId()); - conf.setImportMode(ResultsImportMode.ACOUSTIC_BY_ECHOTYPE); + conf.setImportMode(ResultsImportMode.ESDU_BY_ECHOTYPE); - prepareInputFile(conf.getAcousticByEchotypeFile(), - getImportPath("acousticResultByEchotype.csv.gz")); + InputFile inputFile = conf.getEsduByEchotypeFile(); + prepareInputFile(inputFile, getImportPath("byEchotype.csv.gz")); - addMissingEsduCells(conf.getVoyageId(), - conf.getAcousticByEchotypeAndSpeciesCategoryFile() - ); + addMissingEsduCells(conf.getVoyageId(), inputFile); List<CsvFileImportResult> result = doImport( conf, ResultsEsduCellImportService.class, 1); - assertCsvImportResult(result.get(0), Result.class, NB_ESDU_RESULT_BY_ECHOTYPE); + assertCsvImportResult(result.get(0), Result.class, 43533); + assertCsvImportResult(result.get(0), Category.class, 7); + assertCsvImportResult(result.get(0), SpeciesCategory.class, 1); } @Test @@ -121,14 +122,13 @@ conf.setResultLabel("resultLabel"); conf.setVoyageId(getVoyageId()); - conf.setImportMode(ResultsImportMode.ACOUSTIC_BY_ECHOTYPE_AND_SPECIES_CATEGORY); + conf.setImportMode(ResultsImportMode.ESDU_BY_ECHOTYPE_AND_SPECIES_CATEGORY); - prepareInputFile(conf.getAcousticByEchotypeAndSpeciesCategoryFile(), - getImportPath("acousticResultByEchotypeAndSpeciesCategory.csv.gz")); + InputFile inputFile = conf.getEsduByEchotypeAndSpeciesCategoryFile(); + prepareInputFile(inputFile, + getImportPath("byEchotypeAndSpeciesCategory.csv.gz")); - addMissingEsduCells(conf.getVoyageId(), - conf.getAcousticByEchotypeAndSpeciesCategoryFile() - ); + addMissingEsduCells(conf.getVoyageId(), inputFile); //TODO Remove this when referentiel is ok create(getDAO(EchoBaseEntityEnum.DataMetadata), DataMetadata.PROPERTY_NAME, "SigmaSp"); @@ -137,10 +137,10 @@ create(getDAO(EchoBaseEntityEnum.DataMetadata), DataMetadata.PROPERTY_NAME, "pondAbundance"); - List<CsvFileImportResult> result = doImport( - conf, ResultsEsduCellImportService.class, 1); + List<CsvFileImportResult> result; + result = doImport(conf, ResultsEsduCellImportService.class, 1); - assertCsvImportResult(result.get(0), Result.class, NB_ESDU_RESULT_BY_ECHOTYPE_AND_SPECIES); + assertCsvImportResult(result.get(0), Result.class, 396990); } @Test @@ -158,20 +158,21 @@ conf.setResultLabel("resultLabel"); conf.setVoyageId(getVoyageId()); - conf.setImportMode(ResultsImportMode.ACOUSTIC_BY_SPECIES_AND_SIZE_CATEGORY); + conf.setImportMode(ResultsImportMode.ESDU_BY_SPECIES_AND_SIZE_CATEGORY); - prepareInputFile(conf.getAcousticBySpeciesAndSizeCategoryFile(), - getImportPath("acousticResultBySpeciesAndSizeCategory.csv.gz")); + InputFile intputFile = conf.getEsduBySpeciesAndSizeCategoryFile(); + prepareInputFile(intputFile, + getImportPath("bySpeciesAndSizeCategory.csv.gz")); - addMissingEsduCells(conf.getVoyageId(), - conf.getAcousticBySpeciesAndSizeCategoryFile() - ); + addMissingEsduCells(conf.getVoyageId(), intputFile); - List<CsvFileImportResult> result = doImport( - conf, ResultsEsduCellImportService.class, 1); + List<CsvFileImportResult> result; + result = doImport(conf, ResultsEsduCellImportService.class, 1); - assertCsvImportResult(result.get(0), Result.class, - NB_ESDU_RESULT_BY_SPECIES_AND_SIZE_CATEGORY); + assertCsvImportResult(result.get(0), Result.class, 68108); + assertCsvImportResult(result.get(0), Category.class, 129); + assertCsvImportResult(result.get(0), SpeciesCategory.class, 129); + assertCsvImportResult(result.get(0), SizeCategory.class, 62); } @Test @@ -189,24 +190,25 @@ conf.setResultLabel("resultLabel"); conf.setVoyageId(getVoyageId()); - conf.setImportMode(ResultsImportMode.ACOUSTIC_BY_SPECIES_AND_AGE_CATEGORY); + conf.setImportMode(ResultsImportMode.ESDU_BY_SPECIES_AND_AGE_CATEGORY); - prepareInputFile(conf.getAcousticBySpeciesAndAgeCategoryFile(), - getImportPath("acousticResultBySpeciesAndAgeCategory.csv.gz")); + InputFile inputFile = conf.getEsduBySpeciesAndAgeCategoryFile(); + prepareInputFile(inputFile, + getImportPath("bySpeciesAndAgeCategory.csv.gz")); - addMissingEsduCells(conf.getVoyageId(), - conf.getAcousticBySpeciesAndSizeCategoryFile() - ); + addMissingEsduCells(conf.getVoyageId(), inputFile); //TODO Remove this when referentiel is ok create(getDAO(EchoBaseEntityEnum.DataMetadata), DataMetadata.PROPERTY_NAME, "N"); - List<CsvFileImportResult> result = doImport( - conf, ResultsEsduCellImportService.class, 1); + List<CsvFileImportResult> result; + result = doImport(conf, ResultsEsduCellImportService.class, 1); CsvFileImportResult actual = result.get(0); - assertCsvImportResult(actual, Result.class, NB_ESDU_RESULT_BY_SPECIES_AND_AGE_CATEGORY); + assertCsvImportResult(actual, Result.class, 10021); assertCsvImportResult(actual, AgeCategory.class, 10); + assertCsvImportResult(actual, Category.class, 14); + assertCsvImportResult(actual, SpeciesCategory.class, 14); } protected void addMissingEsduCells(String voyageId, Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportServiceIT.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportServiceIT.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportServiceIT.java 2012-03-27 23:02:51 UTC (rev 420) @@ -24,10 +24,10 @@ package fr.ifremer.echobase.services.importdata; import fr.ifremer.echobase.csv.CsvFileImportResult; +import fr.ifremer.echobase.entities.data.Cell; +import fr.ifremer.echobase.entities.data.Data; import fr.ifremer.echobase.entities.data.Result; import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; -import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration; -import fr.ifremer.echobase.services.configurations.ResultsImportMode; import org.junit.Ignore; import org.junit.Test; @@ -47,7 +47,7 @@ } protected String[] getImportPath(String filename) { - return new String[]{"/import-data", "result", filename}; + return new String[]{"/import-data", "result", "map", filename}; } @Ignore @@ -71,12 +71,16 @@ conf.setImportMode(ResultsImportMode.MAP); prepareInputFile(conf.getMapsFile(), getImportPath("maps.csv.gz")); - prepareInputFile(conf.getMapResultFile(), getImportPath("mapResult.csv.gz")); + //TODO Use this + //prepareInputFile(conf.getMapResultFile(), getImportPath("mapResults.csv.gz")); List<CsvFileImportResult> result = doImport( conf, ResultsMapCellImportService.class, 1); - assertCsvImportResult(result.get(0), Result.class, NB_ESDU_RESULT_BY_ECHOTYPE_AND_SPECIES); + assertCsvImportResult(result.get(0), Cell.class, 0); + assertCsvImportResult(result.get(0), Data.class, 0); + assertCsvImportResult(result.get(1), Result.class, 0); + } } \ No newline at end of file Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportServiceIT.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportServiceIT.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportServiceIT.java 2012-03-27 23:02:51 UTC (rev 420) @@ -28,8 +28,6 @@ import fr.ifremer.echobase.entities.data.Data; import fr.ifremer.echobase.entities.data.Result; import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; -import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration; -import fr.ifremer.echobase.services.configurations.ResultsImportMode; import org.junit.Test; import java.util.List; @@ -48,14 +46,12 @@ } protected String[] getImportPath(String filename) { - return new String[]{"/import-data", "result", filename}; + return new String[]{"/import-data", "result", "region", filename}; } @Test public void doImportRegion() throws Exception { - //TODO - assertImportCommonData(); assertImportOperations(); assertImportSampleDatas(); @@ -78,11 +74,13 @@ // prepareInputFile(conf.getRegionsFile(), // getImportPath("regionResults.csv.gz")); - List<CsvFileImportResult> result = doImport( - conf, ResultsRegionCellImportService.class, 1); + List<CsvFileImportResult> result; + result = doImport(conf, ResultsRegionCellImportService.class, 1); - assertCsvImportResult(result.get(0), Cell.class, NB_REGION_CELLS); - assertCsvImportResult(result.get(0), Data.class, NB_REGION_DATAS); + assertCsvImportResult(result.get(0), Cell.class, 228); + assertCsvImportResult(result.get(0), Data.class, 228 * 4); + //assertCsvImportResult(result.get(1), Result.class, 0); + //assertCsvImportResult(result.get(2), Result.class, 0); } } \ No newline at end of file Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsVoyageImportServiceIT.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsVoyageImportServiceIT.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsVoyageImportServiceIT.java 2012-03-27 23:02:51 UTC (rev 420) @@ -28,8 +28,6 @@ import fr.ifremer.echobase.entities.data.LengthAgeKey; import fr.ifremer.echobase.entities.data.LengthWeightKey; import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; -import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration; -import fr.ifremer.echobase.services.configurations.ResultsImportMode; import org.junit.Ignore; import org.junit.Test; @@ -48,7 +46,7 @@ } protected String[] getImportPath(String filename) { - return new String[]{"/import-data", "result", filename}; + return new String[]{"/import-data", "result", "voyage", filename}; } @Test Deleted: trunk/echobase-services/src/test/resources/import-data/result/acousticResultByEchotype.csv.gz =================================================================== (Binary files differ) Deleted: trunk/echobase-services/src/test/resources/import-data/result/acousticResultByEchotypeAndSpeciesCategory.csv.gz =================================================================== (Binary files differ) Deleted: trunk/echobase-services/src/test/resources/import-data/result/acousticResultBySpeciesAndAgeCategory.csv.gz =================================================================== (Binary files differ) Deleted: trunk/echobase-services/src/test/resources/import-data/result/acousticResultBySpeciesAndSizeCategory.csv.gz =================================================================== (Binary files differ) Deleted: trunk/echobase-services/src/test/resources/import-data/result/echotype.csv.gz =================================================================== (Binary files differ) Copied: trunk/echobase-services/src/test/resources/import-data/result/esdu/byEchotype.csv.gz (from rev 417, trunk/echobase-services/src/test/resources/import-data/result/acousticResultByEchotype.csv.gz) =================================================================== (Binary files differ) Property changes on: trunk/echobase-services/src/test/resources/import-data/result/esdu/byEchotype.csv.gz ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision HeadURL Copied: trunk/echobase-services/src/test/resources/import-data/result/esdu/byEchotypeAndSpeciesCategory.csv.gz (from rev 417, trunk/echobase-services/src/test/resources/import-data/result/acousticResultByEchotypeAndSpeciesCategory.csv.gz) =================================================================== (Binary files differ) Property changes on: trunk/echobase-services/src/test/resources/import-data/result/esdu/byEchotypeAndSpeciesCategory.csv.gz ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision HeadURL Copied: trunk/echobase-services/src/test/resources/import-data/result/esdu/bySpeciesAndAgeCategory.csv.gz (from rev 417, trunk/echobase-services/src/test/resources/import-data/result/acousticResultBySpeciesAndAgeCategory.csv.gz) =================================================================== (Binary files differ) Property changes on: trunk/echobase-services/src/test/resources/import-data/result/esdu/bySpeciesAndAgeCategory.csv.gz ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision HeadURL Copied: trunk/echobase-services/src/test/resources/import-data/result/esdu/bySpeciesAndSizeCategory.csv.gz (from rev 417, trunk/echobase-services/src/test/resources/import-data/result/acousticResultBySpeciesAndSizeCategory.csv.gz) =================================================================== (Binary files differ) Property changes on: trunk/echobase-services/src/test/resources/import-data/result/esdu/bySpeciesAndSizeCategory.csv.gz ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision HeadURL Deleted: trunk/echobase-services/src/test/resources/import-data/result/lengthAgeKey.csv.gz =================================================================== (Binary files differ) Deleted: trunk/echobase-services/src/test/resources/import-data/result/lengthWeightKey.csv.gz =================================================================== (Binary files differ) Copied: trunk/echobase-services/src/test/resources/import-data/result/region/regions.csv.gz (from rev 418, trunk/echobase-services/src/test/resources/import-data/result/regions.csv.gz) =================================================================== (Binary files differ) Property changes on: trunk/echobase-services/src/test/resources/import-data/result/region/regions.csv.gz ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision HeadURL Deleted: trunk/echobase-services/src/test/resources/import-data/result/regions.csv.gz =================================================================== (Binary files differ) Copied: trunk/echobase-services/src/test/resources/import-data/result/voyage/echotype.csv.gz (from rev 417, trunk/echobase-services/src/test/resources/import-data/result/echotype.csv.gz) =================================================================== (Binary files differ) Property changes on: trunk/echobase-services/src/test/resources/import-data/result/voyage/echotype.csv.gz ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision HeadURL Copied: trunk/echobase-services/src/test/resources/import-data/result/voyage/lengthAgeKey.csv.gz (from rev 417, trunk/echobase-services/src/test/resources/import-data/result/lengthAgeKey.csv.gz) =================================================================== (Binary files differ) Property changes on: trunk/echobase-services/src/test/resources/import-data/result/voyage/lengthAgeKey.csv.gz ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision HeadURL Copied: trunk/echobase-services/src/test/resources/import-data/result/voyage/lengthWeightKey.csv.gz (from rev 417, trunk/echobase-services/src/test/resources/import-data/result/lengthWeightKey.csv.gz) =================================================================== (Binary files differ) Property changes on: trunk/echobase-services/src/test/resources/import-data/result/voyage/lengthWeightKey.csv.gz ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -24,9 +24,9 @@ package fr.ifremer.echobase.tools.loaders; import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.AcousticInstrument; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.AgeCategory; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.AreaOfOperation; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/CellMethodLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/CellMethodLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/CellMethodLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.CellMethod; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/CellTypeLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/CellTypeLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/CellTypeLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.CellType; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -27,13 +27,13 @@ import com.healthmarketscience.jackcess.Database; import com.healthmarketscience.jackcess.Table; import fr.ifremer.echobase.EchoBaseFunctions; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.EchoBaseDAOHelper; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.CellMethod; import fr.ifremer.echobase.entities.references.DataMetadata; import fr.ifremer.echobase.entities.references.DataType; import fr.ifremer.echobase.entities.references.ReferenceDatum; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DataQualityLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DataQualityLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DataQualityLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.DataQuality; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DataTypeLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DataTypeLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DataTypeLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.DataType; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.DepthStratum; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.EchotypeCategory; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EchotypeLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EchotypeLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EchotypeLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -25,6 +25,7 @@ import com.google.common.collect.Maps; import fr.ifremer.echobase.EchoBaseFunctions; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.EchoBaseEntityEnum; import fr.ifremer.echobase.entities.data.Echotype; import fr.ifremer.echobase.entities.meta.AssociationMeta; @@ -33,7 +34,6 @@ import fr.ifremer.echobase.entities.references.EchotypeCategory; import fr.ifremer.echobase.entities.references.Species; import fr.ifremer.echobase.services.DbEditorService; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; import org.nuiton.util.csv.Import; Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EntityLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EntityLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EntityLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -33,6 +33,7 @@ import fr.ifremer.echobase.EchoBaseFunctions; import fr.ifremer.echobase.EchoBaseTechnicalException; import fr.ifremer.echobase.csv.CsvImportResult; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.EchoBaseEntityEnum; import fr.ifremer.echobase.entities.meta.AssociationMeta; import fr.ifremer.echobase.entities.meta.MetaFilenameAware; @@ -42,7 +43,6 @@ import fr.ifremer.echobase.services.EchoBaseServiceSupport; import fr.ifremer.echobase.services.ExportService; import fr.ifremer.echobase.services.ImportService; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/GearLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/GearLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/GearLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -24,9 +24,9 @@ package fr.ifremer.echobase.tools.loaders; import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.Gear; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; import java.util.Date; Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -24,11 +24,11 @@ package fr.ifremer.echobase.tools.loaders; import fr.ifremer.echobase.EchoBaseFunctions; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.EchoBaseEntityEnum; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.GearMetadata; import fr.ifremer.echobase.entities.references.OperationEvent; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; import java.util.List; Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/MissionLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/MissionLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/MissionLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.Mission; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationEventLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationEventLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationEventLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.OperationEvent; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -24,12 +24,12 @@ package fr.ifremer.echobase.tools.loaders; import fr.ifremer.echobase.EchoBaseFunctions; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.EchoBaseEntityEnum; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.GearMetadata; import fr.ifremer.echobase.entities.references.OperationEvent; import fr.ifremer.echobase.entities.references.OperationMetadata; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; import java.util.List; Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -24,10 +24,10 @@ package fr.ifremer.echobase.tools.loaders; import fr.ifremer.echobase.EchoBaseFunctions; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.ReferenceDatum; import fr.ifremer.echobase.entities.references.ReferenceDatumType; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; import java.util.List; Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.ReferenceDatumType; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.SampleDataType; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,10 +23,10 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.SampleDataType; import fr.ifremer.echobase.entities.references.SampleType; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.SexCategory; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,10 +23,10 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.SexCategory; import fr.ifremer.echobase.entities.references.SizeCategory; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SpeciesLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SpeciesLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SpeciesLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.Species; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/StrataLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/StrataLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/StrataLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -25,10 +25,10 @@ import fr.ifremer.echobase.EchoBaseFunctions; import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.DepthStratum; import fr.ifremer.echobase.entities.references.Strata; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; import java.util.List; Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/TSParametersLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/TSParametersLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/TSParametersLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -24,9 +24,9 @@ package fr.ifremer.echobase.tools.loaders; import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.TSParameters; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/VesselLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/VesselLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/VesselLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -25,10 +25,10 @@ import fr.ifremer.echobase.EchoBaseFunctions; import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.Vessel; import fr.ifremer.echobase.entities.references.VesselType; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; import java.util.List; Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoader.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoader.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,9 +23,9 @@ */ package fr.ifremer.echobase.tools.loaders; +import fr.ifremer.echobase.csv.EntityCsvModel; import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.entities.references.VesselType; -import fr.ifremer.echobase.services.csv.EntityCsvModel; import fr.ifremer.echobase.tools.FileType; /** Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java 2012-03-27 23:02:51 UTC (rev 420) @@ -24,10 +24,10 @@ package fr.ifremer.echobase.ui; import fr.ifremer.echobase.entities.EchoBaseUser; -import fr.ifremer.echobase.services.configurations.AbstractImportConfiguration; -import fr.ifremer.echobase.services.configurations.EmbeddedApplicationConfiguration; -import fr.ifremer.echobase.services.configurations.ExportDbConfiguration; -import fr.ifremer.echobase.services.configurations.ImportDbConfiguration; +import fr.ifremer.echobase.services.EmbeddedApplicationConfiguration; +import fr.ifremer.echobase.services.ExportDbConfiguration; +import fr.ifremer.echobase.services.ImportDbConfiguration; +import fr.ifremer.echobase.services.importdata.AbstractImportConfiguration; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -182,6 +182,6 @@ public boolean isAdmin() { EchoBaseUser user = getEchoBaseUser(); - return user!=null && user.isAdmin(); + return user != null && user.isAdmin(); } } Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/AbstractWaitAndExecAction.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/AbstractWaitAndExecAction.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/AbstractWaitAndExecAction.java 2012-03-27 23:02:51 UTC (rev 420) @@ -25,7 +25,7 @@ import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.Preparable; -import fr.ifremer.echobase.services.configurations.AbstractEchobaseActionConfiguration; +import fr.ifremer.echobase.services.AbstractEchobaseActionConfiguration; import org.nuiton.topia.TopiaContext; import org.nuiton.topia.framework.TopiaContextImplementor; Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/embeddedApplication/Build.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/embeddedApplication/Build.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/embeddedApplication/Build.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,8 +23,8 @@ */ package fr.ifremer.echobase.ui.actions.embeddedApplication; +import fr.ifremer.echobase.services.EmbeddedApplicationConfiguration; import fr.ifremer.echobase.services.EmbeddedApplicationService; -import fr.ifremer.echobase.services.configurations.EmbeddedApplicationConfiguration; import fr.ifremer.echobase.ui.actions.AbstractWaitAndExecAction; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/embeddedApplication/Configure.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/embeddedApplication/Configure.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/embeddedApplication/Configure.java 2012-03-27 23:02:51 UTC (rev 420) @@ -26,7 +26,7 @@ import fr.ifremer.echobase.EchoBaseConfiguration; import fr.ifremer.echobase.entities.data.Voyage; import fr.ifremer.echobase.services.EchoBaseServiceSupport; -import fr.ifremer.echobase.services.configurations.EmbeddedApplicationConfiguration; +import fr.ifremer.echobase.services.EmbeddedApplicationConfiguration; import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.io.FileUtils; Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/embeddedApplication/Download.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/embeddedApplication/Download.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/embeddedApplication/Download.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,7 +23,7 @@ */ package fr.ifremer.echobase.ui.actions.embeddedApplication; -import fr.ifremer.echobase.services.configurations.EmbeddedApplicationConfiguration; +import fr.ifremer.echobase.services.EmbeddedApplicationConfiguration; import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; import java.io.BufferedInputStream; Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportDb/Configure.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportDb/Configure.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportDb/Configure.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,7 +23,7 @@ */ package fr.ifremer.echobase.ui.actions.exportDb; -import fr.ifremer.echobase.services.configurations.ExportDbConfiguration; +import fr.ifremer.echobase.services.ExportDbConfiguration; import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportDb/Download.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportDb/Download.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportDb/Download.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,7 +23,7 @@ */ package fr.ifremer.echobase.ui.actions.exportDb; -import fr.ifremer.echobase.services.configurations.ExportDbConfiguration; +import fr.ifremer.echobase.services.ExportDbConfiguration; import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; import java.io.BufferedInputStream; Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportDb/Export.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportDb/Export.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportDb/Export.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,8 +23,8 @@ */ package fr.ifremer.echobase.ui.actions.exportDb; +import fr.ifremer.echobase.services.ExportDbConfiguration; import fr.ifremer.echobase.services.ExportDbService; -import fr.ifremer.echobase.services.configurations.ExportDbConfiguration; import fr.ifremer.echobase.ui.actions.AbstractWaitAndExecAction; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractConfigureImport.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractConfigureImport.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractConfigureImport.java 2012-03-27 23:02:51 UTC (rev 420) @@ -26,7 +26,7 @@ import com.opensymphony.xwork2.interceptor.annotations.InputConfig; import fr.ifremer.echobase.InputFile; import fr.ifremer.echobase.services.EchoBaseServiceSupport; -import fr.ifremer.echobase.services.configurations.AbstractImportConfiguration; +import fr.ifremer.echobase.services.importdata.AbstractImportConfiguration; import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java 2012-03-27 23:02:51 UTC (rev 420) @@ -24,9 +24,9 @@ package fr.ifremer.echobase.ui.actions.importData; import fr.ifremer.echobase.csv.CsvFileImportResult; +import fr.ifremer.echobase.services.ImportException; +import fr.ifremer.echobase.services.importdata.AbstractImportConfiguration; import fr.ifremer.echobase.services.importdata.AbstractImportDataService; -import fr.ifremer.echobase.services.ImportException; -import fr.ifremer.echobase.services.configurations.AbstractImportConfiguration; import fr.ifremer.echobase.ui.actions.AbstractWaitAndExecAction; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData.java 2012-03-27 23:02:51 UTC (rev 420) @@ -1,96 +0,0 @@ -/* - * #%L - * EchoBase :: UI - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.ui.actions.importData; - -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.services.EchoBaseServiceSupport; -import fr.ifremer.echobase.services.configurations.AcousticDataImportConfiguration; -import fr.ifremer.echobase.services.configurations.CellPositionReference; - -import java.io.File; -import java.util.Map; - -/** - * Configure a accoustic data import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class ConfigureAccousticData extends AbstractConfigureImport<AcousticDataImportConfiguration> { - - private static final long serialVersionUID = 1L; - - /** Universe of existing voyages. */ - protected Map<String, String> voyages; - - protected Map<String, String> cellPositionReferences; - - public ConfigureAccousticData() { - super(AcousticDataImportConfiguration.class); - } - - @Override - protected AcousticDataImportConfiguration createModel() { - return new AcousticDataImportConfiguration(getLocale()); - } - - @Override - public String input() throws Exception { - - super.input(); - - EchoBaseServiceSupport service = - newService(EchoBaseServiceSupport.class); - - voyages = loadSortAndDecorate(service, Voyage.class); - cellPositionReferences = decorateEnums(CellPositionReference.values()); - - if (getModel().getCellPositionReference() == null) { - - getModel().setCellPositionReference(CellPositionReference.START); - } - - return INPUT; - } - - public Map<String, String> getVoyages() { - return voyages; - } - - public Map<String, String> getCellPositionReferences() { - return cellPositionReferences; - } - - public void setMoviesFile(File file) { - getModel().getMoviesFile().setFile(file); - } - - public void setMoviesFileContentType(String contentType) { - getModel().getMoviesFile().setContentType(contentType); - } - - public void setMoviesFileFileName(String fileName) { - getModel().getMoviesFile().setFileName(fileName); - } -} Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java (from rev 416, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData.java) =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,96 @@ +/* + * #%L + * EchoBase :: UI + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.ui.actions.importData; + +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.services.EchoBaseServiceSupport; +import fr.ifremer.echobase.services.importdata.AcousticDataImportConfiguration; +import fr.ifremer.echobase.services.importdata.CellPositionReference; + +import java.io.File; +import java.util.Map; + +/** + * Configure a accoustic data import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class ConfigureAcousticData extends AbstractConfigureImport<AcousticDataImportConfiguration> { + + private static final long serialVersionUID = 1L; + + /** Universe of existing voyages. */ + protected Map<String, String> voyages; + + protected Map<String, String> cellPositionReferences; + + public ConfigureAcousticData() { + super(AcousticDataImportConfiguration.class); + } + + @Override + protected AcousticDataImportConfiguration createModel() { + return new AcousticDataImportConfiguration(getLocale()); + } + + @Override + public String input() throws Exception { + + super.input(); + + EchoBaseServiceSupport service = + newService(EchoBaseServiceSupport.class); + + voyages = loadSortAndDecorate(service, Voyage.class); + cellPositionReferences = decorateEnums(CellPositionReference.values()); + + if (getModel().getCellPositionReference() == null) { + + getModel().setCellPositionReference(CellPositionReference.START); + } + + return INPUT; + } + + public Map<String, String> getVoyages() { + return voyages; + } + + public Map<String, String> getCellPositionReferences() { + return cellPositionReferences; + } + + public void setMoviesFile(File file) { + getModel().getMoviesFile().setFile(file); + } + + public void setMoviesFileContentType(String contentType) { + getModel().getMoviesFile().setContentType(contentType); + } + + public void setMoviesFileFileName(String fileName) { + getModel().getMoviesFile().setFileName(fileName); + } +} Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java 2012-03-27 23:02:51 UTC (rev 420) @@ -25,7 +25,7 @@ import fr.ifremer.echobase.entities.data.Voyage; import fr.ifremer.echobase.services.EchoBaseServiceSupport; -import fr.ifremer.echobase.services.configurations.CatchesDataImportConfiguration; +import fr.ifremer.echobase.services.importdata.CatchesDataImportConfiguration; import java.io.File; import java.util.Map; Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java 2012-03-27 23:02:51 UTC (rev 420) @@ -28,8 +28,8 @@ import fr.ifremer.echobase.entities.references.AreaOfOperation; import fr.ifremer.echobase.entities.references.Mission; import fr.ifremer.echobase.services.EchoBaseServiceSupport; -import fr.ifremer.echobase.services.configurations.CommonDataImportConfiguration; -import fr.ifremer.echobase.services.configurations.CommonDataImportMode; +import fr.ifremer.echobase.services.importdata.CommonDataImportConfiguration; +import fr.ifremer.echobase.services.importdata.CommonDataImportMode; import java.io.File; import java.util.Map; Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java 2012-03-27 23:02:51 UTC (rev 420) @@ -25,7 +25,7 @@ import fr.ifremer.echobase.entities.data.Voyage; import fr.ifremer.echobase.services.EchoBaseServiceSupport; -import fr.ifremer.echobase.services.configurations.OperationImportConfiguration; +import fr.ifremer.echobase.services.importdata.OperationImportConfiguration; import java.io.File; import java.util.Map; Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java 2012-03-27 23:02:51 UTC (rev 420) @@ -27,8 +27,8 @@ import fr.ifremer.echobase.entities.data.Voyage; import fr.ifremer.echobase.entities.references.Vessel; import fr.ifremer.echobase.services.EchoBaseServiceSupport; -import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration; -import fr.ifremer.echobase.services.configurations.ResultsImportMode; +import fr.ifremer.echobase.services.importdata.ResultsImportConfiguration; +import fr.ifremer.echobase.services.importdata.ResultsImportMode; import java.io.File; import java.util.Map; @@ -89,25 +89,25 @@ } @InputConfig(methodName = "input") - public String modeAcousticByEchotype() throws Exception { + public String modeEsduByEchotype() throws Exception { return execute(); } @InputConfig(methodName = "input") - public String modeAcousticByEchotypeAndSpeciesCategory() throws Exception { + public String modeEsduByEchotypeAndSpeciesCategory() throws Exception { return execute(); } @InputConfig(methodName = "input") - public String modeAcousticBySpeciesAndSizeCategory() throws Exception { + public String modeEsduBySpeciesAndSizeCategory() throws Exception { return execute(); } @InputConfig(methodName = "input") - public String modeAcousticBySpeciesAndAgeCategory() throws Exception { + public String modeEsduBySpeciesAndAgeCategory() throws Exception { return execute(); } @@ -241,28 +241,51 @@ getModel().getEchotypeFile().setFileName(fileName); } - public void setAcousticByEchotypeFile(File file) { - getModel().getAcousticByEchotypeFile().setFile(file); + public void setEsduByEchotypeFile(File file) { + getModel().getEsduByEchotypeFile().setFile(file); } - public void setAcousticByEchotypeFileContentType(String contentType) { - getModel().getAcousticByEchotypeFile().setContentType(contentType); + public void setEsduByEchotypeFileContentType(String contentType) { + getModel().getEsduByEchotypeFile().setContentType(contentType); } - public void setAcousticByEchotypeFileName(String fileName) { - getModel().getAcousticByEchotypeFile().setFileName(fileName); + public void setEsduByEchotypeFileName(String fileName) { + getModel().getEsduByEchotypeFile().setFileName(fileName); } - public void setAcousticByEchotypeAndSpeciesCategoryFileFile(File file) { - getModel().getAcousticByEchotypeAndSpeciesCategoryFile().setFile(file); + public void setEsduByEchotypeAndSpeciesCategoryFileFile(File file) { + getModel().getEsduByEchotypeAndSpeciesCategoryFile().setFile(file); } - public void setAcousticByEchotypeAndSpeciesCategoryFileContentType(String contentType) { - getModel().getAcousticByEchotypeAndSpeciesCategoryFile().setContentType(contentType); + public void setEsduByEchotypeAndSpeciesCategoryFileContentType(String contentType) { + getModel().getEsduByEchotypeAndSpeciesCategoryFile().setContentType(contentType); } - public void setAcousticByEchotypeAndSpeciesCategoryFileName(String fileName) { - getModel().getAcousticByEchotypeAndSpeciesCategoryFile().setFileName(fileName); + public void setEsduByEchotypeAndSpeciesCategoryFileName(String fileName) { + getModel().getEsduByEchotypeAndSpeciesCategoryFile().setFileName(fileName); } + public void setEsduBySpeciesAndSizeCategoryFile(File file) { + getModel().getEsduBySpeciesAndSizeCategoryFile().setFile(file); + } + + public void setEsduBySpeciesAndSizeCategoryFileContentType(String contentType) { + getModel().getEsduBySpeciesAndSizeCategoryFile().setContentType(contentType); + } + + public void setEsduBySpeciesAndSizeCategoryFileName(String fileName) { + getModel().getEsduBySpeciesAndSizeCategoryFile().setFileName(fileName); + } + + public void setEsduBySpeciesAndAgeCategoryFile(File file) { + getModel().getEsduBySpeciesAndAgeCategoryFile().setFile(file); + } + + public void setEsduBySpeciesAndAgeCategoryFileContentType(String contentType) { + getModel().getEsduBySpeciesAndAgeCategoryFile().setContentType(contentType); + } + + public void setEsduBySpeciesAndAgeCategoryFileName(String fileName) { + getModel().getEsduBySpeciesAndAgeCategoryFile().setFileName(fileName); + } } Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticData.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticData.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticData.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,8 +23,8 @@ */ package fr.ifremer.echobase.ui.actions.importData; +import fr.ifremer.echobase.services.importdata.AcousticDataImportConfiguration; import fr.ifremer.echobase.services.importdata.AcousticDataImportService; -import fr.ifremer.echobase.services.configurations.AcousticDataImportConfiguration; /** * Configure a accoustic data import. Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesData.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesData.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesData.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,8 +23,8 @@ */ package fr.ifremer.echobase.ui.actions.importData; +import fr.ifremer.echobase.services.importdata.CatchesDataImportConfiguration; import fr.ifremer.echobase.services.importdata.CatchesDataImportService; -import fr.ifremer.echobase.services.configurations.CatchesDataImportConfiguration; /** * Configure a accoustic data import. Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,8 +23,8 @@ */ package fr.ifremer.echobase.ui.actions.importData; +import fr.ifremer.echobase.services.importdata.CommonDataImportConfiguration; import fr.ifremer.echobase.services.importdata.CommonDataImportService; -import fr.ifremer.echobase.services.configurations.CommonDataImportConfiguration; /** * Configure a accoustic data import. Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,8 +23,8 @@ */ package fr.ifremer.echobase.ui.actions.importData; +import fr.ifremer.echobase.services.importdata.OperationImportConfiguration; import fr.ifremer.echobase.services.importdata.OperationImportService; -import fr.ifremer.echobase.services.configurations.OperationImportConfiguration; /** * TODO Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,8 +23,8 @@ */ package fr.ifremer.echobase.ui.actions.importData; +import fr.ifremer.echobase.services.importdata.ResultsImportConfiguration; import fr.ifremer.echobase.services.importdata.ResultsImportService; -import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration; /** * Configure a "result" import. Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importDb/Configure.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importDb/Configure.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importDb/Configure.java 2012-03-27 23:02:51 UTC (rev 420) @@ -24,7 +24,7 @@ package fr.ifremer.echobase.ui.actions.importDb; import fr.ifremer.echobase.InputFile; -import fr.ifremer.echobase.services.configurations.ImportDbConfiguration; +import fr.ifremer.echobase.services.ImportDbConfiguration; import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importDb/Import.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importDb/Import.java 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importDb/Import.java 2012-03-27 23:02:51 UTC (rev 420) @@ -23,8 +23,8 @@ */ package fr.ifremer.echobase.ui.actions.importDb; +import fr.ifremer.echobase.services.ImportDbConfiguration; import fr.ifremer.echobase.services.ImportDbService; -import fr.ifremer.echobase.services.configurations.ImportDbConfiguration; import fr.ifremer.echobase.ui.actions.AbstractWaitAndExecAction; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; Modified: trunk/echobase-ui/src/main/resources/config/struts-user.xml =================================================================== --- trunk/echobase-ui/src/main/resources/config/struts-user.xml 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/resources/config/struts-user.xml 2012-03-27 23:02:51 UTC (rev 420) @@ -42,7 +42,8 @@ </action> <!-- Logout --> - <action name="logout" class="fr.ifremer.echobase.ui.actions.user.LoginAction" + <action name="logout" + class="fr.ifremer.echobase.ui.actions.user.LoginAction" method="doLogout"> <result type="redirectAction"> <param name="namespace">/</param> @@ -53,7 +54,8 @@ </action> <!-- Display lists of users --> - <action name="userList" class="fr.ifremer.echobase.ui.actions.EchoBaseActionSupport"> + <action name="userList" + class="fr.ifremer.echobase.ui.actions.EchoBaseActionSupport"> <interceptor-ref name="basicStackLoggued"/> <interceptor-ref name="checkUserIsAdmin"/> <result>/WEB-INF/jsp/user/userList.jsp</result> Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData-validation.xml 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData-validation.xml 2012-03-27 23:02:51 UTC (rev 420) @@ -1,156 +0,0 @@ -<!-- - #%L - EchoBase :: UI - - $Id$ - $HeadURL$ - %% - Copyright (C) 2011 Ifremer, Codelutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN" - "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd"> -<validators> - - <field name="model.voyageId"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.voyage.required"/> - </field-validator> - </field> - - <field name="model.transitId"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.transit.required"/> - </field-validator> - </field> - - <field name="model.vesselId"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.vessel.required"/> - </field-validator> - </field> - - <field name="model.cellPositionReference"> - <field-validator type="nrequired"> - <message key="echobase.error.import.cellPositionReference.required"/> - </field-validator> - </field> - - <field name="model.transceiverAcquisitionAbsorptionDescription"> - <field-validator type="nrequiredstring"> - <message - key="echobase.error.import.transceiverAcquisitionAbsorptionDescription.required"/> - </field-validator> - </field> - - <field name="model.acquisitionSoftwareVersionER60"> - <field-validator type="nrequiredstring"> - <message - key="echobase.error.import.acquisitionSoftwareVersionER60.required"/> - </field-validator> - </field> - - <field name="model.acquisitionSoftwareVersionME70"> - <field-validator type="nrequiredstring"> - <message - key="echobase.error.import.acquisitionSoftwareVersionME70.required"/> - </field-validator> - </field> - - <field name="model.echosounderSoundSpeed"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.echosounderSoundSpeed.required"/> - </field-validator> - </field> - - <field name="model.loggedDataFormat"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.loggedDataFormat.required"/> - </field-validator> - </field> - - <field name="model.loggedDataDatatype"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.loggedDataDatatype.required"/> - </field-validator> - </field> - - <field name="model.pingDutyCycle"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.pingDutyCycle.required"/> - </field-validator> - </field> - - <field name="model.soundSpeedCalculationsER60"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.soundSpeedCalculationsER60.required"/> - </field-validator> - </field> - - <field name="model.soundSpeedCalculationsME70"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.soundSpeedCalculationsME70.required"/> - </field-validator> - </field> - - <field name="model.sounderConstant"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.sounderConstant.required"/> - </field-validator> - </field> - - <field name="model.processingTemplate"> - <field-validator type="nrequiredstring"> - <message - key="echobase.error.import.processingTemplate.required"/> - </field-validator> - </field> - - <field name="model.processingDescription"> - <field-validator type="nrequiredstring"> - <message - key="echobase.error.import.processingDescription.required"/> - </field-validator> - </field> - - <field name="model.digitThreshold"> - <field-validator type="nrequiredstring"> - <message - key="echobase.error.import.digitThreshold.required"/> - </field-validator> - </field> - - <field name="model.acousticDensityUnit"> - <field-validator type="nrequiredstring"> - <message - key="echobase.error.import.acousticDensityUnit.required"/> - </field-validator> - </field> - - <field name="model.notes"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.notes.required"/> - </field-validator> - </field> - - <field name="moviesFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.moviesFile.file!=null</param> - <message key="echobase.error.import.moviesFile.required"/> - </field-validator> - </field> - -</validators> \ No newline at end of file Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData-validation.xml (from rev 419, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData-validation.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData-validation.xml 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,156 @@ +<!-- + #%L + EchoBase :: UI + + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd"> +<validators> + + <field name="model.voyageId"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.voyage.required"/> + </field-validator> + </field> + + <field name="model.transitId"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.transit.required"/> + </field-validator> + </field> + + <field name="model.vesselId"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.vessel.required"/> + </field-validator> + </field> + + <field name="model.cellPositionReference"> + <field-validator type="nrequired"> + <message key="echobase.error.import.cellPositionReference.required"/> + </field-validator> + </field> + + <field name="model.transceiverAcquisitionAbsorptionDescription"> + <field-validator type="nrequiredstring"> + <message + key="echobase.error.import.transceiverAcquisitionAbsorptionDescription.required"/> + </field-validator> + </field> + + <field name="model.acquisitionSoftwareVersionER60"> + <field-validator type="nrequiredstring"> + <message + key="echobase.error.import.acquisitionSoftwareVersionER60.required"/> + </field-validator> + </field> + + <field name="model.acquisitionSoftwareVersionME70"> + <field-validator type="nrequiredstring"> + <message + key="echobase.error.import.acquisitionSoftwareVersionME70.required"/> + </field-validator> + </field> + + <field name="model.echosounderSoundSpeed"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.echosounderSoundSpeed.required"/> + </field-validator> + </field> + + <field name="model.loggedDataFormat"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.loggedDataFormat.required"/> + </field-validator> + </field> + + <field name="model.loggedDataDatatype"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.loggedDataDatatype.required"/> + </field-validator> + </field> + + <field name="model.pingDutyCycle"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.pingDutyCycle.required"/> + </field-validator> + </field> + + <field name="model.soundSpeedCalculationsER60"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.soundSpeedCalculationsER60.required"/> + </field-validator> + </field> + + <field name="model.soundSpeedCalculationsME70"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.soundSpeedCalculationsME70.required"/> + </field-validator> + </field> + + <field name="model.sounderConstant"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.sounderConstant.required"/> + </field-validator> + </field> + + <field name="model.processingTemplate"> + <field-validator type="nrequiredstring"> + <message + key="echobase.error.import.processingTemplate.required"/> + </field-validator> + </field> + + <field name="model.processingDescription"> + <field-validator type="nrequiredstring"> + <message + key="echobase.error.import.processingDescription.required"/> + </field-validator> + </field> + + <field name="model.digitThreshold"> + <field-validator type="nrequiredstring"> + <message + key="echobase.error.import.digitThreshold.required"/> + </field-validator> + </field> + + <field name="model.acousticDensityUnit"> + <field-validator type="nrequiredstring"> + <message + key="echobase.error.import.acousticDensityUnit.required"/> + </field-validator> + </field> + + <field name="model.notes"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.notes.required"/> + </field-validator> + </field> + + <field name="moviesFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.moviesFile.file!=null</param> + <message key="echobase.error.import.moviesFile.required"/> + </field-validator> + </field> + +</validators> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotype-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotype-validation.xml 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotype-validation.xml 2012-03-27 23:02:51 UTC (rev 420) @@ -1,47 +0,0 @@ -<!-- - #%L - EchoBase :: UI - - $Id$ - $HeadURL$ - %% - Copyright (C) 2011 Ifremer, Codelutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN" - "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd"> -<validators> - - <field name="model.voyageId"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.voyage.required"/> - </field-validator> - </field> - - <field name="model.resultLabel"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.resultLabel.required"/> - </field-validator> - </field> - - <field name="acousticByEchotypeFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.acousticByEchotypeFile.file!=null</param> - <message key="echobase.error.import.acousticByEchotypeFile.required"/> - </field-validator> - </field> - -</validators> \ No newline at end of file Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotypeAndSpeciesCategory-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotypeAndSpeciesCategory-validation.xml 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotypeAndSpeciesCategory-validation.xml 2012-03-27 23:02:51 UTC (rev 420) @@ -1,50 +0,0 @@ -<!-- - #%L - EchoBase :: UI - - $Id$ - $HeadURL$ - %% - Copyright (C) 2011 Ifremer, Codelutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN" - "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd"> -<validators> - - <field name="model.voyageId"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.voyage.required"/> - </field-validator> - </field> - - <field name="model.resultLabel"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.resultLabel.required"/> - </field-validator> - </field> - - <field name="acousticByEchotypeAndSpeciesCategoryFile"> - <field-validator type="nfieldexpression"> - <param name="expression"> - model.acousticByEchotypeAndSpeciesCategoryFile.file!=null - </param> - <message - key="echobase.error.import.acousticByEchotypeAndSpeciesCategoryFile.required"/> - </field-validator> - </field> - -</validators> \ No newline at end of file Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticBySpeciesAndAgeCategory-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticBySpeciesAndAgeCategory-validation.xml 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticBySpeciesAndAgeCategory-validation.xml 2012-03-27 23:02:51 UTC (rev 420) @@ -1,50 +0,0 @@ -<!-- - #%L - EchoBase :: UI - - $Id$ - $HeadURL$ - %% - Copyright (C) 2011 Ifremer, Codelutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN" - "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd"> -<validators> - - <field name="model.voyageId"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.voyage.required"/> - </field-validator> - </field> - - <field name="model.resultLabel"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.resultLabel.required"/> - </field-validator> - </field> - - <field name="acousticBySpeciesAndAgeCategoryFile"> - <field-validator type="nfieldexpression"> - <param name="expression"> - model.acousticBySpeciesAndAgeCategoryFile.file!=null - </param> - <message - key="echobase.error.import.acousticBySpeciesAndAgeCategoryFile.required"/> - </field-validator> - </field> - -</validators> \ No newline at end of file Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticBySpeciesAndSizeCategory-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticBySpeciesAndSizeCategory-validation.xml 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticBySpeciesAndSizeCategory-validation.xml 2012-03-27 23:02:51 UTC (rev 420) @@ -1,50 +0,0 @@ -<!-- - #%L - EchoBase :: UI - - $Id$ - $HeadURL$ - %% - Copyright (C) 2011 Ifremer, Codelutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN" - "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd"> -<validators> - - <field name="model.voyageId"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.voyage.required"/> - </field-validator> - </field> - - <field name="model.resultLabel"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.resultLabel.required"/> - </field-validator> - </field> - - <field name="acousticBySpeciesAndSizeCategoryFile"> - <field-validator type="nfieldexpression"> - <param name="expression"> - model.acousticBySpeciesAndSizeCategoryFile.file!=null - </param> - <message - key="echobase.error.import.acousticBySpeciesAndSizeCategoryFile.required"/> - </field-validator> - </field> - -</validators> \ No newline at end of file Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduByEchotype-validation.xml (from rev 419, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotype-validation.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduByEchotype-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduByEchotype-validation.xml 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,47 @@ +<!-- + #%L + EchoBase :: UI + + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd"> +<validators> + + <field name="model.voyageId"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.voyage.required"/> + </field-validator> + </field> + + <field name="model.resultLabel"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.resultLabel.required"/> + </field-validator> + </field> + + <field name="esduByEchotypeFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.esduByEchotypeFile.file!=null</param> + <message key="echobase.error.import.esduByEchotypeFile.required"/> + </field-validator> + </field> + +</validators> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduByEchotype-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduByEchotypeAndSpeciesCategory-validation.xml (from rev 419, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotypeAndSpeciesCategory-validation.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduByEchotypeAndSpeciesCategory-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduByEchotypeAndSpeciesCategory-validation.xml 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,50 @@ +<!-- + #%L + EchoBase :: UI + + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd"> +<validators> + + <field name="model.voyageId"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.voyage.required"/> + </field-validator> + </field> + + <field name="model.resultLabel"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.resultLabel.required"/> + </field-validator> + </field> + + <field name="esduByEchotypeAndSpeciesCategoryFile"> + <field-validator type="nfieldexpression"> + <param name="expression"> + model.esduByEchotypeAndSpeciesCategoryFile.file!=null + </param> + <message + key="echobase.error.import.esduByEchotypeAndSpeciesCategoryFile.required"/> + </field-validator> + </field> + +</validators> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduByEchotypeAndSpeciesCategory-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduBySpeciesAndAgeCategory-validation.xml (from rev 419, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticBySpeciesAndAgeCategory-validation.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduBySpeciesAndAgeCategory-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduBySpeciesAndAgeCategory-validation.xml 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,50 @@ +<!-- + #%L + EchoBase :: UI + + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd"> +<validators> + + <field name="model.voyageId"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.voyage.required"/> + </field-validator> + </field> + + <field name="model.resultLabel"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.resultLabel.required"/> + </field-validator> + </field> + + <field name="esduBySpeciesAndAgeCategoryFile"> + <field-validator type="nfieldexpression"> + <param name="expression"> + model.esduBySpeciesAndAgeCategoryFile.file!=null + </param> + <message + key="echobase.error.import.esduBySpeciesAndAgeCategoryFile.required"/> + </field-validator> + </field> + +</validators> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduBySpeciesAndAgeCategory-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduBySpeciesAndSizeCategory-validation.xml (from rev 419, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticBySpeciesAndSizeCategory-validation.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduBySpeciesAndSizeCategory-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduBySpeciesAndSizeCategory-validation.xml 2012-03-27 23:02:51 UTC (rev 420) @@ -0,0 +1,50 @@ +<!-- + #%L + EchoBase :: UI + + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd"> +<validators> + + <field name="model.voyageId"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.voyage.required"/> + </field-validator> + </field> + + <field name="model.resultLabel"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.resultLabel.required"/> + </field-validator> + </field> + + <field name="esduBySpeciesAndSizeCategoryFile"> + <field-validator type="nfieldexpression"> + <param name="expression"> + model.esduBySpeciesAndSizeCategoryFile.file!=null + </param> + <message + key="echobase.error.import.esduBySpeciesAndSizeCategoryFile.required"/> + </field-validator> + </field> + +</validators> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsduBySpeciesAndSizeCategory-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/LoginAction-login-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/LoginAction-login-validation.xml 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/LoginAction-login-validation.xml 2012-03-27 23:02:51 UTC (rev 420) @@ -26,7 +26,7 @@ <validators> <field name="email"> - + <field-validator type="login"> <message key="echobase.error.login.wrongLogin"/> </field-validator> Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties =================================================================== --- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties 2012-03-27 23:02:51 UTC (rev 420) @@ -20,8 +20,8 @@ echobase.error.export.sqlQuery.forbidden.drop.word=Export query contains a forbidden word 'DROP' echobase.error.export.sqlQuery.forbidden.insert.word=Export query contains a forbidden word 'INSERT' echobase.error.export.sqlQuery.forbidden.update.word=Export query contains a forbidden word 'UPDATE' -echobase.error.import.acousticByEchotypeAndSpeciesFile.required=Import file is mandatory -echobase.error.import.acousticByEchotypeFile.required=Import file is mandatory +echobase.error.import.esduByEchotypeAndSpeciesFile.required=Import file is mandatory +echobase.error.import.esduByEchotypeFile.required=Import file is mandatory echobase.error.import.resultLabel.required=ResultLabel is required echobase.error.invalid.sql=Invalid request \: %s echobase.error.login.unknown=Unkwon login Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties =================================================================== --- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-03-27 23:02:51 UTC (rev 420) @@ -83,10 +83,6 @@ echobase.error.export.sqlQuery.forbidden.update.word=La requète contient le mot 'UPDATE', ce qui est interdit echobase.error.export.sqlQuery.requiredstring=La requête de l'export est obligatoire echobase.error.export.sqlQuery.wrongformat=La requêtes n'est pas valide -echobase.error.import.acousticByEchotypeAndSpeciesCategoryFile.required=La sélection d'un fichier d'import est obligatoire -echobase.error.import.acousticByEchotypeFile.required=La sélection d'un fichier d'import est obligatoire -echobase.error.import.acousticBySpeciesAndAgeCategoryFile.required=La sélection d'un fichier d'import est obligatoire -echobase.error.import.acousticBySpeciesAndSizeCategoryFile.required=La sélection d'un fichier d'import est obligatoire echobase.error.import.acousticDensityUnit.required=acousticDensityUnit non renseigné echobase.error.import.acquisitionSoftwareVersionER60.required=acquisitionSoftwareVersionER60 non renseigné echobase.error.import.acquisitionSoftwareVersionME70.required=acquisitionSoftwareVersionME70 non renseigné @@ -97,6 +93,10 @@ echobase.error.import.digitThreshold.required=digitThreshold non renseigné echobase.error.import.echosounderSoundSpeed.required=echosounderSoundSpeed non renseigné echobase.error.import.echotypeFile.required=La sélection d'un fichier Echotype est obligatoire +echobase.error.import.esduByEchotypeAndSpeciesCategoryFile.required=La sélection d'un fichier d'import est obligatoire +echobase.error.import.esduByEchotypeFile.required=La sélection d'un fichier d'import est obligatoire +echobase.error.import.esduBySpeciesAndAgeCategoryFile.required=La sélection d'un fichier d'import est obligatoire +echobase.error.import.esduBySpeciesAndSizeCategoryFile.required=La sélection d'un fichier d'import est obligatoire echobase.error.import.gearMetadataFile.required=La sélection d'un fichier GearMetadata est obligatoire echobase.error.import.importMode.required=Le mode d'import est obligatoire echobase.error.import.lengthWeightKeyFile.required=La sélection d'un fichier lengthWeightKey est obligatoire Modified: trunk/echobase-ui/src/main/resources/template/css_xhtml/checkbox.ftl =================================================================== --- trunk/echobase-ui/src/main/resources/template/css_xhtml/checkbox.ftl 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/resources/template/css_xhtml/checkbox.ftl 2012-03-27 23:02:51 UTC (rev 420) @@ -27,83 +27,85 @@ lables --> <#assign hasFieldErrors = fieldErrors?? && fieldErrors[parameters.name]??/> -<div <#rt/><#if parameters.id??>id="wwgrp_${parameters.id}"<#rt/></#if> class="wwgrp"> +<div <#rt/><#if parameters.id??>id="wwgrp_${parameters.id}"<#rt/></#if> + class="wwgrp"> <#if hasFieldErrors> -<div <#rt/><#if parameters.id??>id="wwerr_${parameters.id}"<#rt/></#if> class="wwerr"> -<#list fieldErrors[parameters.name] as error> - <div<#rt/> - <#if parameters.id??> - errorFor="${parameters.id}"<#rt/> - </#if> - class="errorMessage"> - ${error?html} - </div><#t/> -</#list> -</div><#t/> + <div <#rt/><#if parameters.id??>id="wwerr_${parameters.id}"<#rt/></#if> + class="wwerr"> + <#list fieldErrors[parameters.name] as error> + <div<#rt/> + <#if parameters.id??> + errorFor="${parameters.id}"<#rt/> + </#if> + class="errorMessage"> + ${error?html} + </div><#t/> + </#list> + </div><#t/> </#if> <#if parameters.labelposition?default("left") == 'left'> -<span <#rt/> -<#if parameters.id??>id="wwlbl_${parameters.id}"<#rt/></#if> class="wwlbl"> + <span <#rt/> + <#if parameters.id??>id="wwlbl_${parameters.id}"<#rt/></#if> class="wwlbl"> <label<#t/> -<#if parameters.id??> - for="${parameters.id?html}"<#rt/> -</#if> -<#if hasFieldErrors> - class="checkboxErrorLabel"<#rt/> -<#else> - class="label"<#rt/> -</#if> ->${parameters.label?html} + <#if parameters.id??> + for="${parameters.id?html}"<#rt/> + </#if> + <#if hasFieldErrors> + class="checkboxErrorLabel"<#rt/> + <#else> + class="label"<#rt/> + </#if> + >${parameters.label?html} <#if parameters.tooltip??> - <#include "/${parameters.templateDir}/xhtml/tooltip.ftl" /> + <#include "/${parameters.templateDir}/xhtml/tooltip.ftl" /> </#if> </label><#rt/> </span> </#if> <#if parameters.labelposition?default("left") == 'top'> -<div <#rt/> + <div <#rt/> <#else> -<span <#rt/> + <span <#rt/> </#if> <#if parameters.id??>id="wwctrl_${parameters.id}"<#rt/></#if> class="wwctrl"> <#if parameters.required?default(false)> - <span class="required">*</span><#t/> + <span class="required">*</span><#t/> </#if> <#include "/${parameters.templateDir}/simple/checkbox.ftl" /> <#if parameters.labelposition?default("left") != 'left'> -<#if parameters.labelposition?default("left") == 'top'> -</div> <#rt/> -<#else> -</span> <#rt/> + <#if parameters.labelposition?default("left") == 'top'> + </div> <#rt/> + <#else> + </span> <#rt/> + </#if> + <#if parameters.label??> + <#if parameters.labelposition?default("left") == 'top'> + <div <#rt/> + <#else> + <span <#rt/> + </#if> + <#if parameters.id??>id="wwlbl_${parameters.id}"<#rt/></#if> class="wwlbl"> + <label<#t/> + <#if parameters.id??> + for="${parameters.id?html}"<#rt/> + </#if> + <#if hasFieldErrors> + class="checkboxErrorLabel"<#rt/> + <#else> + class="checkboxLabel"<#rt/> + </#if> + >${parameters.label?html}</label><#rt/> + </#if> </#if> <#if parameters.label??> -<#if parameters.labelposition?default("left") == 'top'> -<div <#rt/> -<#else> -<span <#rt/> + <#if parameters.labelposition?default("left") == 'top'> + </div> <#rt/> + <#else> + </span> <#rt/> + </#if> </#if> -<#if parameters.id??>id="wwlbl_${parameters.id}"<#rt/></#if> class="wwlbl"> -<label<#t/> -<#if parameters.id??> - for="${parameters.id?html}"<#rt/> -</#if> -<#if hasFieldErrors> - class="checkboxErrorLabel"<#rt/> -<#else> - class="checkboxLabel"<#rt/> -</#if> ->${parameters.label?html}</label><#rt/> -</#if> -</#if> -<#if parameters.label??> -<#if parameters.labelposition?default("left") == 'top'> -</div> <#rt/> -<#else> -</span> <#rt/> -</#if> -</#if> </div> Modified: trunk/echobase-ui/src/main/resources/template/css_xhtml/controlheader-core.ftl =================================================================== --- trunk/echobase-ui/src/main/resources/template/css_xhtml/controlheader-core.ftl 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/resources/template/css_xhtml/controlheader-core.ftl 2012-03-27 23:02:51 UTC (rev 420) @@ -26,49 +26,51 @@ This will be done if ActionSupport is used. --> <#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors[parameters.name]??/> -<div <#rt/><#if parameters.id??>id="wwgrp_${parameters.id}"<#rt/></#if> class="wwgrp"> +<div <#rt/><#if parameters.id??>id="wwgrp_${parameters.id}"<#rt/></#if> + class="wwgrp"> <#if hasFieldErrors> -<div <#rt/><#if parameters.id??>id="wwerr_${parameters.id}"<#rt/></#if> class="wwerr"> -<#list fieldErrors[parameters.name] as error> - <div<#rt/> - <#if parameters.id??> - errorFor="${parameters.id}"<#rt/> - </#if> - class="errorMessage"> - ${error?html} - </div><#t/> -</#list> -</div><#t/> + <div <#rt/><#if parameters.id??>id="wwerr_${parameters.id}"<#rt/></#if> + class="wwerr"> + <#list fieldErrors[parameters.name] as error> + <div<#rt/> + <#if parameters.id??> + errorFor="${parameters.id}"<#rt/> + </#if> + class="errorMessage"> + ${error?html} + </div><#t/> + </#list> + </div><#t/> </#if> <#if parameters.label??> -<#if parameters.labelposition?default("top") == 'top'> -<div <#rt/> -<#else> -<span <#rt/> -</#if> -<#if parameters.id??>id="wwlbl_${parameters.id}"<#rt/></#if> class="wwlbl"> - <label <#t/> -<#if parameters.id??> - for="${parameters.id?html}" <#t/> -</#if> -<#if hasFieldErrors> - class="errorLabel"<#t/> -<#else> - class="label"<#t/> -</#if> - ><#t/> + <#if parameters.labelposition?default("top") == 'top'> + <div <#rt/> + <#else> + <span <#rt/> + </#if> + <#if parameters.id??>id="wwlbl_${parameters.id}"<#rt/></#if> class="wwlbl"> + <label <#t/> + <#if parameters.id??> + for="${parameters.id?html}" <#t/> + </#if> + <#if hasFieldErrors> + class="errorLabel"<#t/> + <#else> + class="label"<#t/> + </#if> + ><#t/> - ${parameters.label?html} ${parameters.labelseparator!":"?html} -<#if parameters.required?default(false)> - <span class="required">*</span><#t/> + ${parameters.label?html} ${parameters.labelseparator!":"?html} + <#if parameters.required?default(false)> + <span class="required">*</span><#t/> + </#if> + <#include "/${parameters.templateDir}/xhtml/tooltip.ftl" /> + </label><#t/> + <#if parameters.labelposition?default("top") == 'top'> + </div> <#rt/> + <#else> + </span> <#rt/> + </#if> </#if> -<#include "/${parameters.templateDir}/xhtml/tooltip.ftl" /> - </label><#t/> -<#if parameters.labelposition?default("top") == 'top'> -</div> <#rt/> -<#else> -</span> <#rt/> -</#if> -</#if> Modified: trunk/echobase-ui/src/main/resources/template/simple/myradiomap.ftl =================================================================== --- trunk/echobase-ui/src/main/resources/template/simple/myradiomap.ftl 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/resources/template/simple/myradiomap.ftl 2012-03-27 23:02:51 UTC (rev 420) @@ -47,53 +47,53 @@ <#if parameters.name??> id="${parameters.name?html}_ul"<#rt/> </#if> -> + > <@s.iterator value="parameters.list"> - <#if parameters.listKey??> - <#assign itemKey = stack.findValue(parameters.listKey)/> - <#else> - <#assign itemKey = stack.findValue('top')/> - </#if> - <#assign itemKeyStr = itemKey.toString() /> - <#if parameters.listValue??> - <#assign itemValue = stack.findString(parameters.listValue)/> - <#else> - <#assign itemValue = stack.findString('top')/> - </#if> -<li> -<input type="radio"<#rt/> -<#if parameters.name??> - name="${parameters.name?html}"<#rt/> -</#if> - id="${parameters.id?html}${itemKeyStr?html}"<#rt/> -<#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> - checked="checked"<#rt/> -</#if> -<#if itemKey??> - value="${itemKeyStr?html}"<#rt/> -</#if> -<#if parameters.disabled?default(false)> - disabled="disabled"<#rt/> -</#if> -<#if parameters.tabindex??> - tabindex="${parameters.tabindex?html}"<#rt/> -</#if> -<#if parameters.cssClass??> - class="${parameters.cssClass?html}"<#rt/> -</#if> -<#if parameters.cssStyle??> - style="${parameters.cssStyle?html}"<#rt/> -</#if> -<#include "/${parameters.templateDir}/simple/css.ftl" /> -<#if parameters.title??> - title="${parameters.title?html}"<#rt/> -</#if> -<#include "/${parameters.templateDir}/simple/scripting-events.ftl" /> -<#include "/${parameters.templateDir}/simple/common-attributes.ftl" /> -/><#rt/> -<label for="${parameters.id?html}${itemKeyStr?html}"><#rt/> + <#if parameters.listKey??> + <#assign itemKey = stack.findValue(parameters.listKey)/> + <#else> + <#assign itemKey = stack.findValue('top')/> + </#if> + <#assign itemKeyStr = itemKey.toString() /> + <#if parameters.listValue??> + <#assign itemValue = stack.findString(parameters.listValue)/> + <#else> + <#assign itemValue = stack.findString('top')/> + </#if> + <li> + <input type="radio"<#rt/> + <#if parameters.name??> + name="${parameters.name?html}"<#rt/> + </#if> + id="${parameters.id?html}${itemKeyStr?html}"<#rt/> + <#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> + checked="checked"<#rt/> + </#if> + <#if itemKey??> + value="${itemKeyStr?html}"<#rt/> + </#if> + <#if parameters.disabled?default(false)> + disabled="disabled"<#rt/> + </#if> + <#if parameters.tabindex??> + tabindex="${parameters.tabindex?html}"<#rt/> + </#if> + <#if parameters.cssClass??> + class="${parameters.cssClass?html}"<#rt/> + </#if> + <#if parameters.cssStyle??> + style="${parameters.cssStyle?html}"<#rt/> + </#if> + <#include "/${parameters.templateDir}/simple/css.ftl" /> + <#if parameters.title??> + title="${parameters.title?html}"<#rt/> + </#if> + <#include "/${parameters.templateDir}/simple/scripting-events.ftl" /> + <#include "/${parameters.templateDir}/simple/common-attributes.ftl" /> + /><#rt/> + <label for="${parameters.id?html}${itemKeyStr?html}"><#rt/> ${itemValue}<#t/> -</label> -</li> + </label> + </li> </@s.iterator> </ul> \ No newline at end of file Modified: trunk/echobase-ui/src/main/resources/validators.xml =================================================================== --- trunk/echobase-ui/src/main/resources/validators.xml 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/resources/validators.xml 2012-03-27 23:02:51 UTC (rev 420) @@ -27,24 +27,39 @@ "http://www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd"> <validators> <!-- default validators from XWork framework --> - <validator name="int" class="com.opensymphony.xwork2.validator.validators.IntRangeFieldValidator"/> - <validator name="long" class="com.opensymphony.xwork2.validator.validators.LongRangeFieldValidator"/> - <validator name="short" class="com.opensymphony.xwork2.validator.validators.ShortRangeFieldValidator"/> - <validator name="double" class="com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator"/> - <validator name="date" class="com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator"/> - <validator name="expression" class="com.opensymphony.xwork2.validator.validators.ExpressionValidator"/> - <validator name="fieldexpression" class="com.opensymphony.xwork2.validator.validators.FieldExpressionValidator"/> - <validator name="conversion" class="com.opensymphony.xwork2.validator.validators.ConversionErrorFieldValidator"/> - <validator name="stringlength" class="com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator"/> - <validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/> - <validator name="requiredstring" class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/> + <validator name="int" + class="com.opensymphony.xwork2.validator.validators.IntRangeFieldValidator"/> + <validator name="long" + class="com.opensymphony.xwork2.validator.validators.LongRangeFieldValidator"/> + <validator name="short" + class="com.opensymphony.xwork2.validator.validators.ShortRangeFieldValidator"/> + <validator name="double" + class="com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator"/> + <validator name="date" + class="com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator"/> + <validator name="expression" + class="com.opensymphony.xwork2.validator.validators.ExpressionValidator"/> + <validator name="fieldexpression" + class="com.opensymphony.xwork2.validator.validators.FieldExpressionValidator"/> + <validator name="conversion" + class="com.opensymphony.xwork2.validator.validators.ConversionErrorFieldValidator"/> + <validator name="stringlength" + class="com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator"/> + <validator name="required" + class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/> + <validator name="requiredstring" + class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/> <!-- default nuiton-validator validators --> - <validator name="nfieldexpression" class="org.nuiton.validator.xwork2.field.NuitonFieldExpressionValidator"/> - <validator name="nrequired" class="org.nuiton.validator.xwork2.field.SkipableRequiredFieldValidator"/> - <validator name="nrequiredstring" class="org.nuiton.validator.xwork2.field.SkipableRequiredStringFieldValidator"/> + <validator name="nfieldexpression" + class="org.nuiton.validator.xwork2.field.NuitonFieldExpressionValidator"/> + <validator name="nrequired" + class="org.nuiton.validator.xwork2.field.SkipableRequiredFieldValidator"/> + <validator name="nrequiredstring" + class="org.nuiton.validator.xwork2.field.SkipableRequiredStringFieldValidator"/> <!-- EchoBase validators --> - <validator name="login" class="fr.ifremer.echobase.ui.validators.LoginValidator"/> + <validator name="login" + class="fr.ifremer.echobase.ui.validators.LoginValidator"/> </validators> Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp 2012-03-27 20:35:57 UTC (rev 419) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp 2012-03-27 23:02:51 UTC (rev 420) @@ -24,8 +24,6 @@ <%@page contentType="text/html" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> -<%--script type="text/javascript" - src="<s:url value='/js/gridHelper.js' />"></script--%> <title> Configuration <s:text name="echobase.common.importDataMode.results"/> </title> @@ -79,7 +77,7 @@ <s:submit action="ConfigureResults-modeVoyage" key='echobase.action.import'/> </s:form> -<s:form id="ACOUSTIC_BY_ECHOTYPE" namespace="/importData" method="POST" +<s:form id="ESDU_BY_ECHOTYPE" namespace="/importData" method="POST" enctype="multipart/form-data" cssClass="hidden importMode"> <fieldset> @@ -87,7 +85,7 @@ <s:text name="echobase.legend.importData.configure"/> </legend> - <s:hidden key="model.importMode" value="ACOUSTIC_BY_ECHOTYPE" label=''/> + <s:hidden key="model.importMode" value="ESDU_BY_ECHOTYPE" label=''/> <s:select key="model.voyageId" required="true" label='%{getText("echobase.common.voyage")}' @@ -96,17 +94,16 @@ <s:textfield key="model.resultLabel" size="40" required="true" label='%{getText("echobase.common.resultLabel")}'/> - <s:file key="acousticByEchotypeFile" required="true" - label='%{getText("echobase.common.acousticByEchotypeFile")}'/> + <s:file key="esduByEchotypeFile" required="true" + label='%{getText("echobase.common.esduByEchotypeFile")}'/> </fieldset> <br/> - <s:submit action="ConfigureResults-modeAcousticByEchotype" + <s:submit action="ConfigureResults-modeEsduByEchotype" key='echobase.action.import'/> </s:form> -<s:form id="ACOUSTIC_BY_ECHOTYPE_AND_SPECIES_CATEGORY" namespace="/importData" - method="POST" - enctype="multipart/form-data" cssClass="hidden importMode"> +<s:form id="ESDU_BY_ECHOTYPE_AND_SPECIES_CATEGORY" cssClass="hidden importMode" + namespace="/importData" method="POST" enctype="multipart/form-data"> <fieldset> <legend> @@ -114,7 +111,7 @@ </legend> <s:hidden key="model.importMode" - value="ACOUSTIC_BY_ECHOTYPE_AND_SPECIES_CATEGORY" label=''/> + value="ESDU_BY_ECHOTYPE_AND_SPECIES_CATEGORY" label=''/> <s:select key="model.voyageId" required="true" label='%{getText("echobase.common.voyage")}' @@ -123,17 +120,16 @@ <s:textfield key="model.resultLabel" size="40" required="true" label='%{getText("echobase.common.resultLabel")}'/> - <s:file key="acousticByEchotypeAndSpeciesCategoryFile" required="true" - label='%{getText("echobase.common.acousticByEchotypeAndSpeciesCategoryFile")}'/> + <s:file key="esduByEchotypeAndSpeciesCategoryFile" required="true" + label='%{getText("echobase.common.esduByEchotypeAndSpeciesCategoryFile")}'/> </fieldset> <br/> - <s:submit action="ConfigureResults-modeAcousticByEchotypeAndSpeciesCategory" + <s:submit action="ConfigureResults-modeEsduByEchotypeAndSpeciesCategory" key='echobase.action.import'/> </s:form> -<s:form id="ACOUSTIC_BY_SPECIES_AND_SIZE_CATEGORY" namespace="/importData" - method="POST" - enctype="multipart/form-data" cssClass="hidden importMode"> +<s:form id="ESDU_BY_SPECIES_AND_SIZE_CATEGORY" enctype="multipart/form-data" + namespace="/importData" method="POST" cssClass="hidden importMode"> <fieldset> <legend> @@ -141,7 +137,7 @@ </legend> <s:hidden key="model.importMode" - value="ACOUSTIC_BY_SPECIES_AND_SIZE_CATEGORY" label=''/> + value="ESDU_BY_SPECIES_AND_SIZE_CATEGORY" label=''/> <s:select key="model.voyageId" required="true" label='%{getText("echobase.common.voyage")}' @@ -150,17 +146,16 @@ <s:textfield key="model.resultLabel" size="40" required="true" label='%{getText("echobase.common.resultLabel")}'/> - <s:file key="acousticBySpeciesAndSizeCategoryFile" required="true" - label='%{getText("echobase.common.acousticBySpeciesAndSizeCategoryFile")}'/> + <s:file key="esduBySpeciesAndSizeCategoryFile" required="true" + label='%{getText("echobase.common.esduBySpeciesAndSizeCategoryFile")}'/> </fieldset> <br/> - <s:submit action="ConfigureResults-modeAcousticBySpeciesAndSizeCategory" + <s:submit action="ConfigureResults-modeEsduBySpeciesAndSizeCategory" key='echobase.action.import'/> </s:form> -<s:form id="ACOUSTIC_BY_SPECIES_AND_AGE_CATEGORY" namespace="/importData" - method="POST" - enctype="multipart/form-data" cssClass="hidden importMode"> +<s:form id="ESDU_BY_SPECIES_AND_AGE_CATEGORY" cssClass="hidden importMode" + namespace="/importData" method="POST" enctype="multipart/form-data"> <fieldset> <legend> @@ -168,7 +163,7 @@ </legend> <s:hidden key="model.importMode" - value="ACOUSTIC_BY_SPECIES_AND_AGE_CATEGORY" label=''/> + value="ESDU_BY_SPECIES_AND_AGE_CATEGORY" label=''/> <s:select key="model.voyageId" required="true" label='%{getText("echobase.common.voyage")}' @@ -177,11 +172,11 @@ <s:textfield key="model.resultLabel" size="40" required="true" label='%{getText("echobase.common.resultLabel")}'/> - <s:file key="acousticBySpeciesAndAgeCategoryFile" required="true" - label='%{getText("echobase.common.acousticBySpeciesAndAgeCategoryFile")}'/> + <s:file key="esduBySpeciesAndAgeCategoryFile" required="true" + label='%{getText("echobase.common.esduBySpeciesAndAgeCategoryFile")}'/> </fieldset> <br/> - <s:submit action="ConfigureResults-modeAcousticBySpeciesAndAgeCategory" + <s:submit action="ConfigureResults-modeEsduBySpeciesAndAgeCategory" key='echobase.action.import'/> </s:form>