r370 - in trunk: echobase-services/src/main/java/fr/ifremer/echobase/services/configurations echobase-services/src/main/java/fr/ifremer/echobase/services/csv echobase-services/src/main/java/fr/ifremer/echobase/services/importdata echobase-services/src/main/resources/i18n echobase-services/src/test/java/fr/ifremer/echobase/services/importdata echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData echobase
Author: tchemit Date: 2012-03-19 08:18:36 +0100 (Mon, 19 Mar 2012) New Revision: 370 Url: http://forge.codelutin.com/repositories/revision/echobase/370 Log: prepare last result imports Added: 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/RegionResultImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModelRow.java 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-modeMap-validation.xml Removed: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotypeAndSpecies-validation.xml Modified: 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/RegionCellAssociationImportModelRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportService.java trunk/echobase-services/src/main/resources/i18n/echobase-services_en_GB.properties trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsEsduImportServiceIT.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeRegion-validation.xml trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp Modified: 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-16 18:02:23 UTC (rev 369) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportConfiguration.java 2012-03-19 07:18:36 UTC (rev 370) @@ -54,15 +54,24 @@ /** Acoustic result by echotype import. */ protected final InputFile acousticByEchotypeFile; - /** Acoustic result by echotype and species import. */ - protected final InputFile acousticByEchotypeAndSpeciesFile; + /** Acoustic result by echotype and species category import. */ + protected final InputFile acousticByEchotypeAndSpeciesCategoryFile; /** Region file to import. */ protected final InputFile regionsFile; /** Region cell associations file to import. */ - protected final InputFile associationFile; + 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; @@ -74,9 +83,15 @@ public ResultsImportConfiguration(Locale locale) { regionsFile = InputFile.newFile( - l_(locale, "echobase.common.regionsFile")); - associationFile = InputFile.newFile( - l_(locale, "echobase.common.associationFile")); + 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( @@ -85,8 +100,8 @@ l_(locale, "echobase.common.lengthWeightKeyFile")); acousticByEchotypeFile = InputFile.newFile( l_(locale, "echobase.common.acousticByEchotypeFile")); - acousticByEchotypeAndSpeciesFile = InputFile.newFile( - l_(locale, "echobase.common.acousticByEchotypeAndSpeciesFile")); + acousticByEchotypeAndSpeciesCategoryFile = InputFile.newFile( + l_(locale, "echobase.common.acousticByEchotypeAndSpeciesCategoryFile")); } public String getVoyageId() { @@ -125,10 +140,22 @@ return regionsFile; } - public InputFile getAssociationFile() { - return associationFile; + 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; } @@ -145,15 +172,16 @@ return acousticByEchotypeFile; } - public InputFile getAcousticByEchotypeAndSpeciesFile() { - return acousticByEchotypeAndSpeciesFile; + public InputFile getAcousticByEchotypeAndSpeciesCategoryFile() { + return acousticByEchotypeAndSpeciesCategoryFile; } @Override public InputFile[] getInputFiles() { - return new InputFile[]{regionsFile, associationFile, echotypeFile, + return new InputFile[]{regionsFile, regionAssociationFile, regionResultFile, + mapsFile, mapResultFile, echotypeFile, lengthAgeKeyFile, lengthWeightKeyFile, acousticByEchotypeFile, - acousticByEchotypeAndSpeciesFile}; + acousticByEchotypeAndSpeciesCategoryFile}; } } Modified: 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-16 18:02:23 UTC (rev 369) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportMode.java 2012-03-19 07:18:36 UTC (rev 370) @@ -47,8 +47,8 @@ /** Import acoustic results by echotype. */ ACOUSTIC_BY_ECHOTYPE(n_("echobase.common.resultsImportMode.acoustic.byEchotype")), - /** Import acoustic results by echotype and species. */ - ACOUSTIC_BY_ECHOTYPE_AND_SPECIES(n_("echobase.common.resultsImportMode.acoustic.byEchotypeAndspecies")); + /** Import acoustic results by echotype and species category. */ + ACOUSTIC_BY_ECHOTYPE_AND_SPECIES_CATEGORY(n_("echobase.common.resultsImportMode.acoustic.byEchotypeAndSpeciesCategory")); private final String i18nKey; Added: 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 (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModel.java 2012-03-19 07:18:36 UTC (rev 370) @@ -0,0 +1,42 @@ +/* + * #%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 MapImportModel extends CsvModelUtil.AbstractImportModel<MapImportModelRow> { + + public MapImportModel(char separator) { + super(separator); + } + + @Override + public MapImportModelRow newEmptyInstance() { + return new MapImportModelRow(); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: 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 (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModelRow.java 2012-03-19 07:18:36 UTC (rev 370) @@ -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.csv; + +/** + * TODO + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class MapImportModelRow { +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapImportModelRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: 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 (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModel.java 2012-03-19 07:18:36 UTC (rev 370) @@ -0,0 +1,42 @@ +/* + * #%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 MapResultImportModel extends CsvModelUtil.AbstractImportModel<MapResultImportModelRow> { + + public MapResultImportModel(char separator) { + super(separator); + } + + @Override + public MapResultImportModelRow newEmptyInstance() { + return new MapResultImportModelRow(); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: 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 (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModelRow.java 2012-03-19 07:18:36 UTC (rev 370) @@ -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.csv; + +/** + * TODO + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class MapResultImportModelRow { +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/MapResultImportModelRow.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/csv/RegionCellAssociationImportModelRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellAssociationImportModelRow.java 2012-03-16 18:02:23 UTC (rev 369) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionCellAssociationImportModelRow.java 2012-03-19 07:18:36 UTC (rev 370) @@ -23,6 +23,8 @@ */ package fr.ifremer.echobase.services.csv; +import fr.ifremer.echobase.entities.data.Cell; + /** * Bean used as a row for import of {@link RegionCellAssociationImportModel}. * @@ -31,8 +33,37 @@ */ 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; + } } Added: 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 (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModel.java 2012-03-19 07:18:36 UTC (rev 370) @@ -0,0 +1,42 @@ +/* + * #%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 RegionResultImportModel extends CsvModelUtil.AbstractImportModel<RegionResultImportModelRow> { + + public RegionResultImportModel(char separator) { + super(separator); + } + + @Override + public RegionResultImportModelRow newEmptyInstance() { + return new RegionResultImportModelRow(); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: 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 (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModelRow.java 2012-03-19 07:18:36 UTC (rev 370) @@ -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.csv; + +/** + * TODO + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class RegionResultImportModelRow { +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/RegionResultImportModelRow.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-16 18:02:23 UTC (rev 369) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportService.java 2012-03-19 07:18:36 UTC (rev 370) @@ -65,9 +65,15 @@ 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.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.RegionCellAssociationImportModel; import fr.ifremer.echobase.services.csv.RegionCellAssociationImportModelRow; import fr.ifremer.echobase.services.csv.RegionCellImportModel; +import fr.ifremer.echobase.services.csv.RegionResultImportModel; +import fr.ifremer.echobase.services.csv.RegionResultImportModelRow; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.topia.persistence.TopiaDAO; @@ -178,14 +184,14 @@ } break; - case ACOUSTIC_BY_ECHOTYPE_AND_SPECIES: { + case ACOUSTIC_BY_ECHOTYPE_AND_SPECIES_CATEGORY: { // get selected voyage Voyage voyage = getEntityById(Voyage.class, configuration.getVoyageId()); InputFile inputFile = - configuration.getAcousticByEchotypeAndSpeciesFile(); + configuration.getAcousticByEchotypeAndSpeciesCategoryFile(); if (inputFile.hasFile()) { @@ -199,28 +205,66 @@ } break; - case REGION: + case REGION: { - if (configuration.getRegionsFile().hasFile()) { + // get selected voyage + Voyage voyage = getEntityById(Voyage.class, + configuration.getVoyageId()); + + + InputFile inputFile = configuration.getRegionsFile(); + + if (inputFile.hasFile()) { CsvFileImportResult importResult = importRegionsFile( - configuration.getRegionsFile()); + inputFile, voyage); - addResultAndLog(result, configuration.getRegionsFile(), - importResult, user); + addResultAndLog(result, inputFile, importResult, user); } - if (configuration.getAssociationFile().hasFile()) { + inputFile = configuration.getRegionAssociationFile(); + if (inputFile.hasFile()) { CsvFileImportResult importResult = importRegionAssociationFile( - configuration.getAssociationFile()); + inputFile, voyage); - addResultAndLog(result, configuration.getAssociationFile(), + addResultAndLog(result, inputFile, importResult, user); + } + + inputFile = configuration.getRegionResultFile(); + if (inputFile.hasFile()) { + CsvFileImportResult importResult = importRegionResultFile( + inputFile, voyage, configuration.getResultLabel()); + + addResultAndLog(result, inputFile, importResult, user); + } + } + break; + case MAP: { + + // get selected voyage + Voyage voyage = getEntityById(Voyage.class, + configuration.getVoyageId()); + + InputFile inputFile = configuration.getMapsFile(); + if (inputFile.hasFile()) { + CsvFileImportResult importResult = importMapFile( + inputFile, voyage); + + addResultAndLog(result, inputFile, importResult, user); } - break; + inputFile = configuration.getMapResultFile(); + if (inputFile.hasFile()) { + CsvFileImportResult importResult = importMapResultFile( + inputFile, voyage, configuration.getResultLabel()); + + addResultAndLog(result, inputFile, importResult, user); + } + } + break; } return result; } - protected CsvFileImportResult importRegionsFile(InputFile inputFile) throws ImportException { + protected CsvFileImportResult importRegionsFile(InputFile inputFile, Voyage voyage) throws ImportException { if (log.isInfoEnabled()) { log.info("Starts import of region from file " + @@ -254,12 +298,13 @@ } } - protected CsvFileImportResult importRegionAssociationFile(InputFile inputFile) throws ImportException { + protected CsvFileImportResult importRegionAssociationFile(InputFile inputFile, + Voyage voyage) throws ImportException { RegionCellAssociationImportModel csvModel = new RegionCellAssociationImportModel( serviceContext.getConfiguration().getCsvSeparator()); if (log.isInfoEnabled()) { - log.info("Starts import of region association from file " + + log.info("Starts import of region cell association from file " + inputFile.getFileName()); } @@ -288,6 +333,113 @@ } } + protected CsvFileImportResult importRegionResultFile(InputFile inputFile, + Voyage voyage, + String resultLabel) throws ImportException { + RegionResultImportModel csvModel = new RegionResultImportModel( + serviceContext.getConfiguration().getCsvSeparator()); + + if (log.isInfoEnabled()) { + log.info("Starts import of region cell results from file " + + inputFile.getFileName()); + } + + CsvFileImportResult importResult = new CsvFileImportResult( + inputFile.getFileName()); + + CellDAO dao = getDAO(Cell.class, CellDAO.class); + + Reader reader = getInputFileReader(inputFile); + try { + Import<RegionResultImportModelRow> importer = + EchoBaseImport.newImport(csvModel, reader); + + for (RegionResultImportModelRow row : importer) { + + //TODO + + importResult.incrementsNumberUpdated(EchoBaseEntityEnum.Cell); + } + + return importResult; + } catch (ImportRuntimeException e) { + throw new ImportException(getLocale(), inputFile, e); + } finally { + closeReader(reader, inputFile); + } + } + + protected CsvFileImportResult importMapFile(InputFile inputFile, + Voyage voyage) throws ImportException { + MapImportModel csvModel = new MapImportModel( + serviceContext.getConfiguration().getCsvSeparator()); + + if (log.isInfoEnabled()) { + log.info("Starts import of Map cells from file " + + inputFile.getFileName()); + } + + CsvFileImportResult importResult = new CsvFileImportResult( + inputFile.getFileName()); + + CellDAO dao = getDAO(Cell.class, CellDAO.class); + + Reader reader = getInputFileReader(inputFile); + try { + EchoBaseImport<MapImportModelRow> importer = + EchoBaseImport.newImport(csvModel, reader); + + for (MapImportModelRow row : importer) { + + //TODO + + importResult.incrementsNumberUpdated(EchoBaseEntityEnum.Cell); + } + + return importResult; + } catch (ImportRuntimeException e) { + throw new ImportException(getLocale(), inputFile, e); + } finally { + closeReader(reader, inputFile); + } + } + + protected CsvFileImportResult importMapResultFile(InputFile inputFile, + Voyage voyage, + String resultLabel) throws ImportException { + MapResultImportModel csvModel = new MapResultImportModel( + serviceContext.getConfiguration().getCsvSeparator()); + + if (log.isInfoEnabled()) { + log.info("Starts import of Map cell results from file " + + inputFile.getFileName()); + } + + CsvFileImportResult importResult = new CsvFileImportResult( + inputFile.getFileName()); + + CellDAO dao = getDAO(Cell.class, CellDAO.class); + + Reader reader = getInputFileReader(inputFile); + try { + EchoBaseImport<MapResultImportModelRow> importer = + EchoBaseImport.newImport(csvModel, reader); + + for (MapResultImportModelRow row : importer) { + + //TODO + + importResult.incrementsNumberUpdated(EchoBaseEntityEnum.Cell); + } + + return importResult; + } catch (ImportRuntimeException e) { + throw new ImportException(getLocale(), inputFile, e); + } finally { + closeReader(reader, inputFile); + } + } + protected CsvFileImportResult importLenghtWeightKey(InputFile inputFile, Map<String, Voyage> voyageMap, Map<String, Species> speciesMap) throws ImportException { 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-16 18:02:23 UTC (rev 369) +++ trunk/echobase-services/src/main/resources/i18n/echobase-services_en_GB.properties 2012-03-19 07:18:36 UTC (rev 370) @@ -1,12 +1,16 @@ csv.import.error.missingMandatoryHeaders= csv.import.error.unrecognizedHeaders= -echobase.common.acousticByEchotypeAndSpeciesFile= +echobase.common.acousticByEchotypeAndSpeciesCategoryFile= echobase.common.acousticByEchotypeFile= -echobase.common.associationFile= echobase.common.biometrySampleFile= +echobase.common.cellMapResultFile= +echobase.common.cellMapsFile= echobase.common.cellPositionReference.end= echobase.common.cellPositionReference.mid= echobase.common.cellPositionReference.start= +echobase.common.cellRegionAssociationFile= +echobase.common.cellRegionResultFile= +echobase.common.cellRegionsFile= echobase.common.commonDataImportMode.all= echobase.common.commonDataImportMode.transect= echobase.common.echotypeFile= @@ -22,10 +26,8 @@ echobase.common.moviesFile= echobase.common.operationFile= echobase.common.operationMetadataFile= -echobase.common.regionsFile= -echobase.common.resultsImportMode.acoustic= echobase.common.resultsImportMode.acoustic.byEchotype= -echobase.common.resultsImportMode.acoustic.byEchotypeAndspecies= +echobase.common.resultsImportMode.acoustic.byEchotypeAndSpeciesCategory= 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-16 18:02:23 UTC (rev 369) +++ trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties 2012-03-19 07:18:36 UTC (rev 370) @@ -1,12 +1,16 @@ csv.import.error.missingMandatoryHeaders= csv.import.error.unrecognizedHeaders= -echobase.common.acousticByEchotypeAndSpeciesFile=Fichier d'import +echobase.common.acousticByEchotypeAndSpeciesCategoryFile=Fichier d'import echobase.common.acousticByEchotypeFile=Fichier d'import -echobase.common.associationFile=Fichier d'associations de cellules echobase.common.biometrySampleFile=Fichier BiometrySample +echobase.common.cellMapResultFile=Fichier de résultats de cellules Carte +echobase.common.cellMapsFile=Fichier des cellules Cartes echobase.common.cellPositionReference.end=Fin echobase.common.cellPositionReference.mid=Milieu echobase.common.cellPositionReference.start=Début +echobase.common.cellRegionAssociationFile=Fichier d'associations de cellules Région +echobase.common.cellRegionResultFile=Fichier de résultats de cellules Région +echobase.common.cellRegionsFile=Fichier des cellules Région echobase.common.commonDataImportMode.all=Import Voyage / Transit / Transects echobase.common.commonDataImportMode.transect=Import Transects echobase.common.echotypeFile=Fichier echotype @@ -22,10 +26,9 @@ echobase.common.moviesFile=Fichier Movies echobase.common.operationFile=Fichier Opérations echobase.common.operationMetadataFile=Fichier Méta-données opération -echobase.common.regionsFile=Fichier des régions echobase.common.resultsImportMode.acoustic.byEchotype=Import des résultats acoustiques par echotype -echobase.common.resultsImportMode.acoustic.byEchotypeAndspecies=Import des résultats acoustiques par echotype et espèce -echobase.common.resultsImportMode.map=Import des cellules de type Map +echobase.common.resultsImportMode.acoustic.byEchotypeAndSpeciesCategory=Import des résultats acoustiques par echotype et catégorie d'espèce +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 echobase.common.subSampleFile=Fichier SubSample Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsEsduImportServiceIT.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsEsduImportServiceIT.java 2012-03-16 18:02:23 UTC (rev 369) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/ResultsEsduImportServiceIT.java 2012-03-19 07:18:36 UTC (rev 370) @@ -23,8 +23,6 @@ */ package fr.ifremer.echobase.services.importdata; -import fr.ifremer.echobase.entities.data.Data; -import fr.ifremer.echobase.entities.data.LengthAgeKey; import fr.ifremer.echobase.entities.data.Result; import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration; @@ -100,7 +98,7 @@ conf.setResultLabel("resultLabel"); conf.setVoyageId(getVoyageId()); - conf.setImportMode(ResultsImportMode.ACOUSTIC_BY_ECHOTYPE_AND_SPECIES); + conf.setImportMode(ResultsImportMode.ACOUSTIC_BY_ECHOTYPE_AND_SPECIES_CATEGORY); prepareInputFile(conf.getAcousticByEchotypeFile(), getImportPath("acousticResultByEchotypeAndSpecies.csv")); @@ -116,4 +114,77 @@ assertCsvImportResult(result.get(0), Result.class, NB_ESDU_RESULT_BY_ECHOTYPE_AND_SPECIES); } + @Ignore + @Test + public void doImportRegion() throws Exception { + + //TODO + + assertImportCommonData(); + assertImportOperations(); + assertImportAcousticDatas(); + assertImportVoyageResult(); + + assertNoEntities(Result.class); + + ResultsImportConfiguration conf = + new ResultsImportConfiguration(getLocale()); + + conf.setResultLabel("resultLabel"); + conf.setVoyageId(getVoyageId()); + conf.setImportMode(ResultsImportMode.REGION); + + prepareInputFile(conf.getRegionsFile(), + getImportPath("regions.csv")); + prepareInputFile(conf.getRegionAssociationFile(), + getImportPath("regionAssociations.csv")); + prepareInputFile(conf.getRegionsFile(), + getImportPath("regionResults.csv")); + + + + ResultsImportService service = + getService(ResultsImportService.class); + + List<CsvFileImportResult> result = + service.doImport(conf, createFakeUser()); + + Assert.assertNotNull(result); + Assert.assertEquals(1, result.size()); + assertCsvImportResult(result.get(0), Result.class, NB_ESDU_RESULT_BY_ECHOTYPE_AND_SPECIES); + } + + @Ignore + @Test + public void doImportMap() throws Exception { + + //TODO + + assertImportCommonData(); + assertImportOperations(); + assertImportAcousticDatas(); + assertImportVoyageResult(); + + assertNoEntities(Result.class); + + ResultsImportConfiguration conf = + new ResultsImportConfiguration(getLocale()); + + conf.setResultLabel("resultLabel"); + conf.setVoyageId(getVoyageId()); + conf.setImportMode(ResultsImportMode.MAP); + + prepareInputFile(conf.getAcousticByEchotypeFile(), + getImportPath("acousticResultByEchotypeAndSpecies.csv")); + + ResultsImportService service = + getService(ResultsImportService.class); + + List<CsvFileImportResult> result = + service.doImport(conf, createFakeUser()); + + Assert.assertNotNull(result); + Assert.assertEquals(1, result.size()); + assertCsvImportResult(result.get(0), Result.class, NB_ESDU_RESULT_BY_ECHOTYPE_AND_SPECIES); + } } \ No newline at end of file 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-16 18:02:23 UTC (rev 369) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java 2012-03-19 07:18:36 UTC (rev 370) @@ -95,7 +95,7 @@ } @InputConfig(methodName = "input") - public String modeAcousticByEchotypeAndSpecies() throws Exception { + public String modeAcousticByEchotypeAndSpeciesCategory() throws Exception { return execute(); } @@ -106,6 +106,12 @@ return execute(); } + @InputConfig(methodName = "input") + public String modeMap() throws Exception { + + return execute(); + } + public Map<String, String> getVoyages() { return voyages; } @@ -139,18 +145,54 @@ getModel().getRegionsFile().setFileName(fileName); } - public void setAssociationFile(File file) { - getModel().getAssociationFile().setFile(file); + public void setRegionAssociationFile(File file) { + getModel().getRegionAssociationFile().setFile(file); } - public void setAssociationFileContentType(String contentType) { - getModel().getAssociationFile().setContentType(contentType); + public void setRegionAssociationFileContentType(String contentType) { + getModel().getRegionAssociationFile().setContentType(contentType); } - public void setAssociationFileFileName(String fileName) { - getModel().getAssociationFile().setFileName(fileName); + public void setRegionAssociationFileFileName(String fileName) { + getModel().getRegionAssociationFile().setFileName(fileName); } + public void setRegionResultFile(File file) { + getModel().getRegionResultFile().setFile(file); + } + + public void setRegionResultFileContentType(String contentType) { + getModel().getRegionResultFile().setContentType(contentType); + } + + public void setRegionResultFileFileName(String fileName) { + getModel().getRegionResultFile().setFileName(fileName); + } + + public void setMapsFile(File file) { + getModel().getMapsFile().setFile(file); + } + + public void setMapsFileContentType(String contentType) { + getModel().getMapsFile().setContentType(contentType); + } + + public void setMapsFileFileName(String fileName) { + getModel().getMapsFile().setFileName(fileName); + } + + public void setMapResultFile(File file) { + getModel().getMapResultFile().setFile(file); + } + + public void setMapResultFileContentType(String contentType) { + getModel().getMapResultFile().setContentType(contentType); + } + + public void setMapResultFileFileName(String fileName) { + getModel().getMapResultFile().setFileName(fileName); + } + public void setLengthAgeKeyFile(File file) { getModel().getLengthAgeKeyFile().setFile(file); } @@ -199,16 +241,16 @@ getModel().getAcousticByEchotypeFile().setFileName(fileName); } - public void setAcousticByEchotypeAndSpeciesFile(File file) { - getModel().getAcousticByEchotypeAndSpeciesFile().setFile(file); + public void setAcousticByEchotypeAndSpeciesCategoryFileFile(File file) { + getModel().getAcousticByEchotypeAndSpeciesCategoryFile().setFile(file); } - public void setAcousticByEchotypeAndSpeciesFileContentType(String contentType) { - getModel().getAcousticByEchotypeAndSpeciesFile().setContentType(contentType); + public void setAcousticByEchotypeAndSpeciesCategoryFileContentType(String contentType) { + getModel().getAcousticByEchotypeAndSpeciesCategoryFile().setContentType(contentType); } - public void setAcousticByEchotypeAndSpeciesFileName(String fileName) { - getModel().getAcousticByEchotypeAndSpeciesFile().setFileName(fileName); + public void setAcousticByEchotypeAndSpeciesCategoryFileName(String fileName) { + getModel().getAcousticByEchotypeAndSpeciesCategoryFile().setFileName(fileName); } } Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotypeAndSpecies-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotypeAndSpecies-validation.xml 2012-03-16 18:02:23 UTC (rev 369) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotypeAndSpecies-validation.xml 2012-03-19 07:18:36 UTC (rev 370) @@ -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="resultLabel"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.resultLabel.required"/> - </field-validator> - </field> - - <field name="acousticByEchotypeAndSpeciesFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.acousticByEchotypeAndSpeciesFile.file!=null</param> - <message key="echobase.error.import.acousticByEchotypeAndSpeciesFile.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-modeAcousticByEchotypeAndSpeciesCategory-validation.xml (from rev 369, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotypeAndSpecies-validation.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotypeAndSpeciesCategory-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotypeAndSpeciesCategory-validation.xml 2012-03-19 07:18:36 UTC (rev 370) @@ -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="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 Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcousticByEchotypeAndSpeciesCategory-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeMap-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeMap-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeMap-validation.xml 2012-03-19 07:18:36 UTC (rev 370) @@ -0,0 +1,54 @@ +<!-- + #%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="resultLabel"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.resultLabel.required"/> + </field-validator> + </field> + + <field name="mapsFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.mapsFile.file!=null</param> + <message key="echobase.error.import.mapsFile.required"/> + </field-validator> + </field> + + <field name="mapResultFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.mapResultFile.file!=null</param> + <message key="echobase.error.import.mapResultFile.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-modeMap-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/importData/ConfigureResults-ConfigureResults-modeRegion-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeRegion-validation.xml 2012-03-16 18:02:23 UTC (rev 369) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeRegion-validation.xml 2012-03-19 07:18:36 UTC (rev 370) @@ -31,6 +31,12 @@ </field-validator> </field> + <field name="resultLabel"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.resultLabel.required"/> + </field-validator> + </field> + <field name="regionsFile"> <field-validator type="nfieldexpression"> <param name="expression">model.regionsFile.file!=null</param> @@ -38,11 +44,18 @@ </field-validator> </field> - <field name="associationFile"> + <field name="regionAssociationFile"> <field-validator type="nfieldexpression"> - <param name="expression">model.associationFile.file!=null</param> - <message key="echobase.error.import.associationFile.required"/> + <param name="expression">model.regionAssociationFile.file!=null</param> + <message key="echobase.error.import.regionAssociationFile.required"/> </field-validator> </field> + <field name="regionResultFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.regionResultFile.file!=null</param> + <message key="echobase.error.import.regionResultFile.required"/> + </field-validator> + </field> + </validators> \ No newline at end of file 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-16 18:02:23 UTC (rev 369) +++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-03-19 07:18:36 UTC (rev 370) @@ -83,13 +83,12 @@ 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.acousticByEchotypeAndSpeciesFile.required=La sélection d'un fichier d'import est obligatoire +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.acousticDensityUnit.required=acousticDensityUnit non renseigné echobase.error.import.acquisitionSoftwareVersionER60.required=acquisitionSoftwareVersionER60 non renseigné echobase.error.import.acquisitionSoftwareVersionME70.required=acquisitionSoftwareVersionME70 non renseigné echobase.error.import.areaOfOperation.required=La sélection d'une zone d'opération est obligatoire -echobase.error.import.associationFile.required=La sélection d'un fichier Association est obligatoire echobase.error.import.biometrySampleFile.required=La sélection d'un fichier BiometrySample est obligatoire echobase.error.import.cellPositionReference.required=La sélection d'un cellPositionReference est obligatoire echobase.error.import.datum.required=Datum de la campagne non rengeigné @@ -101,6 +100,8 @@ echobase.error.import.lengthWeightKeyFile.required=La sélection d'un fichier lengthWeightKey est obligatoire echobase.error.import.loggedDataDatatype.required=loggedDataDatatype non renseigné echobase.error.import.loggedDataFormat.required=loggedDataFormat non renseigné +echobase.error.import.mapResultFile.required=La sélection d'un fichier de résultat de Carte est obligatoire +echobase.error.import.mapsFile.required=La sélection d'un fichier Carte est obligatoire echobase.error.import.mission.required=La sélection d'une mission est obligatoire echobase.error.import.missionAbstract.required=Le résumé de la mission est obligatoire echobase.error.import.missionName.required=Le nom de la mission est obligatoire @@ -111,6 +112,8 @@ echobase.error.import.pingDutyCycle.required=pingDutyCycle non renseigné echobase.error.import.processingDescription.required=processingDescription non renseigné echobase.error.import.processingTemplate.required=processingTemplate non renseigné +echobase.error.import.regionAssociationFile.required=La sélection d'un fichier d'association de Région est obligatoire +echobase.error.import.regionResultFile.required=La sélection d'un fichier de résultat de Région est obligatoire echobase.error.import.regionsFile.required=La sélection d'un fichier Region est obligatoire echobase.error.import.resultImportFile.required=Veuillez donner au moins un fichier à importer echobase.error.import.resultLabel.required=Le champs ResultLabel est obligatoire 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-16 18:02:23 UTC (rev 369) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp 2012-03-19 07:18:36 UTC (rev 370) @@ -24,8 +24,8 @@ <%@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> +<%--script type="text/javascript" + src="<s:url value='/js/gridHelper.js' />"></script--%> <title> Configuration <s:text name="echobase.common.importDataMode.results"/> </title> @@ -34,22 +34,16 @@ jQuery(document).ready(function () { + // to change form when mode is changed $('[name="model.importMode"]').change(function (event) { $('[class~="importMode"]').hide(); $('#' + this.value).show(); $('#' + this.value + ' .errorMessage').hide(); }); + // show incoming mode var incomingVal = $('[name="model.importMode"][checked="checked"]').val(); $('#' + incomingVal).show(); - - $.autoSelectVoyageAndVessel( - $('#ACOUSTIC_model_voyageId'), - $('[name="model.vesselId"]'), - '<s:url action="getVesselsForVoyage" namespace="/importData"/>', - '<s:property value="model.voyageId"/>', - '<s:property value="model.vesselId"/>' - ); }); </script> @@ -80,13 +74,12 @@ <s:file key="echotypeFile" required="true" label='%{getText("echobase.common.echotypeFile")}'/> - </fieldset> <br/> <s:submit action="ConfigureResults-modeVoyage" key='echobase.action.import'/> </s:form> -<s:form id="REGION" namespace="/importData" method="POST" +<s:form id="ACOUSTIC_BY_ECHOTYPE" namespace="/importData" method="POST" enctype="multipart/form-data" cssClass="hidden importMode"> <fieldset> @@ -94,24 +87,25 @@ <s:text name="echobase.legend.importData.configure"/> </legend> - <s:hidden key="model.importMode" value="REGION" label=''/> + <s:hidden key="model.importMode" value="ACOUSTIC" label=''/> <s:select key="model.voyageId" required="true" label='%{getText("echobase.common.voyage")}' list="voyages" headerKey="" headerValue=""/> - <s:file key="regionsFile" required="true" - label='%{getText("echobase.common.regionsFile")}'/> + <s:textfield key="model.resultLabel" size="40" required="true" + label='%{getText("echobase.common.resultLabel")}'/> - <s:file key="associationFile" required="true" - label='%{getText("echobase.common.associationFile")}'/> - + <s:file key="acousticByEchotypeFile" required="true" + label='%{getText("echobase.common.acousticByEchotypeFile")}'/> </fieldset> <br/> - <s:submit action="ConfigureResults-modeRegion" key='echobase.action.import'/> + <s:submit action="ConfigureResults-modeAcousticByEchotype" + key='echobase.action.import'/> </s:form> -<s:form id="ACOUSTIC_BY_ECHOTYPE" namespace="/importData" method="POST" +<s:form id="ACOUSTIC_BY_ECHOTYPE_AND_SPECIES_CATEGORY" namespace="/importData" + method="POST" enctype="multipart/form-data" cssClass="hidden importMode"> <fieldset> @@ -128,17 +122,15 @@ <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="acousticByEchotypeAndSpeciesCategoryFile" required="true" + label='%{getText("echobase.common.acousticByEchotypeAndSpeciesCategoryFile")}'/> </fieldset> <br/> - <s:submit action="ConfigureResults-modeAcousticByEchotype" + <s:submit action="ConfigureResults-modeAcousticByEchotypeAndSpeciesCategory" key='echobase.action.import'/> </s:form> -<s:form id="ACOUSTIC_BY_ECHOTYPE_AND_SPECIES" namespace="/importData" - method="POST" +<s:form id="REGION" namespace="/importData" method="POST" enctype="multipart/form-data" cssClass="hidden importMode"> <fieldset> @@ -146,7 +138,7 @@ <s:text name="echobase.legend.importData.configure"/> </legend> - <s:hidden key="model.importMode" value="ACOUSTIC" label=''/> + <s:hidden key="model.importMode" value="REGION" label=''/> <s:select key="model.voyageId" required="true" label='%{getText("echobase.common.voyage")}' @@ -155,11 +147,42 @@ <s:textfield key="model.resultLabel" size="40" required="true" label='%{getText("echobase.common.resultLabel")}'/> - <s:file key="acousticByEchotypeFile" required="true" - label='%{getText("echobase.common.acousticByEchotypeAndSpeciesFile")}'/> + <s:file key="regionsFile" required="true" + label='%{getText("echobase.common.cellRegionsFile")}'/> + <s:file key="regionAssociationFile" required="true" + label='%{getText("echobase.common.cellRegionAssociationFile")}'/> + + <s:file key="regionResultFile" required="true" + label='%{getText("echobase.common.cellRegionResultFile")}'/> </fieldset> <br/> - <s:submit action="ConfigureResults-modeAcousticByEchotypeAndSpecies" - key='echobase.action.import'/> -</s:form> \ No newline at end of file + <s:submit action="ConfigureResults-modeRegion" key='echobase.action.import'/> +</s:form> + +<s:form id="MAP" namespace="/importData" method="POST" + enctype="multipart/form-data" cssClass="hidden importMode"> + + <fieldset> + <legend> + <s:text name="echobase.legend.importData.configure"/> + </legend> + + <s:hidden key="model.importMode" value="REGION" label=''/> + + <s:select key="model.voyageId" required="true" + label='%{getText("echobase.common.voyage")}' + list="voyages" headerKey="" headerValue=""/> + + <s:textfield key="model.resultLabel" size="40" required="true" + label='%{getText("echobase.common.resultLabel")}'/> + + <s:file key="mapsFile" required="true" + label='%{getText("echobase.common.cellMapsFile")}'/> + + <s:file key="mapResultFile" required="true" + label='%{getText("echobase.common.cellMapResultFile")}'/> + </fieldset> + <br/> + <s:submit action="ConfigureResults-modeMap" key='echobase.action.import'/> +</s:form>
participants (1)
-
tchemit@users.forge.codelutin.com