Author: tchemit Date: 2011-12-15 12:02:55 +0100 (Thu, 15 Dec 2011) New Revision: 188 Url: http://forge.codelutin.com/repositories/revision/echobase/188 Log: impacts from catches model Added: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/StrataLoader.java trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderTest.java trunk/echobase-tools/src/test/resources/csv/new/input-Strata.csv Removed: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LocalisationLoader.java trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LocalisationLoaderTest.java trunk/echobase-tools/src/test/resources/csv/new/input-Localisation.csv Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EntityLoader.java trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderTest.java 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 2011-12-15 11:02:33 UTC (rev 187) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EntityLoader.java 2011-12-15 11:02:55 UTC (rev 188) @@ -36,7 +36,7 @@ import fr.ifremer.echobase.entities.meta.TableMeta; import fr.ifremer.echobase.services.CsvImportResult; import fr.ifremer.echobase.services.DbEditorService; -import fr.ifremer.echobase.services.DbImportExportService; +import fr.ifremer.echobase.services.DbImportService; import fr.ifremer.echobase.services.EchoBaseServiceContext; import fr.ifremer.echobase.services.EchoBaseServiceSupport; import fr.ifremer.echobase.services.models.EntityCsvModel; @@ -332,7 +332,7 @@ boolean commit, FileType... fileTypes) throws IOException, TopiaException { - DbImportExportService service = newService(DbImportExportService.class); + DbImportService service = newService(DbImportService.class); for (FileType fileType : fileTypes) { Deleted: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LocalisationLoader.java =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LocalisationLoader.java 2011-12-15 11:02:33 UTC (rev 187) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LocalisationLoader.java 2011-12-15 11:02:55 UTC (rev 188) @@ -1,62 +0,0 @@ -/* - * #%L - * EchoBase :: Tools - * - * $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.tools.loaders; - -import fr.ifremer.echobase.entities.meta.TableMeta; -import fr.ifremer.echobase.entities.references.Localisation; -import fr.ifremer.echobase.services.models.EntityCsvModel; -import fr.ifremer.echobase.tools.FileType; - -/** - * Loader of {@link Localisation}. - * <p/> - * TODO Import it. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class LocalisationLoader extends EntityLoader<Localisation> { - - public LocalisationLoader() { - super(Localisation.class, FileType.NEW); - } - - @Override - protected EntityCsvModel<Localisation> createCsvImportModel(TableMeta meta) { - - EntityCsvModel<Localisation> model = EntityCsvModel.newModel( - getCsvSeparator(), - meta - ); - model.newMandatoryColumn(Localisation.PROPERTY_MAX_LATITUDE); - model.newMandatoryColumn(Localisation.PROPERTY_MIN_LATITUDE); - model.newMandatoryColumn(Localisation.PROPERTY_MAX_LONGITUDE); - model.newMandatoryColumn(Localisation.PROPERTY_MIN_LONGITUDE); - model.newMandatoryColumn(Localisation.PROPERTY_BATHYMETRY); - model.newMandatoryColumn(Localisation.PROPERTY_SEAFLOOR_SUBSTRATE); - return model; - } - - -} \ No newline at end of file Copied: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/StrataLoader.java (from rev 185, trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LocalisationLoader.java) =================================================================== --- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/StrataLoader.java (rev 0) +++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/StrataLoader.java 2011-12-15 11:02:55 UTC (rev 188) @@ -0,0 +1,62 @@ +/* + * #%L + * EchoBase :: Tools + * + * $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.tools.loaders; + +import fr.ifremer.echobase.entities.meta.TableMeta; +import fr.ifremer.echobase.entities.references.Strata; +import fr.ifremer.echobase.services.models.EntityCsvModel; +import fr.ifremer.echobase.tools.FileType; + +/** + * Loader of {@link Strata}. + * <p/> + * TODO Import it. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class StrataLoader extends EntityLoader<Strata> { + + public StrataLoader() { + super(Strata.class, FileType.NEW); + } + + @Override + protected EntityCsvModel<Strata> createCsvImportModel(TableMeta meta) { + + EntityCsvModel<Strata> model = EntityCsvModel.newModel( + getCsvSeparator(), + meta + ); + model.newMandatoryColumn(Strata.PROPERTY_MAX_LATITUDE); + model.newMandatoryColumn(Strata.PROPERTY_MIN_LATITUDE); + model.newMandatoryColumn(Strata.PROPERTY_MAX_LONGITUDE); + model.newMandatoryColumn(Strata.PROPERTY_MIN_LONGITUDE); + model.newMandatoryColumn(Strata.PROPERTY_DEPTH_STRATUM); + model.newMandatoryColumn(Strata.PROPERTY_SEAFLOOR_SUBSTRATE); + return model; + } + + +} \ No newline at end of file Property changes on: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/StrataLoader.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderTest.java =================================================================== --- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderTest.java 2011-12-15 11:02:33 UTC (rev 187) +++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderTest.java 2011-12-15 11:02:55 UTC (rev 188) @@ -349,7 +349,7 @@ entityLoaders.add(newService(CellMethodLoader.class)); entityLoaders.add(newService(DataMetadataLoader.class)); entityLoaders.add(newService(TSParametersLoader.class)); - entityLoaders.add(newService(LocalisationLoader.class)); + entityLoaders.add(newService(StrataLoader.class)); entityLoaders.add(newService(EchotypeCategoryLoader.class)); entityLoaders.add(newService(EchotypeLoader.class)); entityLoaders.add(newService(VesselTypeLoader.class)); Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LocalisationLoaderTest.java =================================================================== --- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LocalisationLoaderTest.java 2011-12-15 11:02:33 UTC (rev 187) +++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LocalisationLoaderTest.java 2011-12-15 11:02:55 UTC (rev 188) @@ -1,46 +0,0 @@ -/* - * #%L - * EchoBase :: Tools - * - * $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.tools.loaders; - -import fr.ifremer.echobase.entities.references.Localisation; -import org.junit.Test; - -/** - * To test the {@link LocalisationLoader}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class LocalisationLoaderTest extends AbstractLoaderTest<Localisation, LocalisationLoader> { - - public LocalisationLoaderTest() { - super(LocalisationLoader.class, 0, 0); - } - - @Test - public void testGenerateNewEntities() throws Exception { - generateNewEntities(); - } - -} Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderTest.java (from rev 185, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LocalisationLoaderTest.java) =================================================================== --- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderTest.java (rev 0) +++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderTest.java 2011-12-15 11:02:55 UTC (rev 188) @@ -0,0 +1,46 @@ +/* + * #%L + * EchoBase :: Tools + * + * $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.tools.loaders; + +import fr.ifremer.echobase.entities.references.Strata; +import org.junit.Test; + +/** + * To test the {@link StrataLoader}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class StrataLoaderTest extends AbstractLoaderTest<Strata, StrataLoader> { + + public StrataLoaderTest() { + super(StrataLoader.class, 0, 0); + } + + @Test + public void testGenerateNewEntities() throws Exception { + generateNewEntities(); + } + +} Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-tools/src/test/resources/csv/new/input-Localisation.csv =================================================================== --- trunk/echobase-tools/src/test/resources/csv/new/input-Localisation.csv 2011-12-15 11:02:33 UTC (rev 187) +++ trunk/echobase-tools/src/test/resources/csv/new/input-Localisation.csv 2011-12-15 11:02:55 UTC (rev 188) @@ -1 +0,0 @@ -maxLatitude;minLatitude;maxLongitude;minLongitude;seafloorSubstrate;bathymetre \ No newline at end of file Copied: trunk/echobase-tools/src/test/resources/csv/new/input-Strata.csv (from rev 185, trunk/echobase-tools/src/test/resources/csv/new/input-Localisation.csv) =================================================================== --- trunk/echobase-tools/src/test/resources/csv/new/input-Strata.csv (rev 0) +++ trunk/echobase-tools/src/test/resources/csv/new/input-Strata.csv 2011-12-15 11:02:55 UTC (rev 188) @@ -0,0 +1 @@ +maxLatitude;minLatitude;maxLongitude;minLongitude;seafloorSubstrate;depthStratum \ No newline at end of file Property changes on: trunk/echobase-tools/src/test/resources/csv/new/input-Strata.csv ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native