Author: tchemit Date: 2012-03-30 18:46:14 +0200 (Fri, 30 Mar 2012) New Revision: 460 Url: http://forge.codelutin.com/repositories/revision/echobase/460 Log: fixes #1054: Mettre un champs de description de l'import et l'inclure dans le journal des modifications + uniformisation des noms d'imports + refs #1016 (css) Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportMode.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportMode.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportRow.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticImportServiceIT.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesImportServiceIT.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/Common2ImportServiceIT.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonImportServiceIT.java trunk/echobase-services/src/test/resources/import-data/acoustic/ trunk/echobase-services/src/test/resources/import-data/catches/ trunk/echobase-services/src/test/resources/import-data/common/ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesImport.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonImport.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperationImport.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResultsImport.java trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeAll-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeTransect-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeEsdu-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeMap-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeRegion-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeVoyage-validation.xml trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperationImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResultsImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAcousticImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperationImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResultsImport.jsp Removed: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.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/CatchesDataImportConfiguration.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/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/CommonDataImportService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportDataMode.java 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/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/resources/import-data/acousticData/ trunk/echobase-services/src/test/resources/import-data/catchesData/ trunk/echobase-services/src/test/resources/import-data/commonData/ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.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/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsdu-validation.xml 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-modeRegion-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticData.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportConfiguration.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/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/importdata/AbstractImportDataServiceIT.java trunk/echobase-services/src/test/resources/log4j.properties trunk/echobase-services/update-import-data-db.sh trunk/echobase-ui/pom.xml 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/CreateMission.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectImportType.java trunk/echobase-ui/src/main/resources/config/struts-importData.xml trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties trunk/echobase-ui/src/main/resources/struts.xml trunk/echobase-ui/src/main/webapp/WEB-INF/includes/importDataResults.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/selectImportType.jsp trunk/echobase-ui/src/main/webapp/css/screen.css Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportConfiguration.java 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460) @@ -23,11 +23,16 @@ */ package fr.ifremer.echobase.services.importdata; +import com.google.common.collect.Lists; import fr.ifremer.echobase.EchoBaseIOUtil; import fr.ifremer.echobase.InputFile; +import fr.ifremer.echobase.csv.CsvFileImportResult; +import fr.ifremer.echobase.entities.EchoBaseEntityEnum; import fr.ifremer.echobase.services.AbstractEchobaseActionConfiguration; import java.io.File; +import java.util.List; +import java.util.Set; /** * Common import data configuration. @@ -39,8 +44,16 @@ private static final long serialVersionUID = 1L; + /** Directory where to store temporary files. */ protected File workingDirectory; + /** Notes about this import to add in log book. */ + protected String importNotes; + + /** Result stats for each file imported. (mainly kept for testing purpose). */ + protected final List<CsvFileImportResult> importResults = + Lists.newArrayList(); + public File getWorkingDirectory() { return workingDirectory; } @@ -49,8 +62,22 @@ this.workingDirectory = workingDirectory; } + public String getImportNotes() { + return importNotes; + } + + public void setImportNotes(String importNotes) { + this.importNotes = importNotes; + } + + public List<CsvFileImportResult> getImportResults() { + return importResults; + } + + /** @return all the input files defined for the import (some can be empty). */ public abstract InputFile[] getInputFiles(); + /** @return the number of lines to imports from all the import files. */ public long computeNbSteps() { long result = 0; for (InputFile inputFile : getInputFiles()) { @@ -64,4 +91,11 @@ setNbSteps(result); return result; } + + public void addResult(CsvFileImportResult fileResult) { + Set<EchoBaseEntityEnum> entityTypes = fileResult.getEntityTypes(); + if (!entityTypes.isEmpty()) { + importResults.add(fileResult); + } + } } 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AbstractImportDataService.java 2012-03-30 16:46:14 UTC (rev 460) @@ -51,11 +51,13 @@ import fr.ifremer.echobase.entities.references.SpeciesCategoryDAO; import fr.ifremer.echobase.services.EchoBaseServiceSupport; import fr.ifremer.echobase.services.ImportException; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.topia.TopiaException; import org.nuiton.topia.persistence.TopiaDAO; import org.nuiton.topia.persistence.TopiaEntity; +import org.nuiton.util.StringUtil; import org.nuiton.util.TimeLog; import org.nuiton.util.csv.ImportRuntimeException; @@ -68,7 +70,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -93,8 +94,8 @@ new TimeLog(AbstractImportDataService.class); - public final List<CsvFileImportResult> doImport(M configuration, - EchoBaseUser user) throws ImportException { + public final String doImport(M configuration, + EchoBaseUser user) throws ImportException { long s0 = TimeLog.getTime(); @@ -107,67 +108,79 @@ TIME_LOG.log(s0, "computeNbSteps"); try { - List<CsvFileImportResult> result = startImport(configuration, user); + startImport(configuration, user); + // add result in log book and compute resume to show in result + String result = computeResultAndLogBookEntry(configuration, + user, + TimeLog.getTime() - s0); + // do commit commitTransaction("Could not execute import " + getImportLabel()); return result; } catch (ImportException e) { throw e; - } catch (Exception e) { - throw new ImportException( - "Could not do import " + e.getMessage(), e); + } catch (EchoBaseTechnicalException e) { + throw new ImportException(e.getMessage(), e); } } - protected abstract String getImportLabel(); + protected String computeResultAndLogBookEntry(M configuration, + EchoBaseUser user, + long time) { - protected abstract List<CsvFileImportResult> startImport(M configuration, - EchoBaseUser user) throws ImportException; + String importType = getImportLabel(); - protected void addResultAndLog(List<CsvFileImportResult> result, - InputFile inputFile, - CsvFileImportResult importResult, - EchoBaseUser user) { + StringBuilder buffer = new StringBuilder(); - Set<EchoBaseEntityEnum> entityTypes = importResult.getEntityTypes(); - if (!entityTypes.isEmpty()) { + buffer.append(importType); + if (StringUtils.isNotEmpty(configuration.getImportNotes())) { + buffer.append("\nNotes :").append(configuration.getImportNotes()); + } + buffer.append('\n'); + buffer.append("Import réalisé en "); + buffer.append(StringUtil.convertTime(time)); - result.add(importResult); + for (CsvFileImportResult importResult : configuration.getImportResults()) { - String importType = getImportLabel(); - StringBuilder description = new StringBuilder(); - description.append("Depuis Fichier ").append(inputFile.getFileName()); - TopiaDAO<EntityModificationLog> dao = - getDAO(EntityModificationLog.class); + description.append("Depuis Fichier ").append(importResult.getImportFileName()); - for (EchoBaseEntityEnum entityType : entityTypes) { + for (EchoBaseEntityEnum entityType : importResult.getEntityTypes()) { int numberCreated = importResult.getNumberCreated(entityType); int numberUpdated = importResult.getNumberUpdated(entityType); + description.append("\n\tEntité ").append(entityType); if (numberCreated > 0) { - description.append(" [ nombre de création : "); + description.append(" [nombre de création : "); description.append(numberCreated); description.append("]"); } if (numberUpdated > 0) { - description.append(" [ nombre de mises à jour : "); + description.append(" [nombre de mises à jour : "); description.append(numberUpdated); description.append("]"); } - - create(dao, - EntityModificationLog.PROPERTY_ENTITY_TYPE, entityType.name(), - EntityModificationLog.PROPERTY_ENTITY_ID, importType, - EntityModificationLog.PROPERTY_MODIFICATION_USER, user.getEmail(), - EntityModificationLog.PROPERTY_MODIFICATION_DATE, newDate(), - EntityModificationLog.PROPERTY_MODIFICATION_TEXT, description.toString() - ); } + buffer.append('\n').append(description.toString()); + } - } + String result = buffer.toString(); + + create(getDAO(EntityModificationLog.class), + EntityModificationLog.PROPERTY_ENTITY_TYPE, "Import", + EntityModificationLog.PROPERTY_ENTITY_ID, importType, + EntityModificationLog.PROPERTY_MODIFICATION_USER, user.getEmail(), + EntityModificationLog.PROPERTY_MODIFICATION_DATE, newDate(), + EntityModificationLog.PROPERTY_MODIFICATION_TEXT, result + ); + return result; } + protected abstract String getImportLabel(); + + protected abstract void startImport(M configuration, + EchoBaseUser user) throws ImportException; + protected Reader getInputFileReader(InputFile inputFile) throws EchoBaseTechnicalException { try { Reader reader = new BufferedReader(new InputStreamReader( Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460) @@ -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.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}; - } -} Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportService.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,743 +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.importdata; - -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; -import fr.ifremer.echobase.EchoBaseFunctions; -import fr.ifremer.echobase.EchoBasePredicates; -import fr.ifremer.echobase.InputFile; -import fr.ifremer.echobase.csv.CsvFileImportResult; -import fr.ifremer.echobase.csv.EchoBaseImport; -import fr.ifremer.echobase.csv.EchobaseCsvUtil; -import fr.ifremer.echobase.entities.EchoBaseEntityEnum; -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.DataAcquisition; -import fr.ifremer.echobase.entities.data.DataAcquisitionDAO; -import fr.ifremer.echobase.entities.data.DataDAO; -import fr.ifremer.echobase.entities.data.DataProcessing; -import fr.ifremer.echobase.entities.data.DataProcessingDAO; -import fr.ifremer.echobase.entities.data.Transect; -import fr.ifremer.echobase.entities.data.Transit; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.AcousticInstrument; -import fr.ifremer.echobase.entities.references.CellType; -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.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; -import org.nuiton.util.csv.Import; -import org.nuiton.util.csv.ImportRuntimeException; - -import java.io.Reader; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -import static org.nuiton.i18n.I18n.l_; - -/** - * Service to launch a "acoustic data" import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class AcousticDataImportService extends AbstractImportDataService<AcousticDataImportConfiguration> { - - /** Logger. */ - private static final Log log = - LogFactory.getLog(AcousticDataImportService.class); - - @Override - protected String getImportLabel() { - return l_(getLocale(), ImportDataMode.AccousticData.getI18nKey()); - } - - @Override - protected List<CsvFileImportResult> startImport( - AcousticDataImportConfiguration configuration, - EchoBaseUser user) throws ImportException { - - List<CsvFileImportResult> result = Lists.newLinkedList(); - - // get selected voyage - Voyage voyage = getEntityById(Voyage.class, - configuration.getVoyageId()); - - // get selected vessel - Vessel vessel = getEntityById(Vessel.class, - configuration.getVesselId()); - - CellType esduCellType = getEntityByProperty( - CellType.class, CellType.PROPERTY_ID, "Esdu"); - Preconditions.checkNotNull(esduCellType); - - CellType elementaryCellType = getEntityByProperty( - CellType.class, CellType.PROPERTY_ID, "Elementary"); - Preconditions.checkNotNull(elementaryCellType); - - InputFile inputFile = configuration.getMoviesFile(); - - CsvFileImportResult importResult = importMoviesFile(configuration, - voyage, - vessel, - esduCellType, - elementaryCellType, - inputFile); - - addResultAndLog(result, inputFile, importResult, user); - return result; - } - - private final DateFormat cellDateFormat = new SimpleDateFormat( - EchobaseCsvUtil.CELLULE_DATE_FORMAT); - - - private DataAcquisition getDataAcquisition(Transect transect, - AcousticInstrument instrument, - boolean addDataAcquisition) throws ImportException { - - - DataAcquisition result = null; - if (!addDataAcquisition && - !transect.isDataAcquisitionEmpty()) { - - // try to obtain an existing data acquisiton - - for (DataAcquisition acquisition : transect.getDataAcquisition()) { - - if (instrument.equals(acquisition.getAcousticInstrument())) { - - // found a matching dataAcquisition from his acoustic instrument - result = acquisition; - break; - } - } - } - return result; - } - - private CsvFileImportResult importMoviesFile(AcousticDataImportConfiguration configuration, - Voyage voyage, - Vessel vessel, - CellType esduCellType, - CellType elementaryCellType, - InputFile inputFile - ) throws ImportException { - - CsvFileImportResult importResult = new CsvFileImportResult( - inputFile.getFileName()); - - Map<String, AcousticInstrument> instrumentsById = - getEntitiesMap(AcousticInstrument.class, - EchoBaseFunctions.ACOUSTIC_INSTRUMENT_ID); - - Map<String, DataMetadata> dataMetadatasByName = getEntitiesMap( - DataMetadata.class, EchoBaseFunctions.DATA_METADATA_NAME); - - AcousticDataImportModel csvModel = new AcousticDataImportModel( - getCsvSeparator(), instrumentsById); - - DataAcquisitionDAO dataAcquisitionDAO = - getDAO(DataAcquisition.class, DataAcquisitionDAO.class); - DataProcessingDAO dataProcessingDAO = - getDAO(DataProcessing.class, DataProcessingDAO.class); - CellDAO cellDAO = getDAO(Cell.class, CellDAO.class); - DataDAO dataDAO = getDAO(Data.class, DataDAO.class); - - boolean addDataAcquisition = configuration.isAddDataAcquisition(); - - String suffix = - configuration.getCellPositionReference().getMetadataNameSuffix(); - - List<Cell> elementaryCells = Lists.newArrayList(); - - Reader reader = getInputFileReader(inputFile); - Locale locale = getLocale(); - String dataProcessingId = null; - try { - Import<AcousticDataImportRow> importer = - EchoBaseImport.newImport(csvModel, reader); - DataAcquisition dataAcquisition = null; - DataProcessing dataProcessing = null; - - Cell elementaryCell; - int rowNumber = 0; - - configuration.incrementsProgression(); - for (AcousticDataImportRow row : importer) { - - configuration.incrementsProgression(); - rowNumber++; - - if (rowNumber % 100 == 0) { - if (log.isInfoEnabled()) { - log.info("Doing line " + rowNumber); - } - } - if (dataProcessingId == null) { - - // compute once for all the common dataprocessing id used - // for hole the movies file - dataProcessingId = row.getEiLayer() + - configuration.getProcessingTemplate(); - } - - Date startDate = row.getCellDateStart(); - - // get transect to use - Transit transit = voyage.getTransit(startDate); - if (transit == null) { - - // can not find correct transit - throw new ImportException( - l_(locale, "echobase.importError.transit.notfound", - voyage.getName(), - startDate, - rowNumber)); - } - - Transect transect = transit.getTransect(vessel); - if (transect == null) { - - // can not find correct transect - throw new ImportException( - l_(locale, "echobase.importError.transect.notfound", - voyage.getName(), - startDate, - vessel.getName(), - rowNumber)); - } - - AcousticInstrument instrument = row.getAcousticInstrument(); - boolean isME70 = - EchoBasePredicates.IS_ACOUSTIC_INSTRUMENT_ME70.apply(instrument); - - if (dataAcquisition == null || - !instrument.equals(dataAcquisition.getAcousticInstrument())) { - - // need to use another data acquisition - - if (log.isDebugEnabled()) { - log.debug("[row " + rowNumber + "] New instrument to use (" + instrument.getId() + ")"); - } - - if (CollectionUtils.isNotEmpty(elementaryCells)) { - - // means miss a esdu cell - // can not find correct transect - throw new ImportException( - l_(locale, "echobase.importError.esduCell.notfound", - voyage.getName(), - vessel.getName(), - instrument.getId(), - rowNumber)); - } - - String softwareVersion = - getSoftwareVersion(configuration, isME70); - - String soundSpeedCalculations = - getSoundSpeedCalculations(configuration, isME70); - - // try to get existing data acquisition - dataAcquisition = getDataAcquisition( - transect, - instrument, - addDataAcquisition - ); - - if (dataAcquisition == null) { - - // need to create the data acquisition - dataAcquisition = createDataAcquisition( - configuration, - instrument, - softwareVersion, - soundSpeedCalculations, - row, - dataAcquisitionDAO - ); - - // add dataAcquisition to transect - transect.addDataAcquisition(dataAcquisition); - - // count creation in result - importResult.incrementsNumberCreated(EchoBaseEntityEnum.DataAcquisition); - - if (log.isDebugEnabled()) { - log.debug("[row " + rowNumber + - "] New dataAquisition to use (number: " + - importResult.getNumberCreated( - EchoBaseEntityEnum.DataAcquisition) + ")"); - } - - // create data processing - dataProcessing = createDataProcessing( - configuration, - dataProcessingId, - softwareVersion, - soundSpeedCalculations, - row, - dataProcessingDAO - ); - - if (log.isDebugEnabled()) { - log.debug("[row " + rowNumber + - "] New dataProcessing to use (" + - dataProcessing.getId() + ")"); - } - - importResult.incrementsNumberCreated( - EchoBaseEntityEnum.DataProcessing); - - // add it to data acquisition - dataAcquisition.addDataProcessing(dataProcessing); - } - } - - if (!row.isCellToAdd()) { - - // dead cell not to be imported - if (log.isWarnEnabled()) { - log.warn("Will not import cell of row " + rowNumber); - } - continue; - } - - int cellType = row.getCellType(); - - String esduCellId = cellDateFormat.format(startDate); - - if (cellType == 4) { - - if (log.isDebugEnabled()) { - log.debug("[row " + rowNumber + "] Esdu cell (" + - esduCellId + ")"); - } - - // this is a esdu cell row - - // create esdu cell - Cell esduCell = create(cellDAO, - Cell.PROPERTY_CELL_TYPE, esduCellType, - Cell.PROPERTY_NAME, esduCellId - ); - - // add all found elementary cells - esduCell.addAllChilds(elementaryCells); - - // clear elementary cells - elementaryCells.clear(); - - importResult.incrementsNumberCreated(EchoBaseEntityEnum.Cell); - - // add it to data processing - dataProcessing.addCell(esduCell); - - // create esdu cell data - createEsduCellData(suffix, - esduCell, - dataMetadatasByName, - row, - dataDAO, - importResult); - } else { - - // this is a elementary cell row - - int cellNum = row.getCellNum(); - - boolean surface = cellType == 0; - - String elementaryCellId = cellNum + (surface ? "S" : "B"); - - if (log.isDebugEnabled()) { - log.debug("[row " + rowNumber + "] elementary cell (" + - elementaryCellId + ")"); - } - - // create the elementary cell - elementaryCell = create(cellDAO, - Cell.PROPERTY_CELL_TYPE, elementaryCellType, - Cell.PROPERTY_NAME, elementaryCellId - ); - - // keep (to attach them to esdu cell) - elementaryCells.add(elementaryCell); - - importResult.incrementsNumberCreated(EchoBaseEntityEnum.Cell); - - // create datas of the elementary cell - createElementaryCellData(suffix, - elementaryCell, - dataMetadatasByName, - surface, - row, - dataDAO, - importResult); - } - } - - return importResult; - } catch (ImportRuntimeException e) { - throw new ImportException(locale, inputFile, e); - } finally { - closeReader(reader, inputFile); - } - } - - protected void createEsduCellData(String suffix, - Cell cell, - Map<String, DataMetadata> dataMetadatas, - AcousticDataImportRow row, - DataDAO dao, - CsvFileImportResult importResult) { - - String dataValue; - - // create Latitude data - dataValue = String.valueOf(row.getCellLatitude()); - createCellData(dao, cell, dataMetadatas, "Latitude" + suffix, - dataValue, importResult); - - // create Longitude data - dataValue = String.valueOf(row.getCellLongitude()); - createCellData(dao, cell, dataMetadatas, "Longitude" + suffix, - dataValue, importResult); - - // create Depth data - dataValue = row.getEsduCellDataDepth(); - createCellData(dao, cell, dataMetadatas, "DepthRefSurface" + suffix, - dataValue, importResult); - - // create Time Start data - dataValue = cellDateFormat.format(row.getCellDateStart()); - createCellData(dao, cell, dataMetadatas, "TimeStart", - dataValue, importResult); - - // create Time end data - dataValue = cellDateFormat.format(row.getCellDateEnd()); - createCellData(dao, cell, dataMetadatas, "TimeEnd", - dataValue, importResult); - - // create NASC data - if (row.getCellNasc() != null) { - dataValue = String.valueOf(row.getCellNasc()); - createCellData(dao, cell, dataMetadatas, "NASC", - dataValue, importResult); - } - - // create Volume data - if (row.getCellVolume() != null) { - dataValue = String.valueOf(row.getCellVolume()); - createCellData(dao, cell, dataMetadatas, "Volume ", - dataValue, importResult); - } - // create Surface data - dataValue = String.valueOf(row.getCellSurface()); - createCellData(dao, cell, dataMetadatas, "Surface", - dataValue, importResult); - - // create NumberOfSamplesRecorded data - if (row.getCellNumberOfSamplesRecorded() != null) { - dataValue = String.valueOf(row.getCellNumberOfSamplesRecorded()); - createCellData(dao, cell, dataMetadatas, "NumberOfSamplesRecorded", - dataValue, importResult); - } - // create NumberOfSamplesEchoIntegrated data - if (row.getCellNumberOfSamplesEchoIntegrated() != null) { - dataValue = String.valueOf(row.getCellNumberOfSamplesEchoIntegrated()); - createCellData(dao, cell, dataMetadatas, "NumberOfSamplesEchoIntegrated", - dataValue, importResult); - } - } - - private void createElementaryCellData(String suffix, - Cell cell, - Map<String, DataMetadata> dataMetadatas, - boolean surface, - AcousticDataImportRow row, - DataDAO dao, - CsvFileImportResult importResult) { - - String dataValue; - String startMeta; - String endMeta; - - if (surface) { - - // surface - - startMeta = "DepthRefSurfaceStart"; - endMeta = "DepthRefSurfaceEnd"; - - } else { - - // bottom - - startMeta = "DepthRefBottomStart"; - endMeta = "DepthRefBottomEnd"; - } - - // create Latitude data - dataValue = String.valueOf(row.getCellLatitude()); - createCellData(dao, cell, dataMetadatas, "Latitude" + suffix, - dataValue, importResult); - - // create Longitude data - dataValue = String.valueOf(row.getCellLongitude()); - createCellData(dao, cell, dataMetadatas, "Longitude" + suffix, - dataValue, importResult); - - // create depth start data - dataValue = String.valueOf(row.getCellDepthStart()); - createCellData(dao, cell, dataMetadatas, startMeta, dataValue, importResult); - - // create depth end data - dataValue = String.valueOf(row.getCellDepthEnd()); - createCellData(dao, cell, dataMetadatas, endMeta, dataValue, importResult); - - - // create Time Start data - dataValue = cellDateFormat.format(row.getCellDateStart()); - createCellData(dao, cell, dataMetadatas, "TimeStart", - dataValue, importResult); - - // create Time end data - dataValue = cellDateFormat.format(row.getCellDateEnd()); - createCellData(dao, cell, dataMetadatas, "TimeEnd", - dataValue, importResult); - - // create acoustic density data - if (row.getCellNasc() != null) { - dataValue = String.valueOf(row.getCellNasc()); - createCellData(dao, cell, dataMetadatas, "NASC", dataValue, importResult); - } - // create Volume data - if (row.getCellVolume() != null) { - dataValue = String.valueOf(row.getCellVolume()); - createCellData(dao, cell, dataMetadatas, "Volume ", - dataValue, importResult); - } - // create Surface data - dataValue = String.valueOf(row.getCellSurface()); - createCellData(dao, cell, dataMetadatas, "Surface", - dataValue, importResult); - - // create NumberOfSamplesRecorded data - if (row.getCellNumberOfSamplesRecorded() != null) { - dataValue = String.valueOf(row.getCellNumberOfSamplesRecorded()); - createCellData(dao, cell, dataMetadatas, "NumberOfSamplesRecorded", - dataValue, importResult); - } - // create NumberOfSamplesEchoIntegrated data - if (row.getCellNumberOfSamplesEchoIntegrated() != null) { - dataValue = String.valueOf(row.getCellNumberOfSamplesEchoIntegrated()); - createCellData(dao, cell, dataMetadatas, "NumberOfSamplesEchoIntegrated", - dataValue, importResult); - } - } - - private DataAcquisition createDataAcquisition(AcousticDataImportConfiguration configuration, - AcousticInstrument instrument, - String softwareVersion, - String soundSpeedCalculations, - AcousticDataImportRow row, - DataAcquisitionDAO dataAcquisitionDAO) { - - String transceiverAcquisitionAbsorptionDescription = - configuration.getTransceiverAcquisitionAbsorptionDescription(); - String loggedDataFormat = configuration.getLoggedDataFormat(); - String loggedDataDatatype = configuration.getLoggedDataDatatype(); - String pingDutyCycle = configuration.getPingDutyCycle(); - - DataAcquisition dataAcquisition = create( - dataAcquisitionDAO, - DataAcquisition.PROPERTY_ACOUSTIC_INSTRUMENT, instrument - ); - - // fill from manual configuration -// dataAcquisition.setAcousticInstrument(instrument); - dataAcquisition.setTransceiverAcquisitionAbsorptionDescription(transceiverAcquisitionAbsorptionDescription); - dataAcquisition.setAcquisitionSoftwareVersion(softwareVersion); - dataAcquisition.setLoggedDataFormat(loggedDataFormat); - dataAcquisition.setLoggedDataDatatype(loggedDataDatatype); - dataAcquisition.setPingDutyCycle(pingDutyCycle); - dataAcquisition.setEchosounderSoundSpeed(row.getSoundCelerity()); - dataAcquisition.setSoundSpeedCalculations(soundSpeedCalculations); - - // fill from csv file - Float transceiverAcquisitionAbsorption = - row.getTransceiverAcquisitionAbsorption(); - Float transducerAcquisitionBeamAngleAthwartship = - row.getTransducerAcquisitionBeamAngleAthwartship(); - Float transducerAcquisitionBeamAngleAlongship = - row.getTransducerAcquisitionBeamAngleAlongship(); - Float transducerAcquisitionPsi = - row.getTransducerAcquisitionPsi(); - Float transceiverAcquisitionPower = - row.getTransceiverAcquisitionPower(); - Float transceiverAcquisitionPulseLength = - row.getTransceiverAcquisitionPulseLength(); - Float transceiverAcquisitionGain = - row.getTransceiverAcquisitionGain(); - Float transceiverAcquisitionSacorrection = - row.getTransceiverAcquisitionSacorrection(); - - dataAcquisition.setTransceiverAcquisitionAbsorption(transceiverAcquisitionAbsorption); - dataAcquisition.setTransducerAcquisitionBeamAngleAthwartship(transducerAcquisitionBeamAngleAthwartship); - dataAcquisition.setTransducerAcquisitionBeamAngleAlongship(transducerAcquisitionBeamAngleAlongship); - dataAcquisition.setTransducerAcquisitionPsi(transducerAcquisitionPsi); - dataAcquisition.setTransceiverAcquisitionPower(transceiverAcquisitionPower); - dataAcquisition.setTransceiverAcquisitionPulseLength(transceiverAcquisitionPulseLength); - dataAcquisition.setTransceiverAcquisitionGain(transceiverAcquisitionGain); - dataAcquisition.setTransceiverAcquisitionSacorrection(transceiverAcquisitionSacorrection); - - return dataAcquisition; - } - - private DataProcessing createDataProcessing(AcousticDataImportConfiguration configuration, - String id, - String softwareVersion, - String soundSpeedCalculations, - AcousticDataImportRow row, - DataProcessingDAO dataProcessingDAO) { - - String transceiverAcquisitionAbsorptionDescription = - configuration.getTransceiverAcquisitionAbsorptionDescription(); - String processingTemplate = configuration.getProcessingTemplate(); - String processingDescription = configuration.getProcessingDescription(); - String sounderConstant = configuration.getSounderConstant(); - float digitThreshold = configuration.getDigitThreshold(); - String acousticDensityUnit = configuration.getAcousticDensityUnit(); - String notes = configuration.getNotes(); - - DataProcessing dataProcessing = create( - dataProcessingDAO, - DataProcessing.PROPERTY_ID, id, - DataProcessing.PROPERTY_PROCESSING_TEMPLATE, processingTemplate - ); - - // fill from manual configuration -// dataProcessing.setId(id); -// dataProcessing.setProcessingTemplate(processingTemplate); - dataProcessing.setProcessingDescription(processingDescription); - dataProcessing.setSounderConstant(sounderConstant); - dataProcessing.setDigitThreshold(digitThreshold); - dataProcessing.setAcousticDensityUnit(acousticDensityUnit); - dataProcessing.setNotes(notes); - dataProcessing.setProcessingSoftwareVersion(softwareVersion); - dataProcessing.setTransceiverProcessingAbsorptionDescription(transceiverAcquisitionAbsorptionDescription); - dataProcessing.setEchosounderSoundSpeed(row.getSoundCelerity()); - dataProcessing.setSoundSpeedCalculations(soundSpeedCalculations); - - // fill from csv file - - Float transceiverAcquisitionAbsorption = - row.getTransceiverAcquisitionAbsorption(); - Float transducerAcquisitionBeamAngleAthwartship = - row.getTransducerAcquisitionBeamAngleAthwartship(); - Float transducerAcquisitionBeamAngleAlongship = - row.getTransducerAcquisitionBeamAngleAlongship(); - Float transducerAcquisitionPsi = - row.getTransducerAcquisitionPsi(); - Float transceiverAcquisitionGain = - row.getTransceiverAcquisitionGain(); - Float transceiverAcquisitionSacorrection = - row.getTransceiverAcquisitionSacorrection(); - int eIThresholdLow = row.geteIThresholdLow(); - int eIThresholdHigh = row.geteIThresholdHigh(); - - dataProcessing.seteIThresholdLow(eIThresholdLow); - dataProcessing.seteIThresholdHigh(eIThresholdHigh); - dataProcessing.setTransceiverProcessingSacorrection(transceiverAcquisitionSacorrection); - dataProcessing.setTransceiverProcessingAbsorption(transceiverAcquisitionAbsorption); - dataProcessing.setTransceiverProcessingGain(transceiverAcquisitionGain); - dataProcessing.setTransducerProcessingPsi(transducerAcquisitionPsi); - dataProcessing.setTransducerProcessingBeamAngleAthwartship(transducerAcquisitionBeamAngleAthwartship); - dataProcessing.setTransducerProcessingBeamAngleAlongship(transducerAcquisitionBeamAngleAlongship); - - return dataProcessing; - } - - private void createCellData(DataDAO dao, - Cell cell, - Map<String, DataMetadata> dataMetadatasByName, - String metadataName, - String dataValue, - CsvFileImportResult importResult) { - createCellData( - dao, - cell, - dataMetadatasByName.get(metadataName), - dataValue, - importResult - ); - -// DataMetadata dataMetaData = dataMetadatasByName.get(metadataName); -// Data data = create(dao, -// Data.PROPERTY_DATA_METADATA, dataMetaData, -// Data.PROPERTY_DATA_VALUE, dataValue -// ); -// data.setDataMetadata(dataMetaData); -// data.setDataValue(dataValue); -// cell.addData(data); - -// importResult.incrementsNumberCreated(EchoBaseEntityEnum.Data); - } - - private String getSoftwareVersion(AcousticDataImportConfiguration configuration, - boolean isME70) { - String result; - if (isME70) { - result = configuration.getAcquisitionSoftwareVersionME70(); - } else { - result = configuration.getAcquisitionSoftwareVersionER60(); - } - return result; - } - - private String getSoundSpeedCalculations(AcousticDataImportConfiguration configuration, - boolean isME70) { - String result; - if (isME70) { - result = configuration.getSoundSpeedCalculationsME70(); - } else { - result = configuration.getSoundSpeedCalculationsER60(); - } - return result; - } - -} Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportConfiguration.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,256 @@ +/* + * #%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 AcousticImportConfiguration 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 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 AcousticImportConfiguration(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 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/AcousticImportConfiguration.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/AcousticImportService.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticDataImportService.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportService.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportService.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,742 @@ +/* + * #%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 com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import fr.ifremer.echobase.EchoBaseFunctions; +import fr.ifremer.echobase.EchoBasePredicates; +import fr.ifremer.echobase.InputFile; +import fr.ifremer.echobase.csv.CsvFileImportResult; +import fr.ifremer.echobase.csv.EchoBaseImport; +import fr.ifremer.echobase.csv.EchobaseCsvUtil; +import fr.ifremer.echobase.entities.EchoBaseEntityEnum; +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.DataAcquisition; +import fr.ifremer.echobase.entities.data.DataAcquisitionDAO; +import fr.ifremer.echobase.entities.data.DataDAO; +import fr.ifremer.echobase.entities.data.DataProcessing; +import fr.ifremer.echobase.entities.data.DataProcessingDAO; +import fr.ifremer.echobase.entities.data.Transect; +import fr.ifremer.echobase.entities.data.Transit; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.AcousticInstrument; +import fr.ifremer.echobase.entities.references.CellType; +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.importdata.csv.AcousticImportModel; +import fr.ifremer.echobase.services.importdata.csv.AcousticImportRow; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.util.csv.Import; +import org.nuiton.util.csv.ImportRuntimeException; + +import java.io.Reader; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import static org.nuiton.i18n.I18n.l_; + +/** + * Service to launch a "acoustic data" import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class AcousticImportService extends AbstractImportDataService<AcousticImportConfiguration> { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(AcousticImportService.class); + + @Override + protected String getImportLabel() { + return l_(getLocale(), ImportMode.Acoustic.getI18nKey()); + } + + @Override + protected void startImport( + AcousticImportConfiguration configuration, + EchoBaseUser user) throws ImportException { + + // get selected voyage + Voyage voyage = getEntityById(Voyage.class, + configuration.getVoyageId()); + + // get selected vessel + Vessel vessel = getEntityById(Vessel.class, + configuration.getVesselId()); + + CellType esduCellType = getEntityByProperty( + CellType.class, CellType.PROPERTY_ID, "Esdu"); + Preconditions.checkNotNull(esduCellType); + + CellType elementaryCellType = getEntityByProperty( + CellType.class, CellType.PROPERTY_ID, "Elementary"); + Preconditions.checkNotNull(elementaryCellType); + + CsvFileImportResult importResult = importMoviesFile(configuration, + voyage, + vessel, + esduCellType, + elementaryCellType); + configuration.addResult(importResult); + } + + private final DateFormat cellDateFormat = new SimpleDateFormat( + EchobaseCsvUtil.CELLULE_DATE_FORMAT); + + + private DataAcquisition getDataAcquisition(Transect transect, + AcousticInstrument instrument, + boolean addDataAcquisition) throws ImportException { + + + DataAcquisition result = null; + if (!addDataAcquisition && + !transect.isDataAcquisitionEmpty()) { + + // try to obtain an existing data acquisiton + + for (DataAcquisition acquisition : transect.getDataAcquisition()) { + + if (instrument.equals(acquisition.getAcousticInstrument())) { + + // found a matching dataAcquisition from his acoustic instrument + result = acquisition; + break; + } + } + } + return result; + } + + private CsvFileImportResult importMoviesFile(AcousticImportConfiguration configuration, + Voyage voyage, + Vessel vessel, + CellType esduCellType, + CellType elementaryCellType + ) throws ImportException { + + InputFile inputFile = configuration.getMoviesFile(); + + if (log.isInfoEnabled()) { + log.info("Starts import of acoustic datas from file " + + inputFile.getFileName()); + } + + CsvFileImportResult importResult = new CsvFileImportResult( + inputFile.getFileName()); + + Map<String, AcousticInstrument> instrumentsById = + getEntitiesMap(AcousticInstrument.class, + EchoBaseFunctions.ACOUSTIC_INSTRUMENT_ID); + + Map<String, DataMetadata> dataMetadatasByName = getEntitiesMap( + DataMetadata.class, EchoBaseFunctions.DATA_METADATA_NAME); + + AcousticImportModel csvModel = new AcousticImportModel( + getCsvSeparator(), instrumentsById); + + DataAcquisitionDAO dataAcquisitionDAO = + getDAO(DataAcquisition.class, DataAcquisitionDAO.class); + DataProcessingDAO dataProcessingDAO = + getDAO(DataProcessing.class, DataProcessingDAO.class); + CellDAO cellDAO = getDAO(Cell.class, CellDAO.class); + DataDAO dataDAO = getDAO(Data.class, DataDAO.class); + + boolean addDataAcquisition = configuration.isAddDataAcquisition(); + + String suffix = + configuration.getCellPositionReference().getMetadataNameSuffix(); + + List<Cell> elementaryCells = Lists.newArrayList(); + + Reader reader = getInputFileReader(inputFile); + Locale locale = getLocale(); + String dataProcessingId = null; + try { + Import<AcousticImportRow> importer = + EchoBaseImport.newImport(csvModel, reader); + DataAcquisition dataAcquisition = null; + DataProcessing dataProcessing = null; + + Cell elementaryCell; + int rowNumber = 0; + + configuration.incrementsProgression(); + for (AcousticImportRow row : importer) { + + configuration.incrementsProgression(); + rowNumber++; + + if (rowNumber % 100 == 0) { + if (log.isInfoEnabled()) { + log.info("Doing line " + rowNumber); + } + } + if (dataProcessingId == null) { + + // compute once for all the common dataprocessing id used + // for hole the movies file + dataProcessingId = row.getEiLayer() + + configuration.getProcessingTemplate(); + } + + Date startDate = row.getCellDateStart(); + + // get transect to use + Transit transit = voyage.getTransit(startDate); + if (transit == null) { + + // can not find correct transit + throw new ImportException( + l_(locale, "echobase.importError.transit.notfound", + voyage.getName(), + startDate, + rowNumber)); + } + + Transect transect = transit.getTransect(vessel); + if (transect == null) { + + // can not find correct transect + throw new ImportException( + l_(locale, "echobase.importError.transect.notfound", + voyage.getName(), + startDate, + vessel.getName(), + rowNumber)); + } + + AcousticInstrument instrument = row.getAcousticInstrument(); + boolean isME70 = + EchoBasePredicates.IS_ACOUSTIC_INSTRUMENT_ME70.apply(instrument); + + if (dataAcquisition == null || + !instrument.equals(dataAcquisition.getAcousticInstrument())) { + + // need to use another data acquisition + + if (log.isDebugEnabled()) { + log.debug("[row " + rowNumber + "] New instrument to use (" + instrument.getId() + ")"); + } + + if (CollectionUtils.isNotEmpty(elementaryCells)) { + + // means miss a esdu cell + // can not find correct transect + throw new ImportException( + l_(locale, "echobase.importError.esduCell.notfound", + voyage.getName(), + vessel.getName(), + instrument.getId(), + rowNumber)); + } + + String softwareVersion = + getSoftwareVersion(configuration, isME70); + + String soundSpeedCalculations = + getSoundSpeedCalculations(configuration, isME70); + + // try to get existing data acquisition + dataAcquisition = getDataAcquisition( + transect, + instrument, + addDataAcquisition + ); + + if (dataAcquisition == null) { + + // need to create the data acquisition + dataAcquisition = createDataAcquisition( + configuration, + instrument, + softwareVersion, + soundSpeedCalculations, + row, + dataAcquisitionDAO + ); + + // add dataAcquisition to transect + transect.addDataAcquisition(dataAcquisition); + + // count creation in result + importResult.incrementsNumberCreated(EchoBaseEntityEnum.DataAcquisition); + + if (log.isDebugEnabled()) { + log.debug("[row " + rowNumber + + "] New dataAquisition to use (number: " + + importResult.getNumberCreated( + EchoBaseEntityEnum.DataAcquisition) + ")"); + } + + // create data processing + dataProcessing = createDataProcessing( + configuration, + dataProcessingId, + softwareVersion, + soundSpeedCalculations, + row, + dataProcessingDAO + ); + + if (log.isDebugEnabled()) { + log.debug("[row " + rowNumber + + "] New dataProcessing to use (" + + dataProcessing.getId() + ")"); + } + + importResult.incrementsNumberCreated( + EchoBaseEntityEnum.DataProcessing); + + // add it to data acquisition + dataAcquisition.addDataProcessing(dataProcessing); + } + } + + if (!row.isCellToAdd()) { + + // dead cell not to be imported + if (log.isWarnEnabled()) { + log.warn("Will not import cell of row " + rowNumber); + } + continue; + } + + int cellType = row.getCellType(); + + String esduCellId = cellDateFormat.format(startDate); + + if (cellType == 4) { + + if (log.isDebugEnabled()) { + log.debug("[row " + rowNumber + "] Esdu cell (" + + esduCellId + ")"); + } + + // this is a esdu cell row + + // create esdu cell + Cell esduCell = create(cellDAO, + Cell.PROPERTY_CELL_TYPE, esduCellType, + Cell.PROPERTY_NAME, esduCellId + ); + + // add all found elementary cells + esduCell.addAllChilds(elementaryCells); + + // clear elementary cells + elementaryCells.clear(); + + importResult.incrementsNumberCreated(EchoBaseEntityEnum.Cell); + + // add it to data processing + dataProcessing.addCell(esduCell); + + // create esdu cell data + createEsduCellData(suffix, + esduCell, + dataMetadatasByName, + row, + dataDAO, + importResult); + } else { + + // this is a elementary cell row + + int cellNum = row.getCellNum(); + + boolean surface = cellType == 0; + + String elementaryCellId = cellNum + (surface ? "S" : "B"); + + if (log.isDebugEnabled()) { + log.debug("[row " + rowNumber + "] elementary cell (" + + elementaryCellId + ")"); + } + + // create the elementary cell + elementaryCell = create(cellDAO, + Cell.PROPERTY_CELL_TYPE, elementaryCellType, + Cell.PROPERTY_NAME, elementaryCellId + ); + + // keep (to attach them to esdu cell) + elementaryCells.add(elementaryCell); + + importResult.incrementsNumberCreated(EchoBaseEntityEnum.Cell); + + // create datas of the elementary cell + createElementaryCellData(suffix, + elementaryCell, + dataMetadatasByName, + surface, + row, + dataDAO, + importResult); + } + } + + return importResult; + } catch (ImportRuntimeException e) { + throw new ImportException(locale, inputFile, e); + } finally { + closeReader(reader, inputFile); + } + } + + protected void createEsduCellData(String suffix, + Cell cell, + Map<String, DataMetadata> dataMetadatas, + AcousticImportRow row, + DataDAO dao, + CsvFileImportResult importResult) { + + String dataValue; + + // create Latitude data + dataValue = String.valueOf(row.getCellLatitude()); + createCellData(dao, cell, dataMetadatas, "Latitude" + suffix, + dataValue, importResult); + + // create Longitude data + dataValue = String.valueOf(row.getCellLongitude()); + createCellData(dao, cell, dataMetadatas, "Longitude" + suffix, + dataValue, importResult); + + // create Depth data + dataValue = row.getEsduCellDataDepth(); + createCellData(dao, cell, dataMetadatas, "DepthRefSurface" + suffix, + dataValue, importResult); + + // create Time Start data + dataValue = cellDateFormat.format(row.getCellDateStart()); + createCellData(dao, cell, dataMetadatas, "TimeStart", + dataValue, importResult); + + // create Time end data + dataValue = cellDateFormat.format(row.getCellDateEnd()); + createCellData(dao, cell, dataMetadatas, "TimeEnd", + dataValue, importResult); + + // create NASC data + if (row.getCellNasc() != null) { + dataValue = String.valueOf(row.getCellNasc()); + createCellData(dao, cell, dataMetadatas, "NASC", + dataValue, importResult); + } + + // create Volume data + if (row.getCellVolume() != null) { + dataValue = String.valueOf(row.getCellVolume()); + createCellData(dao, cell, dataMetadatas, "Volume ", + dataValue, importResult); + } + // create Surface data + dataValue = String.valueOf(row.getCellSurface()); + createCellData(dao, cell, dataMetadatas, "Surface", + dataValue, importResult); + + // create NumberOfSamplesRecorded data + if (row.getCellNumberOfSamplesRecorded() != null) { + dataValue = String.valueOf(row.getCellNumberOfSamplesRecorded()); + createCellData(dao, cell, dataMetadatas, "NumberOfSamplesRecorded", + dataValue, importResult); + } + // create NumberOfSamplesEchoIntegrated data + if (row.getCellNumberOfSamplesEchoIntegrated() != null) { + dataValue = String.valueOf(row.getCellNumberOfSamplesEchoIntegrated()); + createCellData(dao, cell, dataMetadatas, "NumberOfSamplesEchoIntegrated", + dataValue, importResult); + } + } + + private void createElementaryCellData(String suffix, + Cell cell, + Map<String, DataMetadata> dataMetadatas, + boolean surface, + AcousticImportRow row, + DataDAO dao, + CsvFileImportResult importResult) { + + String dataValue; + String startMeta; + String endMeta; + + if (surface) { + + // surface + + startMeta = "DepthRefSurfaceStart"; + endMeta = "DepthRefSurfaceEnd"; + + } else { + + // bottom + + startMeta = "DepthRefBottomStart"; + endMeta = "DepthRefBottomEnd"; + } + + // create Latitude data + dataValue = String.valueOf(row.getCellLatitude()); + createCellData(dao, cell, dataMetadatas, "Latitude" + suffix, + dataValue, importResult); + + // create Longitude data + dataValue = String.valueOf(row.getCellLongitude()); + createCellData(dao, cell, dataMetadatas, "Longitude" + suffix, + dataValue, importResult); + + // create depth start data + dataValue = String.valueOf(row.getCellDepthStart()); + createCellData(dao, cell, dataMetadatas, startMeta, dataValue, importResult); + + // create depth end data + dataValue = String.valueOf(row.getCellDepthEnd()); + createCellData(dao, cell, dataMetadatas, endMeta, dataValue, importResult); + + + // create Time Start data + dataValue = cellDateFormat.format(row.getCellDateStart()); + createCellData(dao, cell, dataMetadatas, "TimeStart", + dataValue, importResult); + + // create Time end data + dataValue = cellDateFormat.format(row.getCellDateEnd()); + createCellData(dao, cell, dataMetadatas, "TimeEnd", + dataValue, importResult); + + // create acoustic density data + if (row.getCellNasc() != null) { + dataValue = String.valueOf(row.getCellNasc()); + createCellData(dao, cell, dataMetadatas, "NASC", dataValue, importResult); + } + // create Volume data + if (row.getCellVolume() != null) { + dataValue = String.valueOf(row.getCellVolume()); + createCellData(dao, cell, dataMetadatas, "Volume ", + dataValue, importResult); + } + // create Surface data + dataValue = String.valueOf(row.getCellSurface()); + createCellData(dao, cell, dataMetadatas, "Surface", + dataValue, importResult); + + // create NumberOfSamplesRecorded data + if (row.getCellNumberOfSamplesRecorded() != null) { + dataValue = String.valueOf(row.getCellNumberOfSamplesRecorded()); + createCellData(dao, cell, dataMetadatas, "NumberOfSamplesRecorded", + dataValue, importResult); + } + // create NumberOfSamplesEchoIntegrated data + if (row.getCellNumberOfSamplesEchoIntegrated() != null) { + dataValue = String.valueOf(row.getCellNumberOfSamplesEchoIntegrated()); + createCellData(dao, cell, dataMetadatas, "NumberOfSamplesEchoIntegrated", + dataValue, importResult); + } + } + + private DataAcquisition createDataAcquisition(AcousticImportConfiguration configuration, + AcousticInstrument instrument, + String softwareVersion, + String soundSpeedCalculations, + AcousticImportRow row, + DataAcquisitionDAO dataAcquisitionDAO) { + + String transceiverAcquisitionAbsorptionDescription = + configuration.getTransceiverAcquisitionAbsorptionDescription(); + String loggedDataFormat = configuration.getLoggedDataFormat(); + String loggedDataDatatype = configuration.getLoggedDataDatatype(); + String pingDutyCycle = configuration.getPingDutyCycle(); + + DataAcquisition dataAcquisition = create( + dataAcquisitionDAO, + DataAcquisition.PROPERTY_ACOUSTIC_INSTRUMENT, instrument + ); + + // fill from manual configuration +// dataAcquisition.setAcousticInstrument(instrument); + dataAcquisition.setTransceiverAcquisitionAbsorptionDescription(transceiverAcquisitionAbsorptionDescription); + dataAcquisition.setAcquisitionSoftwareVersion(softwareVersion); + dataAcquisition.setLoggedDataFormat(loggedDataFormat); + dataAcquisition.setLoggedDataDatatype(loggedDataDatatype); + dataAcquisition.setPingDutyCycle(pingDutyCycle); + dataAcquisition.setEchosounderSoundSpeed(row.getSoundCelerity()); + dataAcquisition.setSoundSpeedCalculations(soundSpeedCalculations); + + // fill from csv file + Float transceiverAcquisitionAbsorption = + row.getTransceiverAcquisitionAbsorption(); + Float transducerAcquisitionBeamAngleAthwartship = + row.getTransducerAcquisitionBeamAngleAthwartship(); + Float transducerAcquisitionBeamAngleAlongship = + row.getTransducerAcquisitionBeamAngleAlongship(); + Float transducerAcquisitionPsi = + row.getTransducerAcquisitionPsi(); + Float transceiverAcquisitionPower = + row.getTransceiverAcquisitionPower(); + Float transceiverAcquisitionPulseLength = + row.getTransceiverAcquisitionPulseLength(); + Float transceiverAcquisitionGain = + row.getTransceiverAcquisitionGain(); + Float transceiverAcquisitionSacorrection = + row.getTransceiverAcquisitionSacorrection(); + + dataAcquisition.setTransceiverAcquisitionAbsorption(transceiverAcquisitionAbsorption); + dataAcquisition.setTransducerAcquisitionBeamAngleAthwartship(transducerAcquisitionBeamAngleAthwartship); + dataAcquisition.setTransducerAcquisitionBeamAngleAlongship(transducerAcquisitionBeamAngleAlongship); + dataAcquisition.setTransducerAcquisitionPsi(transducerAcquisitionPsi); + dataAcquisition.setTransceiverAcquisitionPower(transceiverAcquisitionPower); + dataAcquisition.setTransceiverAcquisitionPulseLength(transceiverAcquisitionPulseLength); + dataAcquisition.setTransceiverAcquisitionGain(transceiverAcquisitionGain); + dataAcquisition.setTransceiverAcquisitionSacorrection(transceiverAcquisitionSacorrection); + + return dataAcquisition; + } + + private DataProcessing createDataProcessing(AcousticImportConfiguration configuration, + String id, + String softwareVersion, + String soundSpeedCalculations, + AcousticImportRow row, + DataProcessingDAO dataProcessingDAO) { + + String transceiverAcquisitionAbsorptionDescription = + configuration.getTransceiverAcquisitionAbsorptionDescription(); + String processingTemplate = configuration.getProcessingTemplate(); + String processingDescription = configuration.getProcessingDescription(); + String sounderConstant = configuration.getSounderConstant(); + float digitThreshold = configuration.getDigitThreshold(); + String acousticDensityUnit = configuration.getAcousticDensityUnit(); + String notes = configuration.getNotes(); + + DataProcessing dataProcessing = create( + dataProcessingDAO, + DataProcessing.PROPERTY_ID, id, + DataProcessing.PROPERTY_PROCESSING_TEMPLATE, processingTemplate + ); + + // fill from manual configuration +// dataProcessing.setId(id); +// dataProcessing.setProcessingTemplate(processingTemplate); + dataProcessing.setProcessingDescription(processingDescription); + dataProcessing.setSounderConstant(sounderConstant); + dataProcessing.setDigitThreshold(digitThreshold); + dataProcessing.setAcousticDensityUnit(acousticDensityUnit); + dataProcessing.setNotes(notes); + dataProcessing.setProcessingSoftwareVersion(softwareVersion); + dataProcessing.setTransceiverProcessingAbsorptionDescription(transceiverAcquisitionAbsorptionDescription); + dataProcessing.setEchosounderSoundSpeed(row.getSoundCelerity()); + dataProcessing.setSoundSpeedCalculations(soundSpeedCalculations); + + // fill from csv file + + Float transceiverAcquisitionAbsorption = + row.getTransceiverAcquisitionAbsorption(); + Float transducerAcquisitionBeamAngleAthwartship = + row.getTransducerAcquisitionBeamAngleAthwartship(); + Float transducerAcquisitionBeamAngleAlongship = + row.getTransducerAcquisitionBeamAngleAlongship(); + Float transducerAcquisitionPsi = + row.getTransducerAcquisitionPsi(); + Float transceiverAcquisitionGain = + row.getTransceiverAcquisitionGain(); + Float transceiverAcquisitionSacorrection = + row.getTransceiverAcquisitionSacorrection(); + int eIThresholdLow = row.geteIThresholdLow(); + int eIThresholdHigh = row.geteIThresholdHigh(); + + dataProcessing.seteIThresholdLow(eIThresholdLow); + dataProcessing.seteIThresholdHigh(eIThresholdHigh); + dataProcessing.setTransceiverProcessingSacorrection(transceiverAcquisitionSacorrection); + dataProcessing.setTransceiverProcessingAbsorption(transceiverAcquisitionAbsorption); + dataProcessing.setTransceiverProcessingGain(transceiverAcquisitionGain); + dataProcessing.setTransducerProcessingPsi(transducerAcquisitionPsi); + dataProcessing.setTransducerProcessingBeamAngleAthwartship(transducerAcquisitionBeamAngleAthwartship); + dataProcessing.setTransducerProcessingBeamAngleAlongship(transducerAcquisitionBeamAngleAlongship); + + return dataProcessing; + } + + private void createCellData(DataDAO dao, + Cell cell, + Map<String, DataMetadata> dataMetadatasByName, + String metadataName, + String dataValue, + CsvFileImportResult importResult) { + createCellData( + dao, + cell, + dataMetadatasByName.get(metadataName), + dataValue, + importResult + ); + +// DataMetadata dataMetaData = dataMetadatasByName.get(metadataName); +// Data data = create(dao, +// Data.PROPERTY_DATA_METADATA, dataMetaData, +// Data.PROPERTY_DATA_VALUE, dataValue +// ); +// data.setDataMetadata(dataMetaData); +// data.setDataValue(dataValue); +// cell.addData(data); + +// importResult.incrementsNumberCreated(EchoBaseEntityEnum.Data); + } + + private String getSoftwareVersion(AcousticImportConfiguration configuration, + boolean isME70) { + String result; + if (isME70) { + result = configuration.getAcquisitionSoftwareVersionME70(); + } else { + result = configuration.getAcquisitionSoftwareVersionER60(); + } + return result; + } + + private String getSoundSpeedCalculations(AcousticImportConfiguration configuration, + boolean isME70) { + String result; + if (isME70) { + result = configuration.getSoundSpeedCalculationsME70(); + } else { + result = configuration.getSoundSpeedCalculationsER60(); + } + return result; + } + +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/AcousticImportService.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/importdata/CatchesDataImportConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportConfiguration.java 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460) @@ -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.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}; - } -} Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportService.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,554 +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.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.EchoBasePredicates; -import fr.ifremer.echobase.InputFile; -import fr.ifremer.echobase.csv.CsvFileImportResult; -import fr.ifremer.echobase.csv.EchoBaseImport; -import fr.ifremer.echobase.entities.EchoBaseEntityEnum; -import fr.ifremer.echobase.entities.EchoBaseUser; -import fr.ifremer.echobase.entities.data.Operation; -import fr.ifremer.echobase.entities.data.Sample; -import fr.ifremer.echobase.entities.data.SampleDAO; -import fr.ifremer.echobase.entities.data.SampleData; -import fr.ifremer.echobase.entities.data.SampleDataDAO; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.references.SampleDataType; -import fr.ifremer.echobase.entities.references.SampleDataTypeDAO; -import fr.ifremer.echobase.entities.references.SampleType; -import fr.ifremer.echobase.entities.references.SampleTypeDAO; -import fr.ifremer.echobase.entities.references.SexCategory; -import fr.ifremer.echobase.entities.references.SizeCategory; -import fr.ifremer.echobase.entities.references.Species; -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.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; -import org.nuiton.util.csv.ImportRuntimeException; - -import java.io.Reader; -import java.util.Collection; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -import static org.nuiton.i18n.I18n.l_; - -/** - * Service to launch a "catches sample data" import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class CatchesDataImportService extends AbstractImportDataService<CatchesDataImportConfiguration> { - - /** Logger. */ - private static final Log log = - LogFactory.getLog(CatchesDataImportService.class); - - @Override - protected String getImportLabel() { - return l_(getLocale(), ImportDataMode.CatchesData.getI18nKey()); - } - - @Override - protected List<CsvFileImportResult> startImport(CatchesDataImportConfiguration configuration, - EchoBaseUser user) throws ImportException { - - List<CsvFileImportResult> result = Lists.newLinkedList(); - - Voyage voyage = getEntityById(Voyage.class, - configuration.getVoyageId()); - - // get all operation for this voyage and this vessel - Collection<Operation> operations = voyage.getAllOperations(); - - // split them by operation Id - Map<String, Operation> operationMap = Maps.uniqueIndex( - operations, EchoBaseFunctions.OPERATION_ID); - - Map<String, Species> speciesMap = getEntitiesMap( - Species.class, - EchoBaseFunctions.SPECIES_BARACOUDA_CODE); - - Map<String, SizeCategory> sizeCategoryMap = getEntitiesMap( - SizeCategory.class, - EchoBaseFunctions.SIZE_CATEGORY_NAME); - - - if (configuration.getTotalSampleFile().hasFile()) { - CsvFileImportResult totalSampleResult = importTotalSampleFile( - configuration, - configuration.getTotalSampleFile(), - operationMap, - speciesMap, - sizeCategoryMap); - - addResultAndLog(result, configuration.getTotalSampleFile(), - totalSampleResult, user); - } - - if (configuration.getSubSampleFile().hasFile()) { - CsvFileImportResult subSampleResult = importSubSampleFile( - configuration, - configuration.getSubSampleFile(), - operationMap, - speciesMap, - sizeCategoryMap - ); - - addResultAndLog(result, configuration.getSubSampleFile(), - subSampleResult, user); - } - - if (configuration.getBiometrySampleFile().hasFile()) { - CsvFileImportResult biometrySampleResult = importBiometrySampleFile( - configuration, - configuration.getBiometrySampleFile(), - operationMap, - speciesMap); - - - addResultAndLog(result, configuration.getBiometrySampleFile(), - biometrySampleResult, user); - } - return result; - } - - private CsvFileImportResult importTotalSampleFile(CatchesDataImportConfiguration configuration, - InputFile inputFile, - Map<String, Operation> operationMap, - Map<String, Species> speciesMap, - Map<String, SizeCategory> sizeCategoryMap) throws ImportException { - - if (log.isInfoEnabled()) { - log.info("Starts import of totalSample from file " + - inputFile.getFileName()); - } - - CsvFileImportResult importResult = new CsvFileImportResult( - inputFile.getFileName()); - - TotalSampleImportModel csvModel = new TotalSampleImportModel(getCsvSeparator(), - operationMap, - speciesMap, - sizeCategoryMap - ); - - SampleDAO sampleDAO = getDAO(Sample.class, SampleDAO.class); - SampleDataDAO sampleDataDAO = getDAO(SampleData.class, SampleDataDAO.class); - SampleTypeDAO sampleTypeDAO = getDAO(SampleType.class, SampleTypeDAO.class); - SampleDataTypeDAO sampleDataTypeDAO = getDAO(SampleDataType.class, SampleDataTypeDAO.class); - SpeciesCategoryDAO speciesCategoryDAO = getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class); - - SampleType sampleTypeTotal = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Total"); - Preconditions.checkNotNull(sampleTypeTotal); - SampleType sampleTypeUnsorted = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Unsorted"); - Preconditions.checkNotNull(sampleTypeUnsorted); - SampleType sampleTypeSorted = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Sorted"); - Preconditions.checkNotNull(sampleTypeSorted); - - SampleDataType sampleDataTypeMeanLength = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "MeanLengthcm"); - Preconditions.checkNotNull(sampleDataTypeMeanLength); - SampleDataType sampleDataTypeMeanWeight = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "MeanWeightg"); - Preconditions.checkNotNull(sampleDataTypeMeanWeight); - SampleDataType sampleDataTypeNoPerKg = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "NoPerKg"); - Preconditions.checkNotNull(sampleDataTypeNoPerKg); - - Reader reader = getInputFileReader(inputFile); - Locale locale = getLocale(); - try { - Import<TotalSampleImportRow> importer = - EchoBaseImport.newImport(csvModel, reader); - - configuration.incrementsProgression(); - for (TotalSampleImportRow row : importer) { - - configuration.incrementsProgression(); - Operation operation = row.getOperation(); - - Species species = row.getSpecies(); - SizeCategory sizeCategory = row.getSizeCategory(); - - SpeciesCategory category = getSpeciesCategory( - speciesCategoryDAO, - species, - sizeCategory, - null, - null, - importResult - ); - - SampleType sampleType; - - if (EchoBasePredicates.IS_HORS_VRAC.apply(sizeCategory)) { - - // hors vrac case - sampleType = sampleTypeUnsorted; - - } else { - // none hors vrac case - sampleType = sampleTypeTotal; - } - - Sample sample = operation.getSample(category, sampleType); - - if (sample != null) { - - // can not have twice same sample - throw new ImportException( - l_(locale, "echobase.importError.duplicate.sample", - operation.getId(), - sampleType.getName(), - species.getBaracoudaCode(), - sizeCategory.getName())); - } - - if (sample == null) { - - // must create it - - sample = row.getSample(); - sample.setSpeciesCategory(category); - sample.setSampleType(sampleType); - - sample = addSample(sampleDAO, - operation, - sample, - importResult); - } else { - sample = sample; - } - - // create datas - - if (row.getMeanLength() != null) { - - //create meanLength data - addSampleData(sampleDataDAO, - sampleDataTypeMeanLength, - null, - row.getMeanLength(), - sample, - importResult); - } - - if (row.getMeanWeight() != null) { - - //create meanWeight data - addSampleData(sampleDataDAO, - sampleDataTypeMeanWeight, - null, - row.getMeanWeight(), - sample, - importResult); - } - - if (row.getNoPerKg() != null) { - - //create noPerKg data - addSampleData(sampleDataDAO, - sampleDataTypeNoPerKg, - null, - row.getNoPerKg(), - sample, - importResult); - } - - Sample createdSortedSample = newInstance(sampleDAO); - createdSortedSample.setSampleType(sampleTypeSorted); - createdSortedSample.setSampleWeight(row.getSortedWeight()); - - // create sorted sample - addSample(sampleDAO, - operation, - createdSortedSample, - importResult); - - - } - - return importResult; - } catch (ImportRuntimeException e) { - throw new ImportException(locale, inputFile, e); - } finally { - closeReader(reader, inputFile); - } - } - - private CsvFileImportResult importSubSampleFile( - CatchesDataImportConfiguration configuration, - InputFile inputFile, - Map<String, Operation> operationMap, - Map<String, Species> speciesMap, - Map<String, SizeCategory> sizeCategoryMap - ) throws ImportException { - - if (log.isInfoEnabled()) { - log.info("Starts import of subSample from file " + - inputFile.getFileName()); - } - - Map<String, SexCategory> sexCategoryMap = getEntitiesMap( - SexCategory.class, - EchoBaseFunctions.SEX_CATEGORY_NAME); - - - CsvFileImportResult importResult = new CsvFileImportResult( - inputFile.getFileName()); - - SubSampleImportModel csvModel = new SubSampleImportModel( - getCsvSeparator(), - operationMap, - speciesMap, - sizeCategoryMap, - sexCategoryMap); - - SampleDAO sampleDAO = getDAO(Sample.class, SampleDAO.class); - SampleDataDAO sampleDataDAO = getDAO(SampleData.class, SampleDataDAO.class); - SampleTypeDAO sampleTypeDAO = getDAO(SampleType.class, SampleTypeDAO.class); - SampleDataTypeDAO sampleDataTypeDAO = getDAO(SampleDataType.class, SampleDataTypeDAO.class); - SpeciesCategoryDAO speciesCategoryDAO = getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class); - - SampleType sampleTypeSubsample = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Subsample"); - Preconditions.checkNotNull(sampleTypeSubsample); - - SampleDataType sampleDataTypeNumberAtLength = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "NumberAtLength"); - Preconditions.checkNotNull(sampleDataTypeNumberAtLength); - SampleDataType sampleDataTypeWeightAtLength = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "WeightAtLengthkg"); - Preconditions.checkNotNull(sampleDataTypeWeightAtLength); - - Reader reader = getInputFileReader(inputFile); - try { - Import<SubSampleImportRow> importer = - EchoBaseImport.newImport(csvModel, reader); - - configuration.incrementsProgression(); - for (SubSampleImportRow row : importer) { - - configuration.incrementsProgression(); - Operation operation = row.getOperation(); - - Species species = row.getSpecies(); - SizeCategory sizeCategory = row.getSizeCategory(); - SexCategory sexCategory = row.getSexCategory(); - - SpeciesCategory category = getSpeciesCategory( - speciesCategoryDAO, - species, - sizeCategory, - null, - sexCategory, - importResult - ); - - // find the sample with this category - Sample sample = operation.getSample(category, - sampleTypeSubsample); - - if (sample == null) { - - // must create it - sample = row.getSample(); - - sample.setSpeciesCategory(category); - sample.setSampleType(sampleTypeSubsample); - - sample = addSample(sampleDAO, - operation, - sample, - importResult); - } - - //create numberAtLength data - addSampleData(sampleDataDAO, - sampleDataTypeNumberAtLength, - "" + row.getLengthClass(), - row.getNumberAtLength(), - sample, - importResult); - - if (row.getWeightAtLength() != null) { - - //create weightAtLength data - addSampleData(sampleDataDAO, - sampleDataTypeWeightAtLength, - "" + row.getLengthClass(), - row.getWeightAtLength(), - sample, - importResult); - } - } - - return importResult; - } catch (ImportRuntimeException e) { - throw new ImportException(getLocale(), inputFile, e); - } finally { - closeReader(reader, inputFile); - } - } - - private CsvFileImportResult importBiometrySampleFile( - CatchesDataImportConfiguration configuration, - InputFile inputFile, - Map<String, Operation> operationMap, - Map<String, Species> speciesMap - ) throws ImportException { - - if (log.isInfoEnabled()) { - log.info("Starts import of biometrySample from file " + - inputFile.getFileName()); - } - - Map<String, SampleDataType> sampleDataTypeMap = getEntitiesMap( - SampleDataType.class, - EchoBaseFunctions.SAMPLE_DATA_TYPE_NAME); - - CsvFileImportResult importResult = new CsvFileImportResult( - inputFile.getFileName()); - - BiometrySampleImportModel csvModel = - new BiometrySampleImportModel(getCsvSeparator(), - operationMap, - speciesMap, - sampleDataTypeMap); - - SampleDAO sampleDAO = getDAO(Sample.class, SampleDAO.class); - SampleDataDAO sampleDataDAO = getDAO(SampleData.class, SampleDataDAO.class); - SampleTypeDAO sampleTypeDAO = getDAO(SampleType.class, SampleTypeDAO.class); - SpeciesCategoryDAO speciesCategoryDAO = getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class); - - SampleType sampleTypeIndividual = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Individual"); - Preconditions.checkNotNull(sampleTypeIndividual); - - Map<String, Sample> samples = Maps.newTreeMap(); - - Reader reader = getInputFileReader(inputFile); - try { - Import<BiometrySampleImportRow> importer = - EchoBaseImport.newImport(csvModel, reader); - - configuration.incrementsProgression(); - for (BiometrySampleImportRow row : importer) { - - configuration.incrementsProgression(); - Operation operation = row.getOperation(); - - Species species = row.getSpecies(); - - int numFish = row.getNumFish(); - - String sampleKey = operation.getId() + "_" + species.getBaracoudaCode() + "_" + numFish; - - Sample sample = samples.get(sampleKey); - - if (sample == null) { - - // create a new sample - sample = newInstance(sampleDAO); - - sample.setSampleType(sampleTypeIndividual); - - SpeciesCategory category = getSpeciesCategory( - speciesCategoryDAO, - species, - null, - null, - null, - importResult - ); - - sample.setSpeciesCategory(category); - - sample = addSample(sampleDAO, - operation, - sample, - importResult); - - samples.put(sampleKey, sample); - } - - SampleData sampleData = row.getSampleData(); - - SampleData sampleDataCreated = create(sampleDataDAO, sampleData); - sample.addSampleData(sampleDataCreated); - importResult.incrementsNumberCreated(EchoBaseEntityEnum.SampleData); - } - - return importResult; - } catch (ImportRuntimeException e) { - throw new ImportException(getLocale(), inputFile, e); - } finally { - closeReader(reader, inputFile); - } - } - - private Sample addSample(SampleDAO dao, - Operation operation, - Sample sample, - CsvFileImportResult importResult) { - Preconditions.checkNotNull(operation); - Preconditions.checkNotNull(sample); - Sample result = create(dao, sample); - operation.addSample(result); - importResult.incrementsNumberCreated(EchoBaseEntityEnum.Sample); - return result; - } - - private SampleData addSampleData(SampleDataDAO dao, - SampleDataType sampleDataType, - String label, - float value, - Sample sample, - CsvFileImportResult importResult) { - SampleData sampleData = create( - dao, - SampleData.PROPERTY_SAMPLE_DATA_TYPE, sampleDataType, - SampleData.PROPERTY_DATA_VALUE, value, - SampleData.PROPERTY_DATA_LABEL, label - - ); -// sampleData.setSampleDataType(sampleDataType); -// sampleData.setDataValue(value); -// sampleData.setDataLabel(label); - sample.addSampleData(sampleData); - - importResult.incrementsNumberCreated(EchoBaseEntityEnum.SampleData); - return sampleData; - } - -} Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportConfiguration.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460) @@ -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 CatchesImportConfiguration 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 CatchesImportConfiguration(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/CatchesImportConfiguration.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/CatchesImportService.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesDataImportService.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportService.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportService.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,550 @@ +/* + * #%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 com.google.common.base.Preconditions; +import com.google.common.collect.Maps; +import fr.ifremer.echobase.EchoBaseFunctions; +import fr.ifremer.echobase.EchoBasePredicates; +import fr.ifremer.echobase.InputFile; +import fr.ifremer.echobase.csv.CsvFileImportResult; +import fr.ifremer.echobase.csv.EchoBaseImport; +import fr.ifremer.echobase.entities.EchoBaseEntityEnum; +import fr.ifremer.echobase.entities.EchoBaseUser; +import fr.ifremer.echobase.entities.data.Operation; +import fr.ifremer.echobase.entities.data.Sample; +import fr.ifremer.echobase.entities.data.SampleDAO; +import fr.ifremer.echobase.entities.data.SampleData; +import fr.ifremer.echobase.entities.data.SampleDataDAO; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.references.SampleDataType; +import fr.ifremer.echobase.entities.references.SampleDataTypeDAO; +import fr.ifremer.echobase.entities.references.SampleType; +import fr.ifremer.echobase.entities.references.SampleTypeDAO; +import fr.ifremer.echobase.entities.references.SexCategory; +import fr.ifremer.echobase.entities.references.SizeCategory; +import fr.ifremer.echobase.entities.references.Species; +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.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; +import org.nuiton.util.csv.ImportRuntimeException; + +import java.io.Reader; +import java.util.Collection; +import java.util.Locale; +import java.util.Map; + +import static org.nuiton.i18n.I18n.l_; + +/** + * Service to launch a "catches sample data" import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class CatchesImportService extends AbstractImportDataService<CatchesImportConfiguration> { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(CatchesImportService.class); + + @Override + protected String getImportLabel() { + return l_(getLocale(), ImportMode.Catches.getI18nKey()); + } + + @Override + protected void startImport(CatchesImportConfiguration configuration, + EchoBaseUser user) throws ImportException { + + Voyage voyage = getEntityById(Voyage.class, + configuration.getVoyageId()); + + // get all operation for this voyage and this vessel + Collection<Operation> operations = voyage.getAllOperations(); + + // split them by operation Id + Map<String, Operation> operationMap = Maps.uniqueIndex( + operations, EchoBaseFunctions.OPERATION_ID); + + Map<String, Species> speciesMap = getEntitiesMap( + Species.class, + EchoBaseFunctions.SPECIES_BARACOUDA_CODE); + + Map<String, SizeCategory> sizeCategoryMap = getEntitiesMap( + SizeCategory.class, + EchoBaseFunctions.SIZE_CATEGORY_NAME); + + + InputFile inputFile; + CsvFileImportResult importResult; + + inputFile = configuration.getTotalSampleFile(); + if (inputFile.hasFile()) { + + importResult = importTotalSampleFile( + configuration, + inputFile, + operationMap, + speciesMap, + sizeCategoryMap); + configuration.addResult(importResult); + } + + inputFile = configuration.getSubSampleFile(); + if (inputFile.hasFile()) { + + importResult = importSubSampleFile( + configuration, + inputFile, + operationMap, + speciesMap, + sizeCategoryMap + ); + configuration.addResult(importResult); + } + + inputFile = configuration.getBiometrySampleFile(); + if (inputFile.hasFile()) { + + importResult = importBiometrySampleFile( + configuration, + inputFile, + operationMap, + speciesMap); + + configuration.addResult(importResult); + } + } + + private CsvFileImportResult importTotalSampleFile( + CatchesImportConfiguration configuration, + InputFile inputFile, + Map<String, Operation> operationMap, + Map<String, Species> speciesMap, + Map<String, SizeCategory> sizeCategoryMap) throws ImportException { + + if (log.isInfoEnabled()) { + log.info("Starts import of totalSample from file " + + inputFile.getFileName()); + } + + CsvFileImportResult importResult = new CsvFileImportResult( + inputFile.getFileName()); + + TotalSampleImportModel csvModel = new TotalSampleImportModel(getCsvSeparator(), + operationMap, + speciesMap, + sizeCategoryMap + ); + + SampleDAO sampleDAO = getDAO(Sample.class, SampleDAO.class); + SampleDataDAO sampleDataDAO = getDAO(SampleData.class, SampleDataDAO.class); + SampleTypeDAO sampleTypeDAO = getDAO(SampleType.class, SampleTypeDAO.class); + SampleDataTypeDAO sampleDataTypeDAO = getDAO(SampleDataType.class, SampleDataTypeDAO.class); + SpeciesCategoryDAO speciesCategoryDAO = getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class); + + SampleType sampleTypeTotal = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Total"); + Preconditions.checkNotNull(sampleTypeTotal); + SampleType sampleTypeUnsorted = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Unsorted"); + Preconditions.checkNotNull(sampleTypeUnsorted); + SampleType sampleTypeSorted = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Sorted"); + Preconditions.checkNotNull(sampleTypeSorted); + + SampleDataType sampleDataTypeMeanLength = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "MeanLengthcm"); + Preconditions.checkNotNull(sampleDataTypeMeanLength); + SampleDataType sampleDataTypeMeanWeight = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "MeanWeightg"); + Preconditions.checkNotNull(sampleDataTypeMeanWeight); + SampleDataType sampleDataTypeNoPerKg = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "NoPerKg"); + Preconditions.checkNotNull(sampleDataTypeNoPerKg); + + Reader reader = getInputFileReader(inputFile); + Locale locale = getLocale(); + try { + Import<TotalSampleImportRow> importer = + EchoBaseImport.newImport(csvModel, reader); + + configuration.incrementsProgression(); + for (TotalSampleImportRow row : importer) { + + configuration.incrementsProgression(); + Operation operation = row.getOperation(); + + Species species = row.getSpecies(); + SizeCategory sizeCategory = row.getSizeCategory(); + + SpeciesCategory category = getSpeciesCategory( + speciesCategoryDAO, + species, + sizeCategory, + null, + null, + importResult + ); + + SampleType sampleType; + + if (EchoBasePredicates.IS_HORS_VRAC.apply(sizeCategory)) { + + // hors vrac case + sampleType = sampleTypeUnsorted; + + } else { + // none hors vrac case + sampleType = sampleTypeTotal; + } + + Sample sample = operation.getSample(category, sampleType); + + if (sample != null) { + + // can not have twice same sample + throw new ImportException( + l_(locale, "echobase.importError.duplicate.sample", + operation.getId(), + sampleType.getName(), + species.getBaracoudaCode(), + sizeCategory.getName())); + } + + if (sample == null) { + + // must create it + + sample = row.getSample(); + sample.setSpeciesCategory(category); + sample.setSampleType(sampleType); + + sample = addSample(sampleDAO, + operation, + sample, + importResult); + } else { + sample = sample; + } + + // create datas + + if (row.getMeanLength() != null) { + + //create meanLength data + addSampleData(sampleDataDAO, + sampleDataTypeMeanLength, + null, + row.getMeanLength(), + sample, + importResult); + } + + if (row.getMeanWeight() != null) { + + //create meanWeight data + addSampleData(sampleDataDAO, + sampleDataTypeMeanWeight, + null, + row.getMeanWeight(), + sample, + importResult); + } + + if (row.getNoPerKg() != null) { + + //create noPerKg data + addSampleData(sampleDataDAO, + sampleDataTypeNoPerKg, + null, + row.getNoPerKg(), + sample, + importResult); + } + + Sample createdSortedSample = newInstance(sampleDAO); + createdSortedSample.setSampleType(sampleTypeSorted); + createdSortedSample.setSampleWeight(row.getSortedWeight()); + + // create sorted sample + addSample(sampleDAO, + operation, + createdSortedSample, + importResult); + + + } + + return importResult; + } catch (ImportRuntimeException e) { + throw new ImportException(locale, inputFile, e); + } finally { + closeReader(reader, inputFile); + } + } + + private CsvFileImportResult importSubSampleFile( + CatchesImportConfiguration configuration, + InputFile inputFile, + Map<String, Operation> operationMap, + Map<String, Species> speciesMap, + Map<String, SizeCategory> sizeCategoryMap + ) throws ImportException { + + if (log.isInfoEnabled()) { + log.info("Starts import of subSample from file " + + inputFile.getFileName()); + } + + Map<String, SexCategory> sexCategoryMap = getEntitiesMap( + SexCategory.class, + EchoBaseFunctions.SEX_CATEGORY_NAME); + + + CsvFileImportResult importResult = new CsvFileImportResult( + inputFile.getFileName()); + + SubSampleImportModel csvModel = new SubSampleImportModel( + getCsvSeparator(), + operationMap, + speciesMap, + sizeCategoryMap, + sexCategoryMap); + + SampleDAO sampleDAO = getDAO(Sample.class, SampleDAO.class); + SampleDataDAO sampleDataDAO = getDAO(SampleData.class, SampleDataDAO.class); + SampleTypeDAO sampleTypeDAO = getDAO(SampleType.class, SampleTypeDAO.class); + SampleDataTypeDAO sampleDataTypeDAO = getDAO(SampleDataType.class, SampleDataTypeDAO.class); + SpeciesCategoryDAO speciesCategoryDAO = getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class); + + SampleType sampleTypeSubsample = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Subsample"); + Preconditions.checkNotNull(sampleTypeSubsample); + + SampleDataType sampleDataTypeNumberAtLength = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "NumberAtLength"); + Preconditions.checkNotNull(sampleDataTypeNumberAtLength); + SampleDataType sampleDataTypeWeightAtLength = findByProperties(sampleDataTypeDAO, SampleDataType.PROPERTY_NAME, "WeightAtLengthkg"); + Preconditions.checkNotNull(sampleDataTypeWeightAtLength); + + Reader reader = getInputFileReader(inputFile); + try { + Import<SubSampleImportRow> importer = + EchoBaseImport.newImport(csvModel, reader); + + configuration.incrementsProgression(); + for (SubSampleImportRow row : importer) { + + configuration.incrementsProgression(); + Operation operation = row.getOperation(); + + Species species = row.getSpecies(); + SizeCategory sizeCategory = row.getSizeCategory(); + SexCategory sexCategory = row.getSexCategory(); + + SpeciesCategory category = getSpeciesCategory( + speciesCategoryDAO, + species, + sizeCategory, + null, + sexCategory, + importResult + ); + + // find the sample with this category + Sample sample = operation.getSample(category, + sampleTypeSubsample); + + if (sample == null) { + + // must create it + sample = row.getSample(); + + sample.setSpeciesCategory(category); + sample.setSampleType(sampleTypeSubsample); + + sample = addSample(sampleDAO, + operation, + sample, + importResult); + } + + //create numberAtLength data + addSampleData(sampleDataDAO, + sampleDataTypeNumberAtLength, + "" + row.getLengthClass(), + row.getNumberAtLength(), + sample, + importResult); + + if (row.getWeightAtLength() != null) { + + //create weightAtLength data + addSampleData(sampleDataDAO, + sampleDataTypeWeightAtLength, + "" + row.getLengthClass(), + row.getWeightAtLength(), + sample, + importResult); + } + } + + return importResult; + } catch (ImportRuntimeException e) { + throw new ImportException(getLocale(), inputFile, e); + } finally { + closeReader(reader, inputFile); + } + } + + private CsvFileImportResult importBiometrySampleFile( + CatchesImportConfiguration configuration, + InputFile inputFile, + Map<String, Operation> operationMap, + Map<String, Species> speciesMap + ) throws ImportException { + + if (log.isInfoEnabled()) { + log.info("Starts import of biometrySample from file " + + inputFile.getFileName()); + } + + Map<String, SampleDataType> sampleDataTypeMap = getEntitiesMap( + SampleDataType.class, + EchoBaseFunctions.SAMPLE_DATA_TYPE_NAME); + + CsvFileImportResult importResult = new CsvFileImportResult( + inputFile.getFileName()); + + BiometrySampleImportModel csvModel = + new BiometrySampleImportModel(getCsvSeparator(), + operationMap, + speciesMap, + sampleDataTypeMap); + + SampleDAO sampleDAO = getDAO(Sample.class, SampleDAO.class); + SampleDataDAO sampleDataDAO = getDAO(SampleData.class, SampleDataDAO.class); + SampleTypeDAO sampleTypeDAO = getDAO(SampleType.class, SampleTypeDAO.class); + SpeciesCategoryDAO speciesCategoryDAO = getDAO(SpeciesCategory.class, SpeciesCategoryDAO.class); + + SampleType sampleTypeIndividual = findByProperties(sampleTypeDAO, SampleType.PROPERTY_NAME, "Individual"); + Preconditions.checkNotNull(sampleTypeIndividual); + + Map<String, Sample> samples = Maps.newTreeMap(); + + Reader reader = getInputFileReader(inputFile); + try { + Import<BiometrySampleImportRow> importer = + EchoBaseImport.newImport(csvModel, reader); + + configuration.incrementsProgression(); + for (BiometrySampleImportRow row : importer) { + + configuration.incrementsProgression(); + Operation operation = row.getOperation(); + + Species species = row.getSpecies(); + + int numFish = row.getNumFish(); + + String sampleKey = operation.getId() + "_" + species.getBaracoudaCode() + "_" + numFish; + + Sample sample = samples.get(sampleKey); + + if (sample == null) { + + // create a new sample + sample = newInstance(sampleDAO); + + sample.setSampleType(sampleTypeIndividual); + + SpeciesCategory category = getSpeciesCategory( + speciesCategoryDAO, + species, + null, + null, + null, + importResult + ); + + sample.setSpeciesCategory(category); + + sample = addSample(sampleDAO, + operation, + sample, + importResult); + + samples.put(sampleKey, sample); + } + + SampleData sampleData = row.getSampleData(); + + SampleData sampleDataCreated = create(sampleDataDAO, sampleData); + sample.addSampleData(sampleDataCreated); + importResult.incrementsNumberCreated(EchoBaseEntityEnum.SampleData); + } + + return importResult; + } catch (ImportRuntimeException e) { + throw new ImportException(getLocale(), inputFile, e); + } finally { + closeReader(reader, inputFile); + } + } + + private Sample addSample(SampleDAO dao, + Operation operation, + Sample sample, + CsvFileImportResult importResult) { + Preconditions.checkNotNull(operation); + Preconditions.checkNotNull(sample); + Sample result = create(dao, sample); + operation.addSample(result); + importResult.incrementsNumberCreated(EchoBaseEntityEnum.Sample); + return result; + } + + private SampleData addSampleData(SampleDataDAO dao, + SampleDataType sampleDataType, + String label, + float value, + Sample sample, + CsvFileImportResult importResult) { + SampleData sampleData = create( + dao, + SampleData.PROPERTY_SAMPLE_DATA_TYPE, sampleDataType, + SampleData.PROPERTY_DATA_VALUE, value, + SampleData.PROPERTY_DATA_LABEL, label + + ); + sample.addSampleData(sampleData); + + importResult.incrementsNumberCreated(EchoBaseEntityEnum.SampleData); + return sampleData; + } + +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CatchesImportService.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/importdata/CommonDataImportConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportConfiguration.java 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460) @@ -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.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}; - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java 2012-03-30 16:46:14 UTC (rev 460) @@ -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.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 Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportService.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,337 +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.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.EchoBaseTechnicalException; -import fr.ifremer.echobase.InputFile; -import fr.ifremer.echobase.csv.CsvFileImportResult; -import fr.ifremer.echobase.csv.EchoBaseImport; -import fr.ifremer.echobase.entities.EchoBaseEntityEnum; -import fr.ifremer.echobase.entities.EchoBaseUser; -import fr.ifremer.echobase.entities.data.Transect; -import fr.ifremer.echobase.entities.data.TransectDAO; -import fr.ifremer.echobase.entities.data.Transit; -import fr.ifremer.echobase.entities.data.TransitDAO; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.entities.data.VoyageDAO; -import fr.ifremer.echobase.entities.references.AreaOfOperation; -import fr.ifremer.echobase.entities.references.Mission; -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.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; -import org.nuiton.util.csv.ImportRuntimeException; - -import java.io.Reader; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -import static org.nuiton.i18n.I18n.l_; - -/** - * Service to launch a "common data" import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class CommonDataImportService extends AbstractImportDataService<CommonDataImportConfiguration> { - - @Override - protected String getImportLabel() { - return l_(getLocale(), ImportDataMode.CommonData.getI18nKey()); - } - - @Override - protected List<CsvFileImportResult> startImport( - CommonDataImportConfiguration configuration, - EchoBaseUser user) throws ImportException { - - List<CsvFileImportResult> result = Lists.newLinkedList(); - - // get usable vessels - Map<String, Vessel> vesselMap = getEntitiesMap( - Vessel.class, EchoBaseFunctions.VESSEL_NAME); - - InputFile transectFile = configuration.getTransectFile(); - - switch (configuration.getImportMode()) { - - case ALL: { - - InputFile voyageFile = configuration.getVoyageFile(); - InputFile transitFile = configuration.getTransitFile(); - - CsvFileImportResult voyageResult = importVoyageFile( - voyageFile, configuration); - - CsvFileImportResult transitResult = importTransitFile( - transitFile, configuration); - - CsvFileImportResult transectResult = importTransectFile( - transectFile, vesselMap, configuration); - - addResultAndLog(result, voyageFile, voyageResult, user); - addResultAndLog(result, transitFile, transitResult, user); - addResultAndLog(result, transectFile, transectResult, user); - } - break; - case TRANSECT: { - - CsvFileImportResult transectResult = importTransectFile( - transectFile, vesselMap, configuration); - - addResultAndLog(result, transectFile, transectResult, user); - } - break; - } - return result; - } - - - public Mission createMission(Mission mission) throws MissionNameAlreadyExistException { - - Preconditions.checkNotNull(mission); - - try { - MissionDAO dao = getDAO(Mission.class, MissionDAO.class); - - // check mission name is unique - boolean exists = dao.existByProperties(Mission.PROPERTY_NAME, - mission.getName()); - - if (exists) { - throw new MissionNameAlreadyExistException(); - } - Mission result = create(dao, mission); - commitTransaction("Could not create mission " + - mission.getName()); - return result; - } catch (TopiaException eee) { - throw new EchoBaseTechnicalException(eee); - } - } - - protected CsvFileImportResult importVoyageFile( - InputFile inputFile, - CommonDataImportConfiguration configuration) throws ImportException { - - Mission mission = getEntityById(Mission.class, - configuration.getMissionId()); - AreaOfOperation areaOfOperation = - getEntityById(AreaOfOperation.class, - configuration.getAreaOfOperationId()); - - CsvFileImportResult importResult = new CsvFileImportResult( - inputFile.getFileName()); - - String voyageDescription = configuration.getVoyageDescription(); - String datum = configuration.getDatum(); - - VoyageDAO dao = getDAO(Voyage.class, VoyageDAO.class); - - ImportModel<Voyage> csvModel = new VoyageImportModel(getCsvSeparator()); - - Voyage newVoyage = null; - Locale locale = getLocale(); - Reader reader = getInputFileReader(inputFile); - try { - Import<Voyage> importer = EchoBaseImport.newImport(csvModel, reader); - - configuration.incrementsProgression(); - for (Voyage voyage : importer) { - - configuration.incrementsProgression(); - - voyage.setMission(mission); - voyage.setAreaOfOperation(areaOfOperation); - voyage.setDescription(voyageDescription); - voyage.setDatum(datum); - - Voyage createdVoyage = create(dao, voyage); - if (newVoyage == null) { - newVoyage = createdVoyage; - } else { - // this means a voyage file with more than one row not possible... - - throw new ImportException( - l_(locale, "echobase.importError.can.only.import.one.voyage.atime")); - } - - importResult.incrementsNumberCreated(EchoBaseEntityEnum.Voyage); - } - - if (newVoyage == null) { - throw new ImportException( - l_(locale, "echobase.importError.no.voyage.imported")); - } - - // push back to id of the voyage in configuration for next imports - configuration.setVoyageId(newVoyage.getTopiaId()); - - return importResult; - } catch (ImportRuntimeException e) { - throw new ImportException(locale, inputFile, e); - } finally { - closeReader(reader, inputFile); - } - } - - protected CsvFileImportResult importTransitFile( - InputFile inputFile, - CommonDataImportConfiguration configuration) throws ImportException { - - CsvFileImportResult importResult = new CsvFileImportResult( - inputFile.getFileName()); - - // get voyage - Voyage voyage = getEntityById(Voyage.class, - configuration.getVoyageId()); - - // restrict voyage to use to this voyage - Map<String, Voyage> voyageMap = Maps.uniqueIndex( - Arrays.asList(voyage), EchoBaseFunctions.VOYAGE_NAME); - - String relatedActivity = configuration.getTransitRelatedActivity(); - - TransitImportModel csvModel = - new TransitImportModel(getCsvSeparator(), voyageMap); - - TransitDAO dao = getDAO(Transit.class, TransitDAO.class); - - Reader reader = getInputFileReader(inputFile); - try { - Import<TransitImportRow> importer = - EchoBaseImport.newImport(csvModel, reader); - - configuration.incrementsProgression(); - for (TransitImportRow row : importer) { - - configuration.incrementsProgression(); - Transit transit = row.getTransit(); - - transit.setRelatedActivity(relatedActivity); - - Transit createdTransit = create(dao, transit); - - voyage.addTransit(createdTransit); - - importResult.incrementsNumberCreated(EchoBaseEntityEnum.Transit); - } - return importResult; - } catch (ImportRuntimeException e) { - throw new ImportException(getLocale(), inputFile, e); - } finally { - closeReader(reader, inputFile); - } - } - - private CsvFileImportResult importTransectFile( - InputFile inputFile, - Map<String, Vessel> vesselMap, - CommonDataImportConfiguration configuration) throws ImportException { - - CsvFileImportResult importResult = new CsvFileImportResult( - inputFile.getFileName()); - - // get voyage - Voyage voyage = getEntityById(Voyage.class, - configuration.getVoyageId()); - - // restrict voyage to use to this voyage - Map<String, Voyage> voyageMap = Maps.uniqueIndex( - Arrays.asList(voyage), EchoBaseFunctions.VOYAGE_NAME); - - String datum = configuration.getDatum(); - String license = configuration.getTransectLicence(); - String geospatialVerticalPositive = - configuration.getTransectGeospatialVerticalPositive(); - String binUnitsPingAxis = configuration.getTransectBinUnitsPingAxis(); - - TransectImportModel csvModel = - new TransectImportModel(getCsvSeparator(), - voyageMap, - vesselMap); - - TransectDAO dao = getDAO(Transect.class, TransectDAO.class); - - Reader reader = getInputFileReader(inputFile); - try { - Import<TransectImportRow> importer = - EchoBaseImport.newImport(csvModel, reader); - - configuration.incrementsProgression(); - for (TransectImportRow row : importer) { - - configuration.incrementsProgression(); - Transect transect = row.getTransect(); - - Date timeCoverageStart = transect.getTimeCoverageStart(); - Date timeCoverageEnd = transect.getTimeCoverageEnd(); - - Transit transit = voyage.getTransit(timeCoverageStart, - timeCoverageEnd); - if (transit == null) { - throw new ImportException( - l_(getLocale(), "echobase.importError.no.transit.between.date", - voyage.getName(), timeCoverageStart, timeCoverageEnd)); - } - - transect.setDatum(datum); - transect.setLicence(license); - transect.setGeospatialVerticalPositive( - geospatialVerticalPositive); - transect.setBinUnitsPingAxis(binUnitsPingAxis); - - Transect createdTransect = create(dao, transect); - - transit.addTransect(createdTransect); - importResult.incrementsNumberCreated(EchoBaseEntityEnum.Transect); - } - - return importResult; - - } catch (ImportRuntimeException e) { - throw new ImportException(getLocale(), inputFile, e); - } finally { - closeReader(reader, inputFile); - } - } - - -} Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportConfiguration.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportConfiguration.java 2012-03-30 16:46:14 UTC (rev 460) @@ -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 CommonImportConfiguration extends AbstractImportConfiguration { + + private static final long serialVersionUID = 1L; + + /** Selected import mode. */ + protected CommonImportMode 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 CommonImportConfiguration(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 CommonImportMode getImportMode() { + return importMode; + } + + public void setImportMode(CommonImportMode 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/CommonImportConfiguration.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/CommonImportMode.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportMode.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportMode.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportMode.java 2012-03-30 16:46:14 UTC (rev 460) @@ -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 CommonImportMode 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; + + CommonImportMode(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/CommonImportMode.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/CommonImportService.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonDataImportService.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportService.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportService.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,347 @@ +/* + * #%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 com.google.common.base.Preconditions; +import com.google.common.collect.Maps; +import fr.ifremer.echobase.EchoBaseFunctions; +import fr.ifremer.echobase.EchoBaseTechnicalException; +import fr.ifremer.echobase.InputFile; +import fr.ifremer.echobase.csv.CsvFileImportResult; +import fr.ifremer.echobase.csv.EchoBaseImport; +import fr.ifremer.echobase.entities.EchoBaseEntityEnum; +import fr.ifremer.echobase.entities.EchoBaseUser; +import fr.ifremer.echobase.entities.data.Transect; +import fr.ifremer.echobase.entities.data.TransectDAO; +import fr.ifremer.echobase.entities.data.Transit; +import fr.ifremer.echobase.entities.data.TransitDAO; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.data.VoyageDAO; +import fr.ifremer.echobase.entities.references.AreaOfOperation; +import fr.ifremer.echobase.entities.references.Mission; +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.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.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.topia.TopiaException; +import org.nuiton.util.csv.Import; +import org.nuiton.util.csv.ImportModel; +import org.nuiton.util.csv.ImportRuntimeException; + +import java.io.Reader; +import java.util.Arrays; +import java.util.Date; +import java.util.Locale; +import java.util.Map; + +import static org.nuiton.i18n.I18n.l_; + +/** + * Service to launch a "common data" import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class CommonImportService extends AbstractImportDataService<CommonImportConfiguration> { + + /** Logger. */ + private static final Log log = LogFactory.getLog(CommonImportService.class); + + @Override + protected String getImportLabel() { + return l_(getLocale(), ImportMode.Common.getI18nKey()); + } + + @Override + protected void startImport( + CommonImportConfiguration configuration, + EchoBaseUser user) throws ImportException { + + // get usable vessels + Map<String, Vessel> vesselMap = getEntitiesMap( + Vessel.class, EchoBaseFunctions.VESSEL_NAME); + + switch (configuration.getImportMode()) { + + case ALL: { + + CsvFileImportResult importResult; + + importResult = importVoyageFile(configuration); + configuration.addResult(importResult); + + importResult = importTransitFile(configuration); + configuration.addResult(importResult); + + importResult = importTransectFile(vesselMap, configuration); + configuration.addResult(importResult); + } + break; + case TRANSECT: { + + CsvFileImportResult importResult; + + importResult = importTransectFile(vesselMap, configuration); + configuration.addResult(importResult); + } + break; + } + } + + + public Mission createMission(Mission mission) throws MissionNameAlreadyExistException { + + Preconditions.checkNotNull(mission); + + try { + MissionDAO dao = getDAO(Mission.class, MissionDAO.class); + + // check mission name is unique + boolean exists = dao.existByProperties(Mission.PROPERTY_NAME, + mission.getName()); + + if (exists) { + throw new MissionNameAlreadyExistException(); + } + Mission result = create(dao, mission); + commitTransaction("Could not create mission " + + mission.getName()); + return result; + } catch (TopiaException eee) { + throw new EchoBaseTechnicalException(eee); + } + } + + protected CsvFileImportResult importVoyageFile( + CommonImportConfiguration configuration) throws ImportException { + + InputFile inputFile = configuration.getVoyageFile(); + + if (log.isInfoEnabled()) { + log.info("Starts import of voyages from file " + + inputFile.getFileName()); + } + + Mission mission = getEntityById(Mission.class, + configuration.getMissionId()); + AreaOfOperation areaOfOperation = + getEntityById(AreaOfOperation.class, + configuration.getAreaOfOperationId()); + + CsvFileImportResult importResult = new CsvFileImportResult( + inputFile.getFileName()); + + String voyageDescription = configuration.getVoyageDescription(); + String datum = configuration.getDatum(); + + VoyageDAO dao = getDAO(Voyage.class, VoyageDAO.class); + + ImportModel<Voyage> csvModel = new VoyageImportModel(getCsvSeparator()); + + Voyage newVoyage = null; + Locale locale = getLocale(); + Reader reader = getInputFileReader(inputFile); + try { + Import<Voyage> importer = EchoBaseImport.newImport(csvModel, reader); + + configuration.incrementsProgression(); + for (Voyage voyage : importer) { + + configuration.incrementsProgression(); + + voyage.setMission(mission); + voyage.setAreaOfOperation(areaOfOperation); + voyage.setDescription(voyageDescription); + voyage.setDatum(datum); + + Voyage createdVoyage = create(dao, voyage); + if (newVoyage == null) { + newVoyage = createdVoyage; + } else { + // this means a voyage file with more than one row not possible... + + throw new ImportException( + l_(locale, "echobase.importError.can.only.import.one.voyage.atime")); + } + + importResult.incrementsNumberCreated(EchoBaseEntityEnum.Voyage); + } + + if (newVoyage == null) { + throw new ImportException( + l_(locale, "echobase.importError.no.voyage.imported")); + } + + // push back to id of the voyage in configuration for next imports + configuration.setVoyageId(newVoyage.getTopiaId()); + + return importResult; + } catch (ImportRuntimeException e) { + throw new ImportException(locale, inputFile, e); + } finally { + closeReader(reader, inputFile); + } + } + + protected CsvFileImportResult importTransitFile( + CommonImportConfiguration configuration) throws ImportException { + + InputFile inputFile = configuration.getTransitFile(); + + if (log.isInfoEnabled()) { + log.info("Starts import of transits from file " + + inputFile.getFileName()); + } + CsvFileImportResult importResult = new CsvFileImportResult( + inputFile.getFileName()); + + // get voyage + Voyage voyage = getEntityById(Voyage.class, + configuration.getVoyageId()); + + // restrict voyage to use to this voyage + Map<String, Voyage> voyageMap = Maps.uniqueIndex( + Arrays.asList(voyage), EchoBaseFunctions.VOYAGE_NAME); + + String relatedActivity = configuration.getTransitRelatedActivity(); + + TransitImportModel csvModel = + new TransitImportModel(getCsvSeparator(), voyageMap); + + TransitDAO dao = getDAO(Transit.class, TransitDAO.class); + + Reader reader = getInputFileReader(inputFile); + try { + Import<TransitImportRow> importer = + EchoBaseImport.newImport(csvModel, reader); + + configuration.incrementsProgression(); + for (TransitImportRow row : importer) { + + configuration.incrementsProgression(); + Transit transit = row.getTransit(); + + transit.setRelatedActivity(relatedActivity); + + Transit createdTransit = create(dao, transit); + + voyage.addTransit(createdTransit); + + importResult.incrementsNumberCreated(EchoBaseEntityEnum.Transit); + } + return importResult; + } catch (ImportRuntimeException e) { + throw new ImportException(getLocale(), inputFile, e); + } finally { + closeReader(reader, inputFile); + } + } + + private CsvFileImportResult importTransectFile( + Map<String, Vessel> vesselMap, + CommonImportConfiguration configuration) throws ImportException { + + InputFile inputFile = configuration.getTransectFile(); + + if (log.isInfoEnabled()) { + log.info("Starts import of transects from file " + + inputFile.getFileName()); + } + + CsvFileImportResult importResult = new CsvFileImportResult( + inputFile.getFileName()); + + // get voyage + Voyage voyage = getEntityById(Voyage.class, + configuration.getVoyageId()); + + // restrict voyage to use to this voyage + Map<String, Voyage> voyageMap = Maps.uniqueIndex( + Arrays.asList(voyage), EchoBaseFunctions.VOYAGE_NAME); + + String datum = configuration.getDatum(); + String license = configuration.getTransectLicence(); + String geospatialVerticalPositive = + configuration.getTransectGeospatialVerticalPositive(); + String binUnitsPingAxis = configuration.getTransectBinUnitsPingAxis(); + + TransectImportModel csvModel = + new TransectImportModel(getCsvSeparator(), + voyageMap, + vesselMap); + + TransectDAO dao = getDAO(Transect.class, TransectDAO.class); + + Reader reader = getInputFileReader(inputFile); + try { + Import<TransectImportRow> importer = + EchoBaseImport.newImport(csvModel, reader); + + configuration.incrementsProgression(); + for (TransectImportRow row : importer) { + + configuration.incrementsProgression(); + Transect transect = row.getTransect(); + + Date timeCoverageStart = transect.getTimeCoverageStart(); + Date timeCoverageEnd = transect.getTimeCoverageEnd(); + + Transit transit = voyage.getTransit(timeCoverageStart, + timeCoverageEnd); + if (transit == null) { + throw new ImportException( + l_(getLocale(), "echobase.importError.no.transit.between.date", + voyage.getName(), timeCoverageStart, timeCoverageEnd)); + } + + transect.setDatum(datum); + transect.setLicence(license); + transect.setGeospatialVerticalPositive( + geospatialVerticalPositive); + transect.setBinUnitsPingAxis(binUnitsPingAxis); + + Transect createdTransect = create(dao, transect); + + transit.addTransect(createdTransect); + importResult.incrementsNumberCreated(EchoBaseEntityEnum.Transect); + } + + return importResult; + + } catch (ImportRuntimeException e) { + throw new ImportException(getLocale(), inputFile, e); + } finally { + closeReader(reader, inputFile); + } + } + + +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/CommonImportService.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/importdata/ImportDataMode.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportDataMode.java 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportDataMode.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,63 +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.importdata; - -import fr.ifremer.echobase.I18nAble; - -import static org.nuiton.i18n.I18n.n_; - -/** - * To define the mode of import data (says files to be imported). - * - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public enum ImportDataMode implements I18nAble { - - /** Import Voyage / Transit / Transect. */ - CommonData(n_("echobase.common.importDataMode.commonData")), - - /** Import operations common data. */ - Operation(n_("echobase.common.importDataMode.operation")), - - /** Import catches data (unsorted, total, but no individual ones). */ - CatchesData(n_("echobase.common.importDataMode.catchesData")), - - /** Import accoustic data (Cells ESDU and Elementary). */ - AccousticData(n_("echobase.common.importDataMode.accousticData")), - - /** Import results. */ - Results(n_("echobase.common.importDataMode.results")); - - private final String i18nKey; - - ImportDataMode(String i18nKey) { - this.i18nKey = i18nKey; - } - - @Override - public String getI18nKey() { - return i18nKey; - } -} Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportMode.java (from rev 458, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportDataMode.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportMode.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportMode.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,63 @@ +/* + * #%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.importdata; + +import fr.ifremer.echobase.I18nAble; + +import static org.nuiton.i18n.I18n.n_; + +/** + * To define the mode of import data (says files to be imported). + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public enum ImportMode implements I18nAble { + + /** Import Voyage / Transit / Transect. */ + Common(n_("echobase.common.importMode.common")), + + /** Import operations common data. */ + Operation(n_("echobase.common.importMode.operation")), + + /** Import catches data (unsorted, total, but no individual ones). */ + Catches(n_("echobase.common.importMode.catches")), + + /** Import accoustic data (Cells ESDU and Elementary). */ + Acoustic(n_("echobase.common.importMode.acoustic")), + + /** Import results. */ + Results(n_("echobase.common.importMode.results")); + + private final String i18nKey; + + ImportMode(String i18nKey) { + this.i18nKey = i18nKey; + } + + @Override + public String getI18nKey() { + return i18nKey; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ImportMode.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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/OperationImportService.java 2012-03-30 16:46:14 UTC (rev 460) @@ -23,7 +23,6 @@ */ package fr.ifremer.echobase.services.importdata; -import com.google.common.collect.Lists; import com.google.common.collect.Maps; import fr.ifremer.echobase.EchoBaseFunctions; import fr.ifremer.echobase.InputFile; @@ -60,7 +59,6 @@ import java.io.Reader; import java.util.Collection; import java.util.Date; -import java.util.List; import java.util.Map; import static org.nuiton.i18n.I18n.l_; @@ -79,16 +77,14 @@ @Override protected String getImportLabel() { - return l_(getLocale(), ImportDataMode.Operation.getI18nKey()); + return l_(getLocale(), ImportMode.Operation.getI18nKey()); } @Override - protected List<CsvFileImportResult> startImport( + protected void startImport( OperationImportConfiguration configuration, EchoBaseUser user) throws ImportException { - List<CsvFileImportResult> result = Lists.newLinkedList(); - // get selected voyage Voyage voyage = getEntityById(Voyage.class, configuration.getVoyageId()); @@ -101,13 +97,14 @@ Map<String, Gear> gearMap = getEntitiesMap( Gear.class, EchoBaseFunctions.GEAR_CASINO_GEAR_NAME); - InputFile operationFile = configuration.getOperationFile(); - CsvFileImportResult nbOperations = importOperationFile( + CsvFileImportResult importResult; + + importResult = importOperationFile( configuration, - operationFile, voyage, vesselMap, gearMap); + configuration.addResult(importResult); // get all operation for this voyage and this vessel Collection<Operation> operations = voyage.getAllOperations(); @@ -116,37 +113,29 @@ Map<String, Operation> operationMap = Maps.uniqueIndex( operations, EchoBaseFunctions.OPERATION_ID); - InputFile operationMetadataFile = configuration.getOperationMetadataFile(); - CsvFileImportResult nbOperationMetas = importOperationMetadataFile( + importResult = importOperationMetadataFile( configuration, - operationMetadataFile, vesselMap, operationMap); + configuration.addResult(importResult); - InputFile gearMetadataFile = configuration.getGearMetadataFile(); - CsvFileImportResult nbGearMetas = importGearMetadataFile( + importResult = importGearMetadataFile( configuration, - gearMetadataFile, vesselMap, gearMap, operationMap); - - addResultAndLog(result, operationFile, nbOperations, user); - - addResultAndLog(result, operationMetadataFile, nbOperationMetas, user); - - addResultAndLog(result, gearMetadataFile, nbGearMetas, user); - - return result; + configuration.addResult(importResult); } protected CsvFileImportResult importOperationFile( OperationImportConfiguration configuration, - InputFile inputFile, Voyage voyage, Map<String, Vessel> vesselMap, Map<String, Gear> gearMap) throws ImportException { + + InputFile inputFile = configuration.getOperationFile(); + if (log.isInfoEnabled()) { log.info("Starts import of operation from file " + inputFile.getFileName()); @@ -203,10 +192,11 @@ protected CsvFileImportResult importOperationMetadataFile( OperationImportConfiguration configuration, - InputFile inputFile, Map<String, Vessel> vesselMap, Map<String, Operation> operationMap) throws ImportException { + InputFile inputFile = configuration.getOperationMetadataFile(); + if (log.isInfoEnabled()) { log.info("Starts import of operation metadata values from file " + inputFile.getFileName()); @@ -258,11 +248,12 @@ protected CsvFileImportResult importGearMetadataFile( OperationImportConfiguration configuration, - InputFile inputFile, Map<String, Vessel> vesselMap, Map<String, Gear> gearMap, Map<String, Operation> operationMap) throws ImportException { + InputFile inputFile = configuration.getGearMetadataFile(); + if (log.isInfoEnabled()) { log.info("Starts import of gear metadata values from file " + inputFile.getFileName()); 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsEsduCellImportService.java 2012-03-30 16:46:14 UTC (rev 460) @@ -23,7 +23,6 @@ */ package fr.ifremer.echobase.services.importdata; -import com.google.common.collect.Lists; import com.google.common.collect.Maps; import fr.ifremer.echobase.EchoBaseFunctions; import fr.ifremer.echobase.InputFile; @@ -81,11 +80,11 @@ @Override protected String getImportLabel() { - return l_(getLocale(), ImportDataMode.Results.getI18nKey()); + return l_(getLocale(), ImportMode.Results.getI18nKey()); } @Override - public List<CsvFileImportResult> startImport( + public void startImport( ResultsImportConfiguration configuration, EchoBaseUser user) throws ImportException { @@ -119,13 +118,13 @@ Map<String, Echotype> echotypeMap = Maps.uniqueIndex( voyage.getEchotype(), EchoBaseFunctions.ECHOTYPE_NAME); - List<CsvFileImportResult> result = Lists.newLinkedList(); - InputFile inputFile; + CsvFileImportResult importResult; inputFile = configuration.getEsduByEchotypeFile(); if (inputFile.hasFile()) { - CsvFileImportResult importResult = importByEchotypeFile( + + importResult = importByEchotypeFile( configuration, inputFile, voyage, @@ -133,12 +132,12 @@ dataMetadataMap, esduCellMap ); - addResultAndLog(result, inputFile, importResult, user); + configuration.addResult(importResult); } inputFile = configuration.getEsduByEchotypeAndSpeciesCategoryFile(); if (inputFile.hasFile()) { - CsvFileImportResult importResult = importByEchotypeAndSpeciesCategoryFile( + importResult = importByEchotypeAndSpeciesCategoryFile( configuration, inputFile, voyage, @@ -148,12 +147,12 @@ sizeCategoryMap, esduCellMap ); - addResultAndLog(result, inputFile, importResult, user); + configuration.addResult(importResult); } inputFile = configuration.getEsduBySpeciesAndSizeCategoryFile(); if (inputFile.hasFile()) { - CsvFileImportResult importResult = importBySpeciesAndSizeCategoryFile( + importResult = importBySpeciesAndSizeCategoryFile( configuration, inputFile, voyage, @@ -162,13 +161,13 @@ sizeCategoryMap, esduCellMap ); - addResultAndLog(result, inputFile, importResult, user); + configuration.addResult(importResult); } inputFile = configuration.getEsduBySpeciesAndAgeCategoryFile(); if (inputFile.hasFile()) { - CsvFileImportResult importResult = importBySpeciesAndAgeCategoryFile( + importResult = importBySpeciesAndAgeCategoryFile( configuration, inputFile, voyage, @@ -177,9 +176,8 @@ ageCategoryMap, esduCellMap ); - addResultAndLog(result, inputFile, importResult, user); + configuration.addResult(importResult); } - return result; } private CsvFileImportResult importByEchotypeFile( 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsImportService.java 2012-03-30 16:46:14 UTC (rev 460) @@ -25,7 +25,6 @@ import com.google.common.collect.Maps; import fr.ifremer.echobase.EchoBaseTechnicalException; -import fr.ifremer.echobase.csv.CsvFileImportResult; import fr.ifremer.echobase.entities.EchoBaseUser; import fr.ifremer.echobase.entities.data.DataAcquisition; import fr.ifremer.echobase.entities.data.DataProcessing; @@ -36,7 +35,6 @@ import fr.ifremer.echobase.services.ImportException; import org.nuiton.util.decorator.Decorator; -import java.util.List; import java.util.Map; import static org.nuiton.i18n.I18n.l_; @@ -51,12 +49,12 @@ @Override protected String getImportLabel() { - return l_(getLocale(), ImportDataMode.Results.getI18nKey()); + return l_(getLocale(), ImportMode.Results.getI18nKey()); } @Override - public List<CsvFileImportResult> startImport(ResultsImportConfiguration configuration, - EchoBaseUser user) throws ImportException { + public void startImport(ResultsImportConfiguration configuration, + EchoBaseUser user) throws ImportException { ResultsImportMode importMode = configuration.getImportMode(); @@ -87,9 +85,7 @@ "Can not treate import result of type " + importMode); } - List<CsvFileImportResult> result; - result = service.startImport(configuration, user); - return result; + service.startImport(configuration, user); } public Map<String, String> getDataProcessings(Voyage voyage) { 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsMapCellImportService.java 2012-03-30 16:46:14 UTC (rev 460) @@ -24,7 +24,6 @@ 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; @@ -76,11 +75,11 @@ @Override protected String getImportLabel() { - return l_(getLocale(), ImportDataMode.Results.getI18nKey()); + return l_(getLocale(), ImportMode.Results.getI18nKey()); } @Override - public List<CsvFileImportResult> startImport( + public void startImport( ResultsImportConfiguration configuration, EchoBaseUser user) throws ImportException { @@ -88,21 +87,22 @@ Voyage voyage = getEntityById(Voyage.class, configuration.getVoyageId()); - InputFile inputFile = configuration.getMapsFile(); - CsvFileImportResult importResult = importMapFile(configuration, - inputFile, - voyage); - - List<CsvFileImportResult> result = Lists.newLinkedList(); - addResultAndLog(result, inputFile, importResult, user); - return result; + CsvFileImportResult importResult; + importResult = importMapFile(configuration, voyage); + configuration.addResult(importResult); } protected CsvFileImportResult importMapFile( ResultsImportConfiguration configuration, - InputFile inputFile, Voyage voyage) throws ImportException { + InputFile inputFile = configuration.getMapsFile(); + + if (log.isInfoEnabled()) { + log.info("Starts import of Map cells from file " + + inputFile.getFileName()); + } + String resultLabel = configuration.getResultLabel(); CellType cellType = getEntityByProperty( @@ -169,11 +169,6 @@ ageCategoryMap, metas); - if (log.isInfoEnabled()) { - log.info("Starts import of Map cells from file " + - inputFile.getFileName()); - } - CsvFileImportResult importResult = new CsvFileImportResult( inputFile.getFileName()); 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsRegionCellImportService.java 2012-03-30 16:46:14 UTC (rev 460) @@ -24,7 +24,6 @@ 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; @@ -80,49 +79,36 @@ @Override protected String getImportLabel() { - return l_(getLocale(), ImportDataMode.Results.getI18nKey()); + return l_(getLocale(), ImportMode.Results.getI18nKey()); } @Override - public List<CsvFileImportResult> startImport( + public void startImport( ResultsImportConfiguration configuration, EchoBaseUser user) throws ImportException { - List<CsvFileImportResult> result = Lists.newLinkedList(); - // get selected voyage Voyage voyage = getEntityById(Voyage.class, configuration.getVoyageId()); - InputFile inputFile = configuration.getRegionsFile(); - CsvFileImportResult importResult = importRegionFile( - configuration, - inputFile, voyage); + CsvFileImportResult importResult; - addResultAndLog(result, inputFile, importResult, user); + importResult = importRegionFile(configuration, voyage); + configuration.addResult(importResult); - inputFile = configuration.getRegionAssociationFile(); - importResult = importRegionAssociationFile( - configuration, - inputFile, - voyage); - addResultAndLog(result, inputFile, importResult, user); + importResult = importRegionAssociationFile(configuration, voyage); + configuration.addResult(importResult); - inputFile = configuration.getRegionResultFile(); - importResult = importRegionResultFile( - configuration, - inputFile, voyage); - - addResultAndLog(result, inputFile, importResult, user); - - return result; + importResult = importRegionResultFile(configuration, voyage); + configuration.addResult(importResult); } protected CsvFileImportResult importRegionFile( ResultsImportConfiguration configuration, - InputFile inputFile, Voyage voyage) throws ImportException { + InputFile inputFile = configuration.getRegionsFile(); + CellType cellSurfaceType = getEntityByProperty( CellType.class, CellType.PROPERTY_ID, "RegionSURF"); Preconditions.checkNotNull(cellSurfaceType); @@ -214,9 +200,10 @@ protected CsvFileImportResult importRegionAssociationFile( ResultsImportConfiguration configuration, - InputFile inputFile, Voyage voyage) throws ImportException { + InputFile inputFile = configuration.getRegionAssociationFile(); + if (log.isInfoEnabled()) { log.info("Starts import of Region cells association from file " + inputFile.getFileName()); @@ -265,9 +252,10 @@ protected CsvFileImportResult importRegionResultFile( ResultsImportConfiguration configuration, - InputFile inputFile, Voyage voyage) throws ImportException { + InputFile inputFile = configuration.getRegionResultFile(); + if (log.isInfoEnabled()) { log.info("Starts import of Map cell results from file " + inputFile.getFileName()); 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/ResultsVoyageImportService.java 2012-03-30 16:46:14 UTC (rev 460) @@ -25,7 +25,6 @@ import com.google.common.base.Predicate; import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; import com.google.common.collect.Maps; import fr.ifremer.echobase.EchoBaseFunctions; import fr.ifremer.echobase.EchoBasePredicates; @@ -61,7 +60,6 @@ import java.io.Reader; import java.util.Arrays; import java.util.Collection; -import java.util.List; import java.util.Map; import static org.nuiton.i18n.I18n.l_; @@ -80,15 +78,13 @@ @Override protected String getImportLabel() { - return l_(getLocale(), ImportDataMode.Results.getI18nKey()); + return l_(getLocale(), ImportMode.Results.getI18nKey()); } @Override - public List<CsvFileImportResult> startImport(ResultsImportConfiguration configuration, - EchoBaseUser user) throws ImportException { + public void startImport(ResultsImportConfiguration configuration, + EchoBaseUser user) throws ImportException { - List<CsvFileImportResult> result = Lists.newLinkedList(); - Map<String, Species> speciesMap = getEntitiesMap( Species.class, EchoBaseFunctions.SPECIES_BARACOUDA_CODE); @@ -101,44 +97,45 @@ Map<String, Voyage> voyageMap = Maps.uniqueIndex(Arrays.asList( voyage), EchoBaseFunctions.VOYAGE_NAME); - InputFile inputFile = configuration.getLengthAgeKeyFile(); + InputFile inputFile; + CsvFileImportResult importResult; + + inputFile = configuration.getLengthAgeKeyFile(); if (inputFile.hasFile()) { - CsvFileImportResult importResult = importLenthAgeKey( + importResult = importLenthAgeKey( configuration, inputFile, voyageMap, speciesMap ); - addResultAndLog(result, inputFile, importResult, user); + configuration.addResult(importResult); } inputFile = configuration.getLengthWeightKeyFile(); if (inputFile.hasFile()) { - CsvFileImportResult importResult = importLenghtWeightKey( + importResult = importLenghtWeightKey( configuration, inputFile, voyageMap, speciesMap ); - addResultAndLog(result, inputFile, importResult, user); + configuration.addResult(importResult); } inputFile = configuration.getEchotypeFile(); if (inputFile.hasFile()) { - CsvFileImportResult importResult = importEchotypeFile( + importResult = importEchotypeFile( configuration, inputFile, voyageMap, speciesMap ); - addResultAndLog(result, inputFile, importResult, user); + configuration.addResult(importResult); } - - return result; } protected CsvFileImportResult importLenghtWeightKey( Deleted: 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/AcousticDataImportModel.java 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportModel.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,132 +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.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> { - - 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 Deleted: 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/AcousticDataImportRow.java 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticDataImportRow.java 2012-03-30 16:46:14 UTC (rev 460) @@ -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.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; - } -} Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportModel.java (from rev 458, 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/AcousticImportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportModel.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,132 @@ +/* + * #%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 AcousticImportModel extends AbstractImportModel<AcousticImportRow> { + + public AcousticImportModel(char separator, + Map<String, AcousticInstrument> instrumentsById) { + super(separator); + + newMandatoryColumn("MOVIES_EILayer", AcousticImportRow.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", AcousticImportRow.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", AcousticImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_ABSORPTION, EchobaseCsvUtil.FLOAT);//M + newMandatoryColumn("MOVIES_EILayer\\sndset\\transmissionPower", AcousticImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_POWER, EchobaseCsvUtil.INTEGER);//N + newMandatoryColumn("MOVIES_EILayer\\sndset\\beamAlongAngleSensitivity", AcousticImportRow.PROPERTY_TRANSDUCER_ACQUISITION_BEAM_ANGLE_ALONGSHIP, EchobaseCsvUtil.FLOAT);//O + newMandatoryColumn("MOVIES_EILayer\\sndset\\beamAthwartAngleSensitivity", AcousticImportRow.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", AcousticImportRow.PROPERTY_TRANSDUCER_ACQUISITION_PSI, EchobaseCsvUtil.FLOAT);//S + newMandatoryColumn("MOVIES_EILayer\\sndset\\beamGain", AcousticImportRow.PROPERTY_TRANSCEIVER_ACQUISITION_GAIN, EchobaseCsvUtil.FLOAT);//T + newMandatoryColumn("MOVIES_EILayer\\sndset\\beamSACorrection", AcousticImportRow.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", AcousticImportRow.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", AcousticImportRow.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", AcousticImportRow.PROPERTY_CELL_NUM, EchobaseCsvUtil.PRIMITIVE_INTEGER);//AX + newMandatoryColumn("MOVIES_EILayer\\cellset\\celltype", AcousticImportRow.PROPERTY_CELL_TYPE, EchobaseCsvUtil.PRIMITIVE_INTEGER);//AY + newMandatoryColumn("MOVIES_EILayer\\cellset\\depthstart", AcousticImportRow.PROPERTY_CELL_DEPTH_START, EchobaseCsvUtil.PRIMITIVE_FLOAT);//AZ + newMandatoryColumn("MOVIES_EILayer\\cellset\\depthend", AcousticImportRow.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", AcousticImportRow.PROPERTY_CELL_DATE_START, EchobaseCsvUtil.IMPORT_DAY_TIME3);//BD + newMandatoryColumn("MOVIES_EILayer\\cellset\\dateend", AcousticImportRow.PROPERTY_CELL_DATE_END, EchobaseCsvUtil.IMPORT_DAY_TIME3);//BE + + newMandatoryColumn("MOVIES_EILayer\\cellset\\lat", AcousticImportRow.PROPERTY_CELL_LATITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BF + newMandatoryColumn("MOVIES_EILayer\\cellset\\long", AcousticImportRow.PROPERTY_CELL_LONGITUDE, EchobaseCsvUtil.PRIMITIVE_FLOAT);//BG + newMandatoryColumn("MOVIES_EILayer\\cellset\\volume", AcousticImportRow.PROPERTY_CELL_VOLUME, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BH + newMandatoryColumn("MOVIES_EILayer\\cellset\\area", AcousticImportRow.PROPERTY_CELL_SURFACE, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BI + newIgnoredColumn("MOVIES_EILayer\\cellset\\diststart");//BJ + newIgnoredColumn("MOVIES_EILayer\\cellset\\distend");//BK + newMandatoryColumn("MOVIES_EILayer\\cellset\\thresholdup", AcousticImportRow.PROPERTY_E_ITHRESHOLD_HIGH, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BL + newMandatoryColumn("MOVIES_EILayer\\cellset\\thresholdlow", AcousticImportRow.PROPERTY_E_ITHRESHOLD_LOW, EchobaseCsvUtil.PRIMITIVE_INTEGER);//BM + newIgnoredColumn("MOVIES_EILayer\\eilayer");//BN + newMandatoryColumn("MOVIES_EILayer\\eilayer\\sa", AcousticImportRow.PROPERTY_CELL_NASC, EchobaseCsvUtil.NA_TO_FLOAT_PARSER);//BO + newIgnoredColumn("MOVIES_EILayer\\eilayer\\sv");//BP + newMandatoryColumn("MOVIES_EILayer\\eilayer\\ni", AcousticImportRow.PROPERTY_CELL_NUMBER_OF_SAMPLES_ECHO_INTEGRATED, EchobaseCsvUtil.NA_TO_INTEGER_PARSER);//BQ + newMandatoryColumn("MOVIES_EILayer\\eilayer\\nt", AcousticImportRow.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", AcousticImportRow.PROPERTY_SOUND_CELERITY);//BV + } + + @Override + public AcousticImportRow newEmptyInstance() { + return new AcousticImportRow(); + } +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportModel.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/AcousticImportRow.java (from rev 458, 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/AcousticImportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/importdata/csv/AcousticImportRow.java 2012-03-30 16:46:14 UTC (rev 460) @@ -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 AcousticImportModel} import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class AcousticImportRow { + + 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/AcousticImportRow.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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/resources/i18n/echobase-services_en_GB.properties 2012-03-30 16:46:14 UTC (rev 460) @@ -14,12 +14,12 @@ echobase.common.esduBySpeciesAndAgeCategoryFile= echobase.common.esduBySpeciesAndSizeCategoryFile= echobase.common.gearMetadataFile= -echobase.common.importDataMode.accousticData= -echobase.common.importDataMode.catchesData= -echobase.common.importDataMode.commonData= -echobase.common.importDataMode.operation= -echobase.common.importDataMode.results= echobase.common.importDbFile= +echobase.common.importMode.acoustic= +echobase.common.importMode.catches= +echobase.common.importMode.common= +echobase.common.importMode.operation= +echobase.common.importMode.results= echobase.common.lengthAgeKeyFile= echobase.common.lengthWeightKeyFile= echobase.common.moviesFile= 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties 2012-03-30 16:46:14 UTC (rev 460) @@ -14,12 +14,12 @@ echobase.common.esduBySpeciesAndAgeCategoryFile=Fichier ESDU / Espèce / Catégorie Age echobase.common.esduBySpeciesAndSizeCategoryFile=Fichier ESDU / Espèce / Catégorie Taille 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 -echobase.common.importDataMode.commonData=Import Voyage / Transit / Transect -echobase.common.importDataMode.operation=Import des opérations -echobase.common.importDataMode.results=Import des résultats echobase.common.importDbFile=Fichier d'import (zip) +echobase.common.importMode.acoustic=Import des données acoustiques +echobase.common.importMode.catches=Import des données de pêche +echobase.common.importMode.common=Import Voyage / Transit / Transect +echobase.common.importMode.operation=Import des opérations +echobase.common.importMode.results=Import des résultats echobase.common.lengthAgeKeyFile=Fichier de relation Taille-Age echobase.common.lengthWeightKeyFile=Fichier de relation Taille-Poids echobase.common.moviesFile=Fichier Movies 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AbstractImportDataServiceIT.java 2012-03-30 16:46:14 UTC (rev 460) @@ -174,7 +174,9 @@ } protected <M extends AbstractImportConfiguration, S extends AbstractImportDataService<M>> - List<CsvFileImportResult> doImport(M conf, Class<S> serviceType, int nbResults) throws ImportException { + List<CsvFileImportResult> doImport(M conf, + Class<S> serviceType, + int nbResults) throws ImportException { S service = getService(serviceType); @@ -182,34 +184,19 @@ long s0 = TimeLog.getTime(); - List<CsvFileImportResult> result = service.doImport(conf, fakeUser); + String resume = service.doImport(conf, fakeUser); TIME_LOG.log(s0, "doImport"); + List<CsvFileImportResult> result = conf.getImportResults(); + Assert.assertNotNull(result); Assert.assertEquals(nbResults, result.size()); assertConfProgressionToEnd(conf); if (log.isInfoEnabled()) { - int index = 0; - for (CsvFileImportResult importResult : result) { - - StringBuilder resultBuffer = - new StringBuilder("Result " + (index++) + " for " + importResult.getImportFileName()); - for (EchoBaseEntityEnum type : importResult.getEntityTypes()) { - resultBuffer.append("\n").append(type.name()); - int numberCreated = importResult.getNumberCreated(type); - int numberUpdated = importResult.getNumberUpdated(type); - if (numberCreated > 0) { - resultBuffer.append(" (created ").append(numberCreated).append(')'); - } - if (numberUpdated > 0) { - resultBuffer.append(" (updated").append(numberUpdated).append(')'); - } - long nbEntities = countEntities(type.getContract()); - resultBuffer.append(" (total count ").append(nbEntities).append(')'); - } - log.info(resultBuffer.toString()); + if (log.isInfoEnabled()) { + log.info('\n' + resume); } } Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticDataImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,98 +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.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.DataAcquisition; -import fr.ifremer.echobase.entities.data.DataProcessing; -import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; -import org.junit.Test; - -import java.util.List; - -/** - * Tests {@link AcousticDataImportService}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class AcousticDataImportServiceIT extends AbstractImportDataServiceIT { - - protected FakeEchoBaseServiceContext initContext() { - return new FakeEchoBaseServiceContext(IMPORT_DATA_ECHOBASE_CATCHES); - } - - protected String[] getImportPath(String filename) { - return new String[]{"/import-data", "acousticData", filename}; - } - - @Test - public void doImport() throws Exception { - - assertImportCommonData(); - - assertNoEntities(DataAcquisition.class, - DataProcessing.class, - Cell.class, - Data.class); - - AcousticDataImportConfiguration conf = - new AcousticDataImportConfiguration(getLocale()); - - conf.setVoyageId(getVoyageId()); - conf.setVesselId(VESSEL_ID); - conf.setAcousticDensityUnit("acousticDensityUnit"); - conf.setAcquisitionSoftwareVersionER60("acquisitionSoftwareVersionER60"); - conf.setAcquisitionSoftwareVersionME70("acquisitionSoftwareVersionME70"); - conf.setAddDataAcquisition(false); - conf.setTransceiverAcquisitionAbsorptionDescription("transceiverAcquisitionAbsorptionDescription"); - conf.setCellPositionReference(CellPositionReference.START); - conf.setDigitThreshold(1.5f); - conf.setLoggedDataDatatype("loggedDataDatatype"); - conf.setLoggedDataFormat("loggedDataFormat"); - conf.setNotes("notes"); - conf.setPingDutyCycle("pingDutyCycle"); - conf.setProcessingDescription("processingDescription"); - conf.setProcessingTemplate("processingTemplate"); - conf.setSoundSpeedCalculationsER60("soundSpeedCalculationsER60"); - conf.setSoundSpeedCalculationsME70("soundSpeedCalculationsME70"); - conf.setTransceiverAcquisitionAbsorptionDescription("transceiverAcquisitionAbsorptionDescription"); - - prepareInputFile(conf.getMoviesFile(), getImportPath("movies.csv.gz")); - - List<CsvFileImportResult> result; - result = doImport(conf, AcousticDataImportService.class, 1); - - assertCsvImportResult(result, 0, DataAcquisition.class, NB_DATA_ACQUISITION); - assertCsvImportResult(result, 0, DataProcessing.class, NB_DATA_PROCESSING); - assertCsvImportResult(result, 0, Cell.class, NB_CELL); - assertCsvImportResult(result, 0, Data.class, NB_DATA); - - assertImportAcousticDatas(); - } - - -} Copied: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticImportServiceIT.java (from rev 458, trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticDataImportServiceIT.java) =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticImportServiceIT.java (rev 0) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,98 @@ +/* + * #%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.csv.CsvFileImportResult; +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 org.junit.Test; + +import java.util.List; + +/** + * Tests {@link AcousticImportService}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class AcousticImportServiceIT extends AbstractImportDataServiceIT { + + protected FakeEchoBaseServiceContext initContext() { + return new FakeEchoBaseServiceContext(IMPORT_DATA_ECHOBASE_CATCHES); + } + + protected String[] getImportPath(String filename) { + return new String[]{"/import-data", "acoustic", filename}; + } + + @Test + public void doImport() throws Exception { + + assertImportCommonData(); + + assertNoEntities(DataAcquisition.class, + DataProcessing.class, + Cell.class, + Data.class); + + AcousticImportConfiguration conf = + new AcousticImportConfiguration(getLocale()); + + conf.setVoyageId(getVoyageId()); + conf.setVesselId(VESSEL_ID); + conf.setAcousticDensityUnit("acousticDensityUnit"); + conf.setAcquisitionSoftwareVersionER60("acquisitionSoftwareVersionER60"); + conf.setAcquisitionSoftwareVersionME70("acquisitionSoftwareVersionME70"); + conf.setAddDataAcquisition(false); + conf.setTransceiverAcquisitionAbsorptionDescription("transceiverAcquisitionAbsorptionDescription"); + conf.setCellPositionReference(CellPositionReference.START); + conf.setDigitThreshold(1.5f); + conf.setLoggedDataDatatype("loggedDataDatatype"); + conf.setLoggedDataFormat("loggedDataFormat"); + conf.setNotes("notes"); + conf.setPingDutyCycle("pingDutyCycle"); + conf.setProcessingDescription("processingDescription"); + conf.setProcessingTemplate("processingTemplate"); + conf.setSoundSpeedCalculationsER60("soundSpeedCalculationsER60"); + conf.setSoundSpeedCalculationsME70("soundSpeedCalculationsME70"); + conf.setTransceiverAcquisitionAbsorptionDescription("transceiverAcquisitionAbsorptionDescription"); + + prepareInputFile(conf.getMoviesFile(), getImportPath("movies.csv.gz")); + + List<CsvFileImportResult> result; + result = doImport(conf, AcousticImportService.class, 1); + + assertCsvImportResult(result, 0, DataAcquisition.class, NB_DATA_ACQUISITION); + assertCsvImportResult(result, 0, DataProcessing.class, NB_DATA_PROCESSING); + assertCsvImportResult(result, 0, Cell.class, NB_CELL); + assertCsvImportResult(result, 0, Data.class, NB_DATA); + + assertImportAcousticDatas(); + } + + +} Property changes on: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/AcousticImportServiceIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesDataImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,153 +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.importdata; - -import fr.ifremer.echobase.csv.CsvFileImportResult; -import fr.ifremer.echobase.entities.data.Sample; -import fr.ifremer.echobase.entities.data.SampleData; -import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; -import org.junit.Ignore; -import org.junit.Test; - -import java.util.List; - -/** - * Tests {@link CatchesDataImportService}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class CatchesDataImportServiceIT extends AbstractImportDataServiceIT { - - protected FakeEchoBaseServiceContext initContext() { - return new FakeEchoBaseServiceContext(IMPORT_DATA_ECHOBASE_OPERATION); - } - - protected String[] getImportPath(String filename) { - return new String[]{"/import-data", "catchesData", filename}; - } - - @Test - public void doImportAllSamples() throws Exception { - - assertImportCommonData(); - assertImportOperations(); - assertNoEntities(Sample.class, SampleData.class); - - CatchesDataImportConfiguration conf = - new CatchesDataImportConfiguration(getLocale()); - - conf.setVoyageId(getVoyageId()); - - prepareInputFile(conf.getTotalSampleFile(), - getImportPath("totalsample.csv.gz")); - prepareInputFile(conf.getSubSampleFile(), - getImportPath("subsample.csv.gz")); - prepareInputFile(conf.getBiometrySampleFile(), - getImportPath("biometrysample.csv.gz")); - - List<CsvFileImportResult> result; - result = doImport(conf, CatchesDataImportService.class, 3); - - assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_TOTAL, 0, NB_SAMPLE); - assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_TOTAL, 0, NB_SAMPLE_DATA); - - assertCsvImportResult(result, 1, Sample.class, NB_SAMPLE_UNSORTED, 0, NB_SAMPLE); - assertCsvImportResult(result, 1, SampleData.class, NB_SAMPLE_DATA_UNSORTED, 0, NB_SAMPLE_DATA); - - assertCsvImportResult(result, 2, Sample.class, NB_SAMPLE_BIOMETRY, 0, NB_SAMPLE); - assertCsvImportResult(result, 2, SampleData.class, NB_SAMPLE_DATA_BIOMETRY, 0, NB_SAMPLE_DATA); - - assertImportSampleDatas(); - } - - @Ignore - @Test - public void doImportTotalSample() throws Exception { - - assertImportCommonData(); - assertImportOperations(); - assertNoEntities(Sample.class, SampleData.class); - - CatchesDataImportConfiguration conf = - new CatchesDataImportConfiguration(getLocale()); - - conf.setVoyageId(getVoyageId()); - - prepareInputFile(conf.getTotalSampleFile(), - getImportPath("totalsample.csv.gz")); - - List<CsvFileImportResult> result; - result = doImport(conf, CatchesDataImportService.class, 1); - - assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_TOTAL); - assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_TOTAL); - } - - @Ignore - @Test - public void doImportSubSample() throws Exception { - - assertImportCommonData(); - assertImportOperations(); - assertNoEntities(Sample.class, SampleData.class); - - CatchesDataImportConfiguration conf = - new CatchesDataImportConfiguration(getLocale()); - - conf.setVoyageId(getVoyageId()); - - prepareInputFile(conf.getSubSampleFile(), - getImportPath("subsample.csv.gz")); - - List<CsvFileImportResult> result; - result = doImport(conf, CatchesDataImportService.class, 1); - - assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_UNSORTED); - assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_UNSORTED); - } - - @Ignore - @Test - public void doImportBiometrySample() throws Exception { - - assertImportCommonData(); - assertImportOperations(); - assertNoEntities(Sample.class, SampleData.class); - - CatchesDataImportConfiguration conf = - new CatchesDataImportConfiguration(getLocale()); - - conf.setVoyageId(getVoyageId()); - - prepareInputFile(conf.getBiometrySampleFile(), - getImportPath("biometrysample.csv.gz")); - - List<CsvFileImportResult> result; - result = doImport(conf, CatchesDataImportService.class, 1); - assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_BIOMETRY); - assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_BIOMETRY); - } - -} Copied: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesImportServiceIT.java (from rev 458, trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesDataImportServiceIT.java) =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesImportServiceIT.java (rev 0) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,153 @@ +/* + * #%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.csv.CsvFileImportResult; +import fr.ifremer.echobase.entities.data.Sample; +import fr.ifremer.echobase.entities.data.SampleData; +import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; +import org.junit.Ignore; +import org.junit.Test; + +import java.util.List; + +/** + * Tests {@link CatchesImportService}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class CatchesImportServiceIT extends AbstractImportDataServiceIT { + + protected FakeEchoBaseServiceContext initContext() { + return new FakeEchoBaseServiceContext(IMPORT_DATA_ECHOBASE_OPERATION); + } + + protected String[] getImportPath(String filename) { + return new String[]{"/import-data", "catches", filename}; + } + + @Test + public void doImportAllSamples() throws Exception { + + assertImportCommonData(); + assertImportOperations(); + assertNoEntities(Sample.class, SampleData.class); + + CatchesImportConfiguration conf = + new CatchesImportConfiguration(getLocale()); + + conf.setVoyageId(getVoyageId()); + + prepareInputFile(conf.getTotalSampleFile(), + getImportPath("totalsample.csv.gz")); + prepareInputFile(conf.getSubSampleFile(), + getImportPath("subsample.csv.gz")); + prepareInputFile(conf.getBiometrySampleFile(), + getImportPath("biometrysample.csv.gz")); + + List<CsvFileImportResult> result; + result = doImport(conf, CatchesImportService.class, 3); + + assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_TOTAL, 0, NB_SAMPLE); + assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_TOTAL, 0, NB_SAMPLE_DATA); + + assertCsvImportResult(result, 1, Sample.class, NB_SAMPLE_UNSORTED, 0, NB_SAMPLE); + assertCsvImportResult(result, 1, SampleData.class, NB_SAMPLE_DATA_UNSORTED, 0, NB_SAMPLE_DATA); + + assertCsvImportResult(result, 2, Sample.class, NB_SAMPLE_BIOMETRY, 0, NB_SAMPLE); + assertCsvImportResult(result, 2, SampleData.class, NB_SAMPLE_DATA_BIOMETRY, 0, NB_SAMPLE_DATA); + + assertImportSampleDatas(); + } + + @Ignore + @Test + public void doImportTotalSample() throws Exception { + + assertImportCommonData(); + assertImportOperations(); + assertNoEntities(Sample.class, SampleData.class); + + CatchesImportConfiguration conf = + new CatchesImportConfiguration(getLocale()); + + conf.setVoyageId(getVoyageId()); + + prepareInputFile(conf.getTotalSampleFile(), + getImportPath("totalsample.csv.gz")); + + List<CsvFileImportResult> result; + result = doImport(conf, CatchesImportService.class, 1); + + assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_TOTAL); + assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_TOTAL); + } + + @Ignore + @Test + public void doImportSubSample() throws Exception { + + assertImportCommonData(); + assertImportOperations(); + assertNoEntities(Sample.class, SampleData.class); + + CatchesImportConfiguration conf = + new CatchesImportConfiguration(getLocale()); + + conf.setVoyageId(getVoyageId()); + + prepareInputFile(conf.getSubSampleFile(), + getImportPath("subsample.csv.gz")); + + List<CsvFileImportResult> result; + result = doImport(conf, CatchesImportService.class, 1); + + assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_UNSORTED); + assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_UNSORTED); + } + + @Ignore + @Test + public void doImportBiometrySample() throws Exception { + + assertImportCommonData(); + assertImportOperations(); + assertNoEntities(Sample.class, SampleData.class); + + CatchesImportConfiguration conf = + new CatchesImportConfiguration(getLocale()); + + conf.setVoyageId(getVoyageId()); + + prepareInputFile(conf.getBiometrySampleFile(), + getImportPath("biometrysample.csv.gz")); + + List<CsvFileImportResult> result; + result = doImport(conf, CatchesImportService.class, 1); + assertCsvImportResult(result, 0, Sample.class, NB_SAMPLE_BIOMETRY); + assertCsvImportResult(result, 0, SampleData.class, NB_SAMPLE_DATA_BIOMETRY); + } + +} Property changes on: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CatchesImportServiceIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/Common2ImportServiceIT.java (from rev 458, trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonData2ImportServiceIT.java) =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/Common2ImportServiceIT.java (rev 0) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/Common2ImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,84 @@ +/* + * #%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.csv.CsvFileImportResult; +import fr.ifremer.echobase.entities.data.Transect; +import fr.ifremer.echobase.entities.data.Transit; +import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; +import org.junit.Test; + +import java.util.List; + +/** + * Tests {@link CommonImportService} with {@link CommonImportMode#TRANSECT} mode. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class Common2ImportServiceIT extends AbstractImportDataServiceIT { + + protected FakeEchoBaseServiceContext initContext() { + return new FakeEchoBaseServiceContext(IMPORT_DATA_ECHOBASE_COMMON_DATA); + } + + protected String[] getImportPath(String filename) { + return new String[]{"/import-data", "common", filename}; + } + + @Test + public void doImport() throws Exception { + + // import with mode transect + + assertImportCommonData(); + + CommonImportConfiguration conf = + new CommonImportConfiguration(getLocale()); + + conf.setAreaOfOperationId(AREA_OF_OPERATION_ID); + conf.setDatum("datum"); + conf.setVoyageId(getVoyageId()); + conf.setTransectBinUnitsPingAxis("transectBinUnitsPingAxis"); + conf.setTransectGeospatialVerticalPositive("transectGeospatialVerticalPositive"); + conf.setTransectLicence("transectLicence"); + + prepareInputFile(conf.getTransectFile(), getImportPath("transect.csv.gz")); + + conf.setImportMode(CommonImportMode.TRANSECT); + + // let's delete every transects + for (Transit transit : getEntities(Transit.class)) { + transit.clearTransect(); + } + + List<CsvFileImportResult> result; + result = doImport(conf, CommonImportService.class, 1); + + assertCsvImportResult(result, 0, Transect.class, NB_TRANSECT); + + assertImportCommonData(); + } + +} Property changes on: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/Common2ImportServiceIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonData2ImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,84 +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.importdata; - -import fr.ifremer.echobase.csv.CsvFileImportResult; -import fr.ifremer.echobase.entities.data.Transect; -import fr.ifremer.echobase.entities.data.Transit; -import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; -import org.junit.Test; - -import java.util.List; - -/** - * Tests {@link CommonDataImportService} with {@link CommonDataImportMode#TRANSECT} mode. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class CommonData2ImportServiceIT extends AbstractImportDataServiceIT { - - protected FakeEchoBaseServiceContext initContext() { - return new FakeEchoBaseServiceContext(IMPORT_DATA_ECHOBASE_COMMON_DATA); - } - - protected String[] getImportPath(String filename) { - return new String[]{"/import-data", "commonData", filename}; - } - - @Test - public void doImport() throws Exception { - - // import with mode transect - - assertImportCommonData(); - - CommonDataImportConfiguration conf = - new CommonDataImportConfiguration(getLocale()); - - conf.setAreaOfOperationId(AREA_OF_OPERATION_ID); - conf.setDatum("datum"); - conf.setVoyageId(getVoyageId()); - conf.setTransectBinUnitsPingAxis("transectBinUnitsPingAxis"); - conf.setTransectGeospatialVerticalPositive("transectGeospatialVerticalPositive"); - conf.setTransectLicence("transectLicence"); - - prepareInputFile(conf.getTransectFile(), getImportPath("transect.csv.gz")); - - conf.setImportMode(CommonDataImportMode.TRANSECT); - - // let's delete every transects - for (Transit transit : getEntities(Transit.class)) { - transit.clearTransect(); - } - - List<CsvFileImportResult> result; - result = doImport(conf, CommonDataImportService.class, 1); - - assertCsvImportResult(result, 0, Transect.class, NB_TRANSECT); - - assertImportCommonData(); - } - -} Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonDataImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,90 +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.importdata; - -import fr.ifremer.echobase.csv.CsvFileImportResult; -import fr.ifremer.echobase.entities.data.Transect; -import fr.ifremer.echobase.entities.data.Transit; -import fr.ifremer.echobase.entities.data.Voyage; -import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; -import org.junit.Test; - -import java.util.List; - -/** - * Tests {@link CommonDataImportService} with {@link CommonDataImportMode#ALL} mode. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class CommonDataImportServiceIT extends AbstractImportDataServiceIT { - - @Override - protected FakeEchoBaseServiceContext initContext() { - return new FakeEchoBaseServiceContext( - IMPORT_DATA_ECHOBASE_NO_DATA); - } - - protected String[] getImportPath(String filename) { - return new String[]{"/import-data", "commonData", filename}; - } - - @Test - public void doImport() throws Exception { - - // no data in db - - assertNoEntities(Voyage.class, Transit.class, Transect.class); - - // import with mode all (voyage / transit / transect) - - CommonDataImportConfiguration conf = - new CommonDataImportConfiguration(getLocale()); - - conf.setAreaOfOperationId(AREA_OF_OPERATION_ID); - conf.setDatum("datum"); - conf.setMissionId(MISSION_ID); - conf.setTransectBinUnitsPingAxis("transectBinUnitsPingAxis"); - conf.setTransectGeospatialVerticalPositive("transectGeospatialVerticalPositive"); - conf.setTransectLicence("transectLicence"); - conf.setTransitRelatedActivity("transitRelatedActivity"); - conf.setVoyageDescription("voyageDescription"); - - prepareInputFile(conf.getVoyageFile(), getImportPath("voyage.csv.gz")); - prepareInputFile(conf.getTransitFile(), getImportPath("transit.csv.gz")); - prepareInputFile(conf.getTransectFile(), getImportPath("transect.csv.gz")); - - conf.setImportMode(CommonDataImportMode.ALL); - - List<CsvFileImportResult> result; - result = doImport(conf, CommonDataImportService.class, 3); - - assertCsvImportResult(result, 0, Voyage.class, NB_VOYAGE); - assertCsvImportResult(result, 1, Transit.class, NB_TRANSIT); - assertCsvImportResult(result, 2, Transect.class, NB_TRANSECT); - - assertImportCommonData(); - } - -} Copied: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonImportServiceIT.java (from rev 458, trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonDataImportServiceIT.java) =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonImportServiceIT.java (rev 0) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonImportServiceIT.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,90 @@ +/* + * #%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.csv.CsvFileImportResult; +import fr.ifremer.echobase.entities.data.Transect; +import fr.ifremer.echobase.entities.data.Transit; +import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; +import org.junit.Test; + +import java.util.List; + +/** + * Tests {@link CommonImportService} with {@link CommonImportMode#ALL} mode. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class CommonImportServiceIT extends AbstractImportDataServiceIT { + + @Override + protected FakeEchoBaseServiceContext initContext() { + return new FakeEchoBaseServiceContext( + IMPORT_DATA_ECHOBASE_NO_DATA); + } + + protected String[] getImportPath(String filename) { + return new String[]{"/import-data", "common", filename}; + } + + @Test + public void doImport() throws Exception { + + // no data in db + + assertNoEntities(Voyage.class, Transit.class, Transect.class); + + // import with mode all (voyage / transit / transect) + + CommonImportConfiguration conf = + new CommonImportConfiguration(getLocale()); + + conf.setAreaOfOperationId(AREA_OF_OPERATION_ID); + conf.setDatum("datum"); + conf.setMissionId(MISSION_ID); + conf.setTransectBinUnitsPingAxis("transectBinUnitsPingAxis"); + conf.setTransectGeospatialVerticalPositive("transectGeospatialVerticalPositive"); + conf.setTransectLicence("transectLicence"); + conf.setTransitRelatedActivity("transitRelatedActivity"); + conf.setVoyageDescription("voyageDescription"); + + prepareInputFile(conf.getVoyageFile(), getImportPath("voyage.csv.gz")); + prepareInputFile(conf.getTransitFile(), getImportPath("transit.csv.gz")); + prepareInputFile(conf.getTransectFile(), getImportPath("transect.csv.gz")); + + conf.setImportMode(CommonImportMode.ALL); + + List<CsvFileImportResult> result; + result = doImport(conf, CommonImportService.class, 3); + + assertCsvImportResult(result, 0, Voyage.class, NB_VOYAGE); + assertCsvImportResult(result, 1, Transit.class, NB_TRANSIT); + assertCsvImportResult(result, 2, Transect.class, NB_TRANSECT); + + assertImportCommonData(); + } + +} Property changes on: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/importdata/CommonImportServiceIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-services/src/test/resources/log4j.properties =================================================================== --- trunk/echobase-services/src/test/resources/log4j.properties 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/src/test/resources/log4j.properties 2012-03-30 16:46:14 UTC (rev 460) @@ -31,4 +31,4 @@ # package level log4j.logger.fr.ifremer.echobase=INFO #log4j.logger.fr.ifremer.echobase.services.ReplicateEntityVisitor=DEBUG -#log4j.logger.fr.ifremer.echobase.services.importdata.AcousticDataImportService=DEBUG +#log4j.logger.fr.ifremer.echobase.services.importdata.AcousticImportServiceUG Modified: trunk/echobase-services/update-import-data-db.sh =================================================================== --- trunk/echobase-services/update-import-data-db.sh 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-services/update-import-data-db.sh 2012-03-30 16:46:14 UTC (rev 460) @@ -38,15 +38,15 @@ executeMaven fr.ifremer.echobase.services.ImportDbServiceTest nodata -executeMaven fr.ifremer.echobase.services.importdata.CommonDataImportServiceIT commonData +executeMaven fr.ifremer.echobase.services.importdata.CommonImportServiceIT commonData executeMaven fr.ifremer.echobase.services.importdata.OperationImportServiceIT operation -executeMaven fr.ifremer.echobase.services.importdata.CatchesDataImportServiceIT catches +executeMaven fr.ifremer.echobase.services.importdata.CatchesImportServiceIT catches executeMaven fr.ifremer.echobase.services.importdata.ResultsVoyageImportServiceIT catches-and-voyage-result -#executeMaven fr.ifremer.echobase.services.importdata.AcousticDataImportServiceIT catches-and-acoustic-and-voyage-result +#executeMaven fr.ifremer.echobase.services.importdata.AcousticImportServiceIT catches-and-acoustic-and-voyage-result #executeMaven fr.ifremer.echobase.services.importdata.ResultsEsduCellImportServiceIT Modified: trunk/echobase-ui/pom.xml =================================================================== --- trunk/echobase-ui/pom.xml 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/pom.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -328,20 +328,6 @@ </configuration> </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>jspc-maven-plugin</artifactId> - <version>1.4.6</version> - <executions> - <execution> - <id>jspc</id> - <goals> - <goal>compile</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> </pluginManagement> </build> 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java 2012-03-30 16:46:14 UTC (rev 460) @@ -23,16 +23,14 @@ */ 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.ui.actions.AbstractWaitAndExecAction; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import java.util.List; - /** * TODO * @@ -54,7 +52,7 @@ protected transient Exception error; - protected List<CsvFileImportResult> result; + protected String result; protected AbstractLaunchImport(Class<M> modelType, Class<S> serviceType) { this.modelType = modelType; @@ -66,7 +64,7 @@ return getEchoBaseSession().getImportDataConfiguration(modelType); } - public List<CsvFileImportResult> getResult() { + public String getResult() { return result; } @@ -74,6 +72,17 @@ return error; } + public String getErrorStack() { + + String errorStack = null; + if (error != null) { + + errorStack = ExceptionUtils.getStackTrace(error); + } + + return errorStack; + } + @Override public void prepare() throws Exception { Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java 2012-03-30 16:46:14 UTC (rev 460) @@ -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.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); - } -} Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport.java (from rev 458, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData.java) =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport.java 2012-03-30 16:46:14 UTC (rev 460) @@ -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.AcousticImportConfiguration; +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 ConfigureAcousticImport extends AbstractConfigureImport<AcousticImportConfiguration> { + + private static final long serialVersionUID = 1L; + + /** Universe of existing voyages. */ + protected Map<String, String> voyages; + + protected Map<String, String> cellPositionReferences; + + public ConfigureAcousticImport() { + super(AcousticImportConfiguration.class); + } + + @Override + protected AcousticImportConfiguration createModel() { + return new AcousticImportConfiguration(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/ConfigureAcousticImport.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,107 +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.importdata.CatchesDataImportConfiguration; - -import java.io.File; -import java.util.Map; - -/** - * Configure a "catches data" import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class ConfigureCatchesData extends AbstractConfigureImport<CatchesDataImportConfiguration> { - - private static final long serialVersionUID = 1L; - - /** Universe of existing voyages. */ - protected Map<String, String> voyages; - - public ConfigureCatchesData() { - super(CatchesDataImportConfiguration.class); - } - - @Override - protected CatchesDataImportConfiguration createModel() { - return new CatchesDataImportConfiguration(getLocale()); - } - - @Override - public String input() throws Exception { - - super.input(); - - EchoBaseServiceSupport service = - newService(EchoBaseServiceSupport.class); - - voyages = loadSortAndDecorate(service, Voyage.class); - - return INPUT; - } - - public Map<String, String> getVoyages() { - return voyages; - } - - public void setTotalSampleFile(File file) { - getModel().getTotalSampleFile().setFile(file); - } - - public void setTotalSampleFileContentType(String contentType) { - getModel().getTotalSampleFile().setContentType(contentType); - } - - public void setTotalSampleFileFileName(String fileName) { - getModel().getTotalSampleFile().setFileName(fileName); - } - - public void setSubSampleFile(File file) { - getModel().getSubSampleFile().setFile(file); - } - - public void setSubSampleFileContentType(String contentType) { - getModel().getSubSampleFile().setContentType(contentType); - } - - public void setSubSampleFileFileName(String fileName) { - getModel().getSubSampleFile().setFileName(fileName); - } - - public void setBiometrySampleFile(File file) { - getModel().getBiometrySampleFile().setFile(file); - } - - public void setBiometrySampleFileContentType(String contentType) { - getModel().getBiometrySampleFile().setContentType(contentType); - } - - public void setBiometrySampleFileFileName(String fileName) { - getModel().getBiometrySampleFile().setFileName(fileName); - } -} Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport.java (from rev 458, 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/ConfigureCatchesImport.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,107 @@ +/* + * #%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.CatchesImportConfiguration; + +import java.io.File; +import java.util.Map; + +/** + * Configure a "catches data" import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class ConfigureCatchesImport extends AbstractConfigureImport<CatchesImportConfiguration> { + + private static final long serialVersionUID = 1L; + + /** Universe of existing voyages. */ + protected Map<String, String> voyages; + + public ConfigureCatchesImport() { + super(CatchesImportConfiguration.class); + } + + @Override + protected CatchesImportConfiguration createModel() { + return new CatchesImportConfiguration(getLocale()); + } + + @Override + public String input() throws Exception { + + super.input(); + + EchoBaseServiceSupport service = + newService(EchoBaseServiceSupport.class); + + voyages = loadSortAndDecorate(service, Voyage.class); + + return INPUT; + } + + public Map<String, String> getVoyages() { + return voyages; + } + + public void setTotalSampleFile(File file) { + getModel().getTotalSampleFile().setFile(file); + } + + public void setTotalSampleFileContentType(String contentType) { + getModel().getTotalSampleFile().setContentType(contentType); + } + + public void setTotalSampleFileFileName(String fileName) { + getModel().getTotalSampleFile().setFileName(fileName); + } + + public void setSubSampleFile(File file) { + getModel().getSubSampleFile().setFile(file); + } + + public void setSubSampleFileContentType(String contentType) { + getModel().getSubSampleFile().setContentType(contentType); + } + + public void setSubSampleFileFileName(String fileName) { + getModel().getSubSampleFile().setFileName(fileName); + } + + public void setBiometrySampleFile(File file) { + getModel().getBiometrySampleFile().setFile(file); + } + + public void setBiometrySampleFileContentType(String contentType) { + getModel().getBiometrySampleFile().setContentType(contentType); + } + + public void setBiometrySampleFileFileName(String fileName) { + getModel().getBiometrySampleFile().setFileName(fileName); + } +} Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,153 +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 com.opensymphony.xwork2.interceptor.annotations.InputConfig; -import fr.ifremer.echobase.entities.data.Voyage; -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.importdata.CommonDataImportConfiguration; -import fr.ifremer.echobase.services.importdata.CommonDataImportMode; - -import java.io.File; -import java.util.Map; - -/** - * Configure a accoustic data import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class ConfigureCommonData extends AbstractConfigureImport<CommonDataImportConfiguration> { - - private static final long serialVersionUID = 1L; - - /** Universe of existing missions. */ - protected Map<String, String> missions; - - /** Universe of existing voyages. */ - protected Map<String, String> voyages; - - /** Universe of existing area of operations. */ - protected Map<String, String> areaOfOperations; - - /** Universe of possible import modes. */ - protected Map<String, String> importModes; - - public ConfigureCommonData() { - super(CommonDataImportConfiguration.class); - } - - @Override - protected CommonDataImportConfiguration createModel() { - return new CommonDataImportConfiguration(getLocale()); - } - - @Override - public String input() throws Exception { - - super.input(); - - EchoBaseServiceSupport service = - newService(EchoBaseServiceSupport.class); - - missions = loadSortAndDecorate(service, Mission.class); - voyages = loadSortAndDecorate(service, Voyage.class); - areaOfOperations = loadSortAndDecorate(service, AreaOfOperation.class); - importModes = decorateEnums(CommonDataImportMode.values()); - - if (getModel().getImportMode() == null) { - - getModel().setImportMode(CommonDataImportMode.ALL); - } - - return INPUT; - } - - @InputConfig(methodName = "input") - public String modeAll() throws Exception { - - return execute(); - } - - @InputConfig(methodName = "input") - public String modeTransect() throws Exception { - - return execute(); - } - - public Map<String, String> getMissions() { - return missions; - } - - public Map<String, String> getVoyages() { - return voyages; - } - - public Map<String, String> getAreaOfOperations() { - return areaOfOperations; - } - - public Map<String, String> getImportModes() { - return importModes; - } - - public void setVoyageFile(File file) { - getModel().getVoyageFile().setFile(file); - } - - public void setVoyageFileContentType(String contentType) { - getModel().getVoyageFile().setContentType(contentType); - } - - public void setVoyageFileFileName(String fileName) { - getModel().getVoyageFile().setFileName(fileName); - } - - public void setTransitFile(File file) { - getModel().getTransitFile().setFile(file); - } - - public void setTransitFileContentType(String contentType) { - getModel().getTransitFile().setContentType(contentType); - } - - public void setTransitFileFileName(String fileName) { - getModel().getTransitFile().setFileName(fileName); - } - - public void setTransectFile(File file) { - getModel().getTransectFile().setFile(file); - } - - public void setTransectFileContentType(String contentType) { - getModel().getTransectFile().setContentType(contentType); - } - - public void setTransectFileFileName(String fileName) { - getModel().getTransectFile().setFileName(fileName); - } - -} Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport.java (from rev 458, 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/ConfigureCommonImport.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,153 @@ +/* + * #%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 com.opensymphony.xwork2.interceptor.annotations.InputConfig; +import fr.ifremer.echobase.entities.data.Voyage; +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.importdata.CommonImportConfiguration; +import fr.ifremer.echobase.services.importdata.CommonImportMode; + +import java.io.File; +import java.util.Map; + +/** + * Configure a common data (voyage / transit / transect) import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class ConfigureCommonImport extends AbstractConfigureImport<CommonImportConfiguration> { + + private static final long serialVersionUID = 1L; + + /** Universe of existing missions. */ + protected Map<String, String> missions; + + /** Universe of existing voyages. */ + protected Map<String, String> voyages; + + /** Universe of existing area of operations. */ + protected Map<String, String> areaOfOperations; + + /** Universe of possible import modes. */ + protected Map<String, String> importModes; + + public ConfigureCommonImport() { + super(CommonImportConfiguration.class); + } + + @Override + protected CommonImportConfiguration createModel() { + return new CommonImportConfiguration(getLocale()); + } + + @Override + public String input() throws Exception { + + super.input(); + + EchoBaseServiceSupport service = + newService(EchoBaseServiceSupport.class); + + missions = loadSortAndDecorate(service, Mission.class); + voyages = loadSortAndDecorate(service, Voyage.class); + areaOfOperations = loadSortAndDecorate(service, AreaOfOperation.class); + importModes = decorateEnums(CommonImportMode.values()); + + if (getModel().getImportMode() == null) { + + getModel().setImportMode(CommonImportMode.ALL); + } + + return INPUT; + } + + @InputConfig(methodName = "input") + public String modeAll() throws Exception { + + return execute(); + } + + @InputConfig(methodName = "input") + public String modeTransect() throws Exception { + + return execute(); + } + + public Map<String, String> getMissions() { + return missions; + } + + public Map<String, String> getVoyages() { + return voyages; + } + + public Map<String, String> getAreaOfOperations() { + return areaOfOperations; + } + + public Map<String, String> getImportModes() { + return importModes; + } + + public void setVoyageFile(File file) { + getModel().getVoyageFile().setFile(file); + } + + public void setVoyageFileContentType(String contentType) { + getModel().getVoyageFile().setContentType(contentType); + } + + public void setVoyageFileFileName(String fileName) { + getModel().getVoyageFile().setFileName(fileName); + } + + public void setTransitFile(File file) { + getModel().getTransitFile().setFile(file); + } + + public void setTransitFileContentType(String contentType) { + getModel().getTransitFile().setContentType(contentType); + } + + public void setTransitFileFileName(String fileName) { + getModel().getTransitFile().setFileName(fileName); + } + + public void setTransectFile(File file) { + getModel().getTransectFile().setFile(file); + } + + public void setTransectFileContentType(String contentType) { + getModel().getTransectFile().setContentType(contentType); + } + + public void setTransectFileFileName(String fileName) { + getModel().getTransectFile().setFileName(fileName); + } + +} Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,106 +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.importdata.OperationImportConfiguration; - -import java.io.File; -import java.util.Map; - -/** - * TODO - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class ConfigureOperation extends AbstractConfigureImport<OperationImportConfiguration> { - - private static final long serialVersionUID = 1L; - - /** Universe of existing voyages. */ - protected Map<String, String> voyages; - - public ConfigureOperation() { - super(OperationImportConfiguration.class); - } - - @Override - protected OperationImportConfiguration createModel() { - return new OperationImportConfiguration(getLocale()); - } - - @Override - public String input() throws Exception { - - super.input(); - - EchoBaseServiceSupport service = - newService(EchoBaseServiceSupport.class); - - voyages = loadSortAndDecorate(service, Voyage.class); - return INPUT; - } - - public Map<String, String> getVoyages() { - return voyages; - } - - public void setOperationFile(File file) { - getModel().getOperationFile().setFile(file); - } - - public void setOperationFileContentType(String contentType) { - getModel().getOperationFile().setContentType(contentType); - } - - public void setOperationFileFileName(String fileName) { - getModel().getOperationFile().setFileName(fileName); - } - - public void setOperationMetadataFile(File file) { - getModel().getOperationMetadataFile().setFile(file); - } - - public void setOperationMetadataFileContentType(String contentType) { - getModel().getOperationMetadataFile().setContentType(contentType); - } - - public void setOperationMetadataFileFileName(String fileName) { - getModel().getOperationMetadataFile().setFileName(fileName); - } - - public void setGearMetadataFile(File file) { - getModel().getGearMetadataFile().setFile(file); - } - - public void setGearMetadataFileContentType(String contentType) { - getModel().getGearMetadataFile().setContentType(contentType); - } - - public void setGearMetadataFileFileName(String fileName) { - getModel().getGearMetadataFile().setFileName(fileName); - } -} \ No newline at end of file Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport.java (from rev 458, 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/ConfigureOperationImport.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,106 @@ +/* + * #%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.OperationImportConfiguration; + +import java.io.File; +import java.util.Map; + +/** + * Configure a "Operation" import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class ConfigureOperationImport extends AbstractConfigureImport<OperationImportConfiguration> { + + private static final long serialVersionUID = 1L; + + /** Universe of existing voyages. */ + protected Map<String, String> voyages; + + public ConfigureOperationImport() { + super(OperationImportConfiguration.class); + } + + @Override + protected OperationImportConfiguration createModel() { + return new OperationImportConfiguration(getLocale()); + } + + @Override + public String input() throws Exception { + + super.input(); + + EchoBaseServiceSupport service = + newService(EchoBaseServiceSupport.class); + + voyages = loadSortAndDecorate(service, Voyage.class); + return INPUT; + } + + public Map<String, String> getVoyages() { + return voyages; + } + + public void setOperationFile(File file) { + getModel().getOperationFile().setFile(file); + } + + public void setOperationFileContentType(String contentType) { + getModel().getOperationFile().setContentType(contentType); + } + + public void setOperationFileFileName(String fileName) { + getModel().getOperationFile().setFileName(fileName); + } + + public void setOperationMetadataFile(File file) { + getModel().getOperationMetadataFile().setFile(file); + } + + public void setOperationMetadataFileContentType(String contentType) { + getModel().getOperationMetadataFile().setContentType(contentType); + } + + public void setOperationMetadataFileFileName(String fileName) { + getModel().getOperationMetadataFile().setFileName(fileName); + } + + public void setGearMetadataFile(File file) { + getModel().getGearMetadataFile().setFile(file); + } + + public void setGearMetadataFileContentType(String contentType) { + getModel().getGearMetadataFile().setContentType(contentType); + } + + public void setGearMetadataFileFileName(String fileName) { + getModel().getGearMetadataFile().setFileName(fileName); + } +} \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,261 +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 com.opensymphony.xwork2.interceptor.annotations.InputConfig; -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.importdata.ResultsImportConfiguration; -import fr.ifremer.echobase.services.importdata.ResultsImportMode; - -import java.io.File; -import java.util.Map; - -/** - * Configure a "accoustic region data" import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class ConfigureResults extends AbstractConfigureImport<ResultsImportConfiguration> { - - private static final long serialVersionUID = 1L; - - /** Universe of existing voyages. */ - protected Map<String, String> voyages; - - /** Universe of existing vessels. */ - protected Map<String, String> vessels; - - /** Universe of possible import modes. */ - protected Map<String, String> importModes; - - protected String resultLabel; - - public ConfigureResults() { - super(ResultsImportConfiguration.class); - } - - @Override - protected ResultsImportConfiguration createModel() { - return new ResultsImportConfiguration(getLocale()); - } - - @Override - public String input() throws Exception { - - super.input(); - - EchoBaseServiceSupport service = - newService(EchoBaseServiceSupport.class); - - voyages = loadSortAndDecorate(service, Voyage.class); - vessels = loadSortAndDecorate(service, Vessel.class); - importModes = decorateEnums(ResultsImportMode.values()); - - if (getModel().getImportMode() == null) { - - getModel().setImportMode(ResultsImportMode.VOYAGE); - } - return INPUT; - } - - @InputConfig(methodName = "input") - public String modeVoyage() throws Exception { - - return execute(); - } - - @InputConfig(methodName = "input") - public String modeEsdu() throws Exception { - - return execute(); - } - - @InputConfig(methodName = "input") - public String modeRegion() throws Exception { - - return execute(); - } - - @InputConfig(methodName = "input") - public String modeMap() throws Exception { - - return execute(); - } - - public Map<String, String> getVoyages() { - return voyages; - } - - public Map<String, String> getVessels() { - return vessels; - } - - public Map<String, String> getImportModes() { - return importModes; - } - - - public String getResultLabel() { - return resultLabel; - } - - public void setResultLabel(String resultLabel) { - this.resultLabel = resultLabel; - } - - public void setRegionsFile(File file) { - getModel().getRegionsFile().setFile(file); - } - - public void setRegionsFileContentType(String contentType) { - getModel().getRegionsFile().setContentType(contentType); - } - - public void setRegionsFileFileName(String fileName) { - getModel().getRegionsFile().setFileName(fileName); - } - - public void setRegionAssociationFile(File file) { - getModel().getRegionAssociationFile().setFile(file); - } - - public void setRegionAssociationFileContentType(String contentType) { - getModel().getRegionAssociationFile().setContentType(contentType); - } - - 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 setLengthAgeKeyFile(File file) { - getModel().getLengthAgeKeyFile().setFile(file); - } - - public void setLengthAgeKeyFileContentType(String contentType) { - getModel().getLengthAgeKeyFile().setContentType(contentType); - } - - public void setLengthAgeKeyFileFileName(String fileName) { - getModel().getLengthAgeKeyFile().setFileName(fileName); - } - - public void setLengthWeightKeyFile(File file) { - getModel().getLengthWeightKeyFile().setFile(file); - } - - public void setLengthWeightKeyFileContentType(String contentType) { - getModel().getLengthWeightKeyFile().setContentType(contentType); - } - - public void setLengthWeightKeyFileFileName(String fileName) { - getModel().getLengthWeightKeyFile().setFileName(fileName); - } - - public void setEchotypeFile(File file) { - getModel().getEchotypeFile().setFile(file); - } - - public void setEchotypeFileContentType(String contentType) { - getModel().getEchotypeFile().setContentType(contentType); - } - - public void setEchotypeFileFileName(String fileName) { - getModel().getEchotypeFile().setFileName(fileName); - } - - public void setEsduByEchotypeFile(File file) { - getModel().getEsduByEchotypeFile().setFile(file); - } - - public void setEsduByEchotypeFileContentType(String contentType) { - getModel().getEsduByEchotypeFile().setContentType(contentType); - } - - public void setEsduByEchotypeFileName(String fileName) { - getModel().getEsduByEchotypeFile().setFileName(fileName); - } - - public void setEsduByEchotypeAndSpeciesCategoryFileFile(File file) { - getModel().getEsduByEchotypeAndSpeciesCategoryFile().setFile(file); - } - - public void setEsduByEchotypeAndSpeciesCategoryFileContentType(String contentType) { - getModel().getEsduByEchotypeAndSpeciesCategoryFile().setContentType(contentType); - } - - 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); - } -} Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport.java (from rev 458, 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/ConfigureResultsImport.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,261 @@ +/* + * #%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 com.opensymphony.xwork2.interceptor.annotations.InputConfig; +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.importdata.ResultsImportConfiguration; +import fr.ifremer.echobase.services.importdata.ResultsImportMode; + +import java.io.File; +import java.util.Map; + +/** + * Configure a "results" import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class ConfigureResultsImport extends AbstractConfigureImport<ResultsImportConfiguration> { + + private static final long serialVersionUID = 1L; + + /** Universe of existing voyages. */ + protected Map<String, String> voyages; + + /** Universe of existing vessels. */ + protected Map<String, String> vessels; + + /** Universe of possible import modes. */ + protected Map<String, String> importModes; + + protected String resultLabel; + + public ConfigureResultsImport() { + super(ResultsImportConfiguration.class); + } + + @Override + protected ResultsImportConfiguration createModel() { + return new ResultsImportConfiguration(getLocale()); + } + + @Override + public String input() throws Exception { + + super.input(); + + EchoBaseServiceSupport service = + newService(EchoBaseServiceSupport.class); + + voyages = loadSortAndDecorate(service, Voyage.class); + vessels = loadSortAndDecorate(service, Vessel.class); + importModes = decorateEnums(ResultsImportMode.values()); + + if (getModel().getImportMode() == null) { + + getModel().setImportMode(ResultsImportMode.VOYAGE); + } + return INPUT; + } + + @InputConfig(methodName = "input") + public String modeVoyage() throws Exception { + + return execute(); + } + + @InputConfig(methodName = "input") + public String modeEsdu() throws Exception { + + return execute(); + } + + @InputConfig(methodName = "input") + public String modeRegion() throws Exception { + + return execute(); + } + + @InputConfig(methodName = "input") + public String modeMap() throws Exception { + + return execute(); + } + + public Map<String, String> getVoyages() { + return voyages; + } + + public Map<String, String> getVessels() { + return vessels; + } + + public Map<String, String> getImportModes() { + return importModes; + } + + + public String getResultLabel() { + return resultLabel; + } + + public void setResultLabel(String resultLabel) { + this.resultLabel = resultLabel; + } + + public void setRegionsFile(File file) { + getModel().getRegionsFile().setFile(file); + } + + public void setRegionsFileContentType(String contentType) { + getModel().getRegionsFile().setContentType(contentType); + } + + public void setRegionsFileFileName(String fileName) { + getModel().getRegionsFile().setFileName(fileName); + } + + public void setRegionAssociationFile(File file) { + getModel().getRegionAssociationFile().setFile(file); + } + + public void setRegionAssociationFileContentType(String contentType) { + getModel().getRegionAssociationFile().setContentType(contentType); + } + + 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 setLengthAgeKeyFile(File file) { + getModel().getLengthAgeKeyFile().setFile(file); + } + + public void setLengthAgeKeyFileContentType(String contentType) { + getModel().getLengthAgeKeyFile().setContentType(contentType); + } + + public void setLengthAgeKeyFileFileName(String fileName) { + getModel().getLengthAgeKeyFile().setFileName(fileName); + } + + public void setLengthWeightKeyFile(File file) { + getModel().getLengthWeightKeyFile().setFile(file); + } + + public void setLengthWeightKeyFileContentType(String contentType) { + getModel().getLengthWeightKeyFile().setContentType(contentType); + } + + public void setLengthWeightKeyFileFileName(String fileName) { + getModel().getLengthWeightKeyFile().setFileName(fileName); + } + + public void setEchotypeFile(File file) { + getModel().getEchotypeFile().setFile(file); + } + + public void setEchotypeFileContentType(String contentType) { + getModel().getEchotypeFile().setContentType(contentType); + } + + public void setEchotypeFileFileName(String fileName) { + getModel().getEchotypeFile().setFileName(fileName); + } + + public void setEsduByEchotypeFile(File file) { + getModel().getEsduByEchotypeFile().setFile(file); + } + + public void setEsduByEchotypeFileContentType(String contentType) { + getModel().getEsduByEchotypeFile().setContentType(contentType); + } + + public void setEsduByEchotypeFileName(String fileName) { + getModel().getEsduByEchotypeFile().setFileName(fileName); + } + + public void setEsduByEchotypeAndSpeciesCategoryFileFile(File file) { + getModel().getEsduByEchotypeAndSpeciesCategoryFile().setFile(file); + } + + public void setEsduByEchotypeAndSpeciesCategoryFileContentType(String contentType) { + getModel().getEsduByEchotypeAndSpeciesCategoryFile().setContentType(contentType); + } + + 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); + } +} Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport.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/CreateMission.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/CreateMission.java 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/CreateMission.java 2012-03-30 16:46:14 UTC (rev 460) @@ -27,7 +27,7 @@ import fr.ifremer.echobase.entities.references.Mission; import fr.ifremer.echobase.entities.references.MissionImpl; import fr.ifremer.echobase.services.exceptions.MissionNameAlreadyExistException; -import fr.ifremer.echobase.services.importdata.CommonDataImportService; +import fr.ifremer.echobase.services.importdata.CommonImportService; import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -63,8 +63,8 @@ String result = INPUT; try { - CommonDataImportService service = - newService(CommonDataImportService.class); + CommonImportService service = + newService(CommonImportService.class); Mission missionSaved = service.createMission(mission); if (log.isInfoEnabled()) { Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticData.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,43 +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.services.importdata.AcousticDataImportConfiguration; -import fr.ifremer.echobase.services.importdata.AcousticDataImportService; - -/** - * Configure a accoustic data import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class LaunchAccousticData extends AbstractLaunchImport<AcousticDataImportConfiguration, AcousticDataImportService> { - - private static final long serialVersionUID = 1L; - - public LaunchAccousticData() { - super(AcousticDataImportConfiguration.class, AcousticDataImportService.class); - } - -} Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java (from rev 458, 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/LaunchAccousticImport.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,43 @@ +/* + * #%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.services.importdata.AcousticImportConfiguration; +import fr.ifremer.echobase.services.importdata.AcousticImportService; + +/** + * Configure a accoustic data import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class LaunchAccousticImport extends AbstractLaunchImport<AcousticImportConfiguration, AcousticImportService> { + + private static final long serialVersionUID = 1L; + + public LaunchAccousticImport() { + super(AcousticImportConfiguration.class, AcousticImportService.class); + } + +} Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticImport.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesData.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,43 +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.services.importdata.CatchesDataImportConfiguration; -import fr.ifremer.echobase.services.importdata.CatchesDataImportService; - -/** - * Configure a accoustic data import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class LaunchCatchesData extends AbstractLaunchImport<CatchesDataImportConfiguration, CatchesDataImportService> { - - private static final long serialVersionUID = 1L; - - public LaunchCatchesData() { - super(CatchesDataImportConfiguration.class, CatchesDataImportService.class); - } - -} Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesImport.java (from rev 458, 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/LaunchCatchesImport.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesImport.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,43 @@ +/* + * #%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.services.importdata.CatchesImportConfiguration; +import fr.ifremer.echobase.services.importdata.CatchesImportService; + +/** + * Configure a accoustic data import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class LaunchCatchesImport extends AbstractLaunchImport<CatchesImportConfiguration, CatchesImportService> { + + private static final long serialVersionUID = 1L; + + public LaunchCatchesImport() { + super(CatchesImportConfiguration.class, CatchesImportService.class); + } + +} Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesImport.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,43 +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.services.importdata.CommonDataImportConfiguration; -import fr.ifremer.echobase.services.importdata.CommonDataImportService; - -/** - * Configure a accoustic data import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class LaunchCommonData extends AbstractLaunchImport<CommonDataImportConfiguration, CommonDataImportService> { - - private static final long serialVersionUID = 1L; - - public LaunchCommonData() { - super(CommonDataImportConfiguration.class, CommonDataImportService.class); - } - -} Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonImport.java (from rev 458, 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/LaunchCommonImport.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonImport.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,43 @@ +/* + * #%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.services.importdata.CommonImportConfiguration; +import fr.ifremer.echobase.services.importdata.CommonImportService; + +/** + * Configure a accoustic data import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class LaunchCommonImport extends AbstractLaunchImport<CommonImportConfiguration, CommonImportService> { + + private static final long serialVersionUID = 1L; + + public LaunchCommonImport() { + super(CommonImportConfiguration.class, CommonImportService.class); + } + +} Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonImport.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,44 +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.services.importdata.OperationImportConfiguration; -import fr.ifremer.echobase.services.importdata.OperationImportService; - -/** - * TODO - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class LaunchOperation extends AbstractLaunchImport<OperationImportConfiguration, OperationImportService> { - - private static final long serialVersionUID = 1L; - - public LaunchOperation() { - super(OperationImportConfiguration.class, - OperationImportService.class); - } - -} \ No newline at end of file Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperationImport.java (from rev 458, 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/LaunchOperationImport.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperationImport.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,44 @@ +/* + * #%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.services.importdata.OperationImportConfiguration; +import fr.ifremer.echobase.services.importdata.OperationImportService; + +/** + * TODO + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class LaunchOperationImport extends AbstractLaunchImport<OperationImportConfiguration, OperationImportService> { + + private static final long serialVersionUID = 1L; + + public LaunchOperationImport() { + super(OperationImportConfiguration.class, + OperationImportService.class); + } + +} \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperationImport.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java 2012-03-30 16:46:14 UTC (rev 460) @@ -1,43 +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.services.importdata.ResultsImportConfiguration; -import fr.ifremer.echobase.services.importdata.ResultsImportService; - -/** - * Configure a "result" import. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class LaunchResults extends AbstractLaunchImport<ResultsImportConfiguration, ResultsImportService> { - - private static final long serialVersionUID = 1L; - - public LaunchResults() { - super(ResultsImportConfiguration.class, ResultsImportService.class); - } - -} Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResultsImport.java (from rev 458, 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/LaunchResultsImport.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResultsImport.java 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,43 @@ +/* + * #%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.services.importdata.ResultsImportConfiguration; +import fr.ifremer.echobase.services.importdata.ResultsImportService; + +/** + * Configure a "result" import. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class LaunchResultsImport extends AbstractLaunchImport<ResultsImportConfiguration, ResultsImportService> { + + private static final long serialVersionUID = 1L; + + public LaunchResultsImport() { + super(ResultsImportConfiguration.class, ResultsImportService.class); + } + +} Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResultsImport.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/SelectImportType.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectImportType.java 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectImportType.java 2012-03-30 16:46:14 UTC (rev 460) @@ -23,7 +23,7 @@ */ package fr.ifremer.echobase.ui.actions.importData; -import fr.ifremer.echobase.services.importdata.ImportDataMode; +import fr.ifremer.echobase.services.importdata.ImportMode; import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; import java.util.Map; @@ -38,7 +38,7 @@ private static final long serialVersionUID = 1L; - protected ImportDataMode mode; + protected ImportMode mode; /** Universe of possible import modes. */ protected Map<String, String> modes; @@ -48,20 +48,20 @@ return modes; } - public ImportDataMode getMode() { + public ImportMode getMode() { return mode; } - public void setMode(ImportDataMode mode) { + public void setMode(ImportMode mode) { this.mode = mode; } @Override public String input() throws Exception { - modes = decorateEnums(ImportDataMode.values()); + modes = decorateEnums(ImportMode.values()); if (mode == null) { - mode = ImportDataMode.CommonData; + mode = ImportMode.Common; } return INPUT; } Modified: trunk/echobase-ui/src/main/resources/config/struts-importData.xml =================================================================== --- trunk/echobase-ui/src/main/resources/config/struts-importData.xml 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/resources/config/struts-importData.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -35,7 +35,7 @@ <!-- Select import type --> <action name="selectImportType" class="fr.ifremer.echobase.ui.actions.importData.SelectImportType"> - <interceptor-ref name="paramsPrepareParamsStackLoggued"/> + <interceptor-ref name="prepareParamsStackLoggued"/> <result name="input">/WEB-INF/jsp/importData/selectImportType.jsp</result> <result type="redirectAction"> <param name="namespace">/importData</param> @@ -45,21 +45,21 @@ </action> <!-- Configure import --> - <action name="Configure*-*" method="{2}" + <!--action name="Configure*-*" method="{2}" class="fr.ifremer.echobase.ui.actions.importData.Configure{1}"> - <interceptor-ref name="paramsPrepareParamsStackLoggued"/> - <result name="input">/WEB-INF/jsp/importData/configure{1}.jsp</result> + <interceptor-ref name="prepareParamsStackLoggued"/> + <result name="input">/WEB-INF/jsp/importData/configure{1}Import.jsp</result> <result type="redirectAction"> <param name="namespace">/importData</param> <param name="actionName">import{1}</param> </result> - </action> + </action--> <!-- Configure import --> - <action name="configure*" - class="fr.ifremer.echobase.ui.actions.importData.Configure{1}"> + <action name="configure*-*" method="{2}" + class="fr.ifremer.echobase.ui.actions.importData.Configure{1}Import"> <interceptor-ref name="paramsPrepareParamsStackLoggued"/> - <result name="input">/WEB-INF/jsp/importData/configure{1}.jsp</result> + <result name="input">/WEB-INF/jsp/importData/configure{1}Import.jsp</result> <result type="redirectAction"> <param name="namespace">/importData</param> <param name="actionName">import{1}</param> @@ -68,11 +68,11 @@ <!-- Starts import --> <action name="import*" - class="fr.ifremer.echobase.ui.actions.importData.Launch{1}"> + class="fr.ifremer.echobase.ui.actions.importData.Launch{1}Import"> <interceptor-ref name="basicStackLoggued"/> <interceptor-ref name="execAndWait"/> - <result name="wait">/WEB-INF/jsp/importData/progress{1}.jsp</result> - <result>/WEB-INF/jsp/importData/result{1}.jsp</result> + <result name="wait">/WEB-INF/jsp/importData/progress{1}Import.jsp</result> + <result>/WEB-INF/jsp/importData/result{1}Import.jsp</result> </action> <!-- Get all vessels used by any transects of a voyage --> Deleted: 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/ConfigureAcousticData-validation.xml 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticData-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -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/ConfigureAcousticImport-validation.xml (from rev 458, 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/ConfigureAcousticImport-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAcousticImport-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -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/ConfigureAcousticImport-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/ConfigureCatchesData-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData-validation.xml 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -1,55 +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="totalSampleFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.totalSampleFile.file!=null</param> - <message key="echobase.error.import.totalSampleFile.required"/> - </field-validator> - </field> - - <field name="subSampleFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.subSampleFile.file!=null</param> - <message key="echobase.error.import.subSampleFile.required"/> - </field-validator> - </field> - - <field name="biometrySampleFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.biometrySampleFile.file!=null</param> - <message key="echobase.error.import.biometrySampleFile.required"/> - </field-validator> - </field> - -</validators> \ No newline at end of file Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData-validation.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesImport-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,55 @@ +<!-- + #%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="totalSampleFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.totalSampleFile.file!=null</param> + <message key="echobase.error.import.totalSampleFile.required"/> + </field-validator> + </field> + + <field name="subSampleFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.subSampleFile.file!=null</param> + <message key="echobase.error.import.subSampleFile.required"/> + </field-validator> + </field> + + <field name="biometrySampleFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.biometrySampleFile.file!=null</param> + <message key="echobase.error.import.biometrySampleFile.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/ConfigureCatchesImport-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/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -1,104 +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.missionId"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.mission.required"/> - </field-validator> - </field> - - <field name="model.areaOfOperationId"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.areaOfOperation.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.voyageDescription"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.voyageDescription.required"/> - </field-validator> - </field> - - <field name="model.transitRelatedActivity"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.transitRelatedActivity.required"/> - </field-validator> - </field> - - <field name="model.transectLicence"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.transectLicence.required"/> - </field-validator> - </field> - - <field name="model.transectGeospatialVerticalPositive"> - <field-validator type="nrequiredstring"> - <message - key="echobase.error.import.transectGeospatialVerticalPositive.required"/> - </field-validator> - </field> - - <field name="model.transectBinUnitsPingAxis"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.transectBinUnitsPingAxis.required"/> - </field-validator> - </field> - - <field name="model.datum"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.datum.required"/> - </field-validator> - </field> - - <field name="voyageFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.voyageFile.file!=null</param> - <message key="echobase.error.import.voyageFile.required"/> - </field-validator> - </field> - - <field name="transitFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.transitFile.file!=null</param> - <message key="echobase.error.import.transitFile.required"/> - </field-validator> - </field> - - <field name="transectFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.transectFile.file!=null</param> - <message key="echobase.error.import.transectFile.required"/> - </field-validator> - </field> - -</validators> \ No newline at end of file Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -1,72 +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.vesselId"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.vessel.required"/> - </field-validator> - </field> - - <field name="model.transectLicence"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.transectLicence.required"/> - </field-validator> - </field> - - <field name="model.transectGeospatialVerticalPositive"> - <field-validator type="nrequiredstring"> - <message - key="echobase.error.import.transectGeospatialVerticalPositive.required"/> - </field-validator> - </field> - - <field name="model.transectBinUnitsPingAxis"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.transectBinUnitsPingAxis.required"/> - </field-validator> - </field> - - <field name="model.datum"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.datum.required"/> - </field-validator> - </field> - - <field name="transectFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.transectFile.file!=null</param> - <message key="echobase.error.import.transectFile.required"/> - </field-validator> - </field> - -</validators> \ No newline at end of file Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeAll-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeAll-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeAll-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,98 @@ +<!-- + #%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.missionId"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.mission.required"/> + </field-validator> + </field> + + <field name="model.areaOfOperationId"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.areaOfOperation.required"/> + </field-validator> + </field> + + <field name="model.voyageDescription"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.voyageDescription.required"/> + </field-validator> + </field> + + <field name="model.transitRelatedActivity"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.transitRelatedActivity.required"/> + </field-validator> + </field> + + <field name="model.transectLicence"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.transectLicence.required"/> + </field-validator> + </field> + + <field name="model.transectGeospatialVerticalPositive"> + <field-validator type="nrequiredstring"> + <message + key="echobase.error.import.transectGeospatialVerticalPositive.required"/> + </field-validator> + </field> + + <field name="model.transectBinUnitsPingAxis"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.transectBinUnitsPingAxis.required"/> + </field-validator> + </field> + + <field name="model.datum"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.datum.required"/> + </field-validator> + </field> + + <field name="voyageFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.voyageFile.file!=null</param> + <message key="echobase.error.import.voyageFile.required"/> + </field-validator> + </field> + + <field name="transitFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.transitFile.file!=null</param> + <message key="echobase.error.import.transitFile.required"/> + </field-validator> + </field> + + <field name="transectFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.transectFile.file!=null</param> + <message key="echobase.error.import.transectFile.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/ConfigureCommonImport-configureCommon-modeAll-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/ConfigureCommonImport-configureCommon-modeTransect-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeTransect-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonImport-configureCommon-modeTransect-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,66 @@ +<!-- + #%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.transectLicence"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.transectLicence.required"/> + </field-validator> + </field> + + <field name="model.transectGeospatialVerticalPositive"> + <field-validator type="nrequiredstring"> + <message + key="echobase.error.import.transectGeospatialVerticalPositive.required"/> + </field-validator> + </field> + + <field name="model.transectBinUnitsPingAxis"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.transectBinUnitsPingAxis.required"/> + </field-validator> + </field> + + <field name="model.datum"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.datum.required"/> + </field-validator> + </field> + + <field name="transectFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.transectFile.file!=null</param> + <message key="echobase.error.import.transectFile.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/ConfigureCommonImport-configureCommon-modeTransect-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/ConfigureOperation-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -1,71 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - #%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% - --> - - -<!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="operationFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.operationFile.file!=null</param> - <message key="echobase.error.import.operationFile.required"/> - </field-validator> - </field> - - <field name="operationMetadataFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.operationMetadataFile.file!=null</param> - <message key="echobase.error.import.operationMetadataFile.required"/> - </field-validator> - </field> - - <field name="gearMetadataFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.gearMetadataFile.file!=null</param> - <message key="echobase.error.import.gearMetadataFile.required"/> - </field-validator> - </field> - -</validators> \ No newline at end of file Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperationImport-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%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% + --> + + +<!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="operationFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.operationFile.file!=null</param> + <message key="echobase.error.import.operationFile.required"/> + </field-validator> + </field> + + <field name="operationMetadataFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.operationMetadataFile.file!=null</param> + <message key="echobase.error.import.operationMetadataFile.required"/> + </field-validator> + </field> + + <field name="gearMetadataFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.gearMetadataFile.file!=null</param> + <message key="echobase.error.import.gearMetadataFile.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/ConfigureOperationImport-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-modeEsdu-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsdu-validation.xml 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsdu-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -1,53 +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.dataProcessingId"> - <field-validator type="nrequiredstring"> - <message key="echobase.error.import.dataProcessing.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.oneEsduImportFile</param> - <message key="echobase.error.import.resultImportFile.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-modeMap-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeMap-validation.xml 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeMap-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -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="mapsFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.mapsFile.file!=null</param> - <message key="echobase.error.import.mapsFile.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-modeRegion-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeRegion-validation.xml 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeRegion-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -1,61 +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="regionsFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.regionsFile.file!=null</param> - <message key="echobase.error.import.regionsFile.required"/> - </field-validator> - </field> - - <field name="regionAssociationFile"> - <field-validator type="nfieldexpression"> - <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 Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -1,41 +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="lengthAgeKeyFile"> - <field-validator type="nfieldexpression"> - <param name="expression">model.oneVoyageImportFile</param> - <message key="echobase.error.import.resultImportFile.required"/> - </field-validator> - </field> - -</validators> \ No newline at end of file Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeEsdu-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeEsdu-validation.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeEsdu-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeEsdu-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,53 @@ +<!-- + #%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.dataProcessingId"> + <field-validator type="nrequiredstring"> + <message key="echobase.error.import.dataProcessing.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.oneEsduImportFile</param> + <message key="echobase.error.import.resultImportFile.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/ConfigureResultsImport-configureResults-modeEsdu-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/ConfigureResultsImport-configureResults-modeMap-validation.xml (from rev 458, 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/ConfigureResultsImport-configureResults-modeMap-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeMap-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -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="mapsFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.mapsFile.file!=null</param> + <message key="echobase.error.import.mapsFile.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/ConfigureResultsImport-configureResults-modeMap-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/ConfigureResultsImport-configureResults-modeRegion-validation.xml (from rev 458, 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/ConfigureResultsImport-configureResults-modeRegion-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeRegion-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,61 @@ +<!-- + #%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="regionsFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.regionsFile.file!=null</param> + <message key="echobase.error.import.regionsFile.required"/> + </field-validator> + </field> + + <field name="regionAssociationFile"> + <field-validator type="nfieldexpression"> + <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 Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeRegion-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/ConfigureResultsImport-configureResults-modeVoyage-validation.xml (from rev 458, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeVoyage-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResultsImport-configureResults-modeVoyage-validation.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,41 @@ +<!-- + #%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="lengthAgeKeyFile"> + <field-validator type="nfieldexpression"> + <param name="expression">model.oneVoyageImportFile</param> + <message key="echobase.error.import.resultImportFile.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/ConfigureResultsImport-configureResults-modeVoyage-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-03-30 16:46:14 UTC (rev 460) @@ -39,14 +39,16 @@ echobase.common.addDataAcquisition=Toujours créer des DataAcqusitions echobase.common.admin=Administrateur echobase.common.cellPositionReference=cellPositionReference +echobase.common.dataProcessingNotes=dataProcessingNotes echobase.common.digitThreshold=digitThreshold echobase.common.echosounderSoundSpeed=echosounderSoundSpeed echobase.common.email=Email echobase.common.entityType=Type d'entité echobase.common.importDataMode=Type d'import -echobase.common.importError=Message d'erreur +echobase.common.importError=Un erreur est survenue pendant l'import \: echobase.common.importFileName=Nom du fichier importé echobase.common.importMode=Type d'import +echobase.common.importNotes=Remarques sur l'import echobase.common.importResult=Résultat de l'import echobase.common.inProgress=en cours... echobase.common.jdbcLogin=Login de connexion @@ -55,7 +57,6 @@ echobase.common.loggedDataDatatype=loggedDataDatatype echobase.common.loggedDataFormat=loggedDataFormat echobase.common.nbCreatedObjects=Nombre d'objets crées -echobase.common.notes=notes echobase.common.password=Mot de passe echobase.common.pingDutyCycle=pingDutyCycle echobase.common.processingDescription=processingDescription Modified: trunk/echobase-ui/src/main/resources/struts.xml =================================================================== --- trunk/echobase-ui/src/main/resources/struts.xml 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/resources/struts.xml 2012-03-30 16:46:14 UTC (rev 460) @@ -114,6 +114,13 @@ <interceptor-ref name="paramsPrepareParamsStack"/> </interceptor-stack> + <!-- authenticated stack with params--> + <interceptor-stack name="prepareParamsStackLoggued"> + <interceptor-ref name="i18n"/> + <interceptor-ref name="checkUserLoggued"/> + <interceptor-ref name="defaultStack"/> + </interceptor-stack> + </interceptors> <!-- must be authenticated to perform any actions --> Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/importDataResults.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/includes/importDataResults.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/importDataResults.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -25,29 +25,24 @@ <%@ taglib prefix="s" uri="/struts-tags" %> <br/> -<s:if test="hasActionErrors()"> - <s:text name="echobase.common.importError"/> - <pre> - <s:property value="error.message"/> - </pre> -</s:if> -<s:else> - <table> - <thead> - <tr> - <th><s:text name="echobase.common.importFileName"/></th> - <th><s:text name="echobase.common.entityType"/></th> - <th><s:text name="echobase.common.nbCreatedObjects"/></th> - </tr> - </thead> - <s:iterator value="result" var="fileResult"> - <s:iterator value="%{#fileResult.entityTypes}" var="entityType"> - <tr> - <td><s:property value="%{#importFileName}"/></td> - <td><s:property value="%{#entityType}"/></td> - <td><s:property value="%{#fileResult.getNumberCreated(#entityType)}"/></td> - </tr> - </s:iterator> - </s:iterator> - </table> -</s:else> +<fieldset> + <legend><s:text name="echobase.legend.importData.result.resume"/></legend> + + <s:if test="hasActionErrors()"> + <s:text name="echobase.common.importError"/> + <strong> + <s:property value="error.message"/> + </strong> + <pre id="errorStack"> + <code> + <s:property value="errorStack"/> + </code> + </pre> + </s:if> + <s:else> + <pre> + <s:property value="result"/> + </pre> + </s:else> +</fieldset> + Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticData.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticData.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticData.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,127 +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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> -<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> -<title> - Configuration <s:text name="echobase.common.importDataMode.accousticData"/> -</title> - -<script type="text/javascript" - src="<s:url value='/js/gridHelper.js' />"></script> - -<script type="text/javascript"> - - jQuery(document).ready(function () { - - $.autoSelectVoyageAndVessel( - $('[name="model.voyageId"]'), - $('[name="model.vesselId"]'), - '<s:url action="getVesselsForVoyage" namespace="/importData"/>', - '<s:property value="model.voyageId"/>', - '<s:property value="model.vesselId"/>' - ); - }); -</script> - -<s:form namespace="/importData" method="POST" enctype="multipart/form-data"> - - <fieldset> - <legend> - <s:text name="echobase.legend.importData.configure"/> - </legend> - - <s:select key="model.voyageId" required="true" - label='%{getText("echobase.common.voyage")}' - list="voyages" headerKey="" headerValue=""/> - - <sj:select key="model.vesselId" required="true" - label='%{getText("echobase.common.vessel")}'/> - - <s:select key="model.cellPositionReference" required="true" - label='%{getText("echobase.common.cellPositionReference")}' - list="cellPositionReferences" headerKey="" headerValue=""/> - - <s:checkbox key="model.addDataAcquisition" required="true" - label='%{getText("echobase.common.addDataAcquisition")}'/> - - <s:textfield key="model.transceiverAcquisitionAbsorptionDescription" - size="100" required="true" - label='%{getText("echobase.common.transceiverAcquisitionAbsorptionDescription")}'/> - - <s:textfield key="model.acquisitionSoftwareVersionER60" size="100" - required="true" - label='%{getText("echobase.common.acquisitionSoftwareVersionER60")}'/> - - <s:textfield key="model.acquisitionSoftwareVersionME70" size="100" - required="true" - label='%{getText("echobase.common.acquisitionSoftwareVersionME70")}'/> - - <s:textfield key="model.loggedDataFormat" size="100" required="true" - label='%{getText("echobase.common.loggedDataFormat")}'/> - - <s:textfield key="model.loggedDataDatatype" size="100" required="true" - label='%{getText("echobase.common.loggedDataDatatype")}'/> - - <s:textfield key="model.pingDutyCycle" size="100" required="true" - label='%{getText("echobase.common.pingDutyCycle")}'/> - - <%--<s:textfield key="model.echosounderSoundSpeed" size="100" required="true"--%> - <%--label='%{getText("echobase.common.echosounderSoundSpeed")}'/>--%> - - <s:textfield key="model.soundSpeedCalculationsER60" size="100" - required="true" - label='%{getText("echobase.common.soundSpeedCalculationsER60")}'/> - - <s:textfield key="model.soundSpeedCalculationsME70" size="100" - required="true" - label='%{getText("echobase.common.soundSpeedCalculationsME70")}'/> - - <s:textfield key="model.sounderConstant" size="100" required="true" - label='%{getText("echobase.common.sounderConstant")}'/> - - <s:textfield key="model.processingTemplate" size="100" required="true" - label='%{getText("echobase.common.processingTemplate")}'/> - - <s:textfield key="model.processingDescription" size="100" required="true" - label='%{getText("echobase.common.processingDescription")}'/> - - <s:textfield key="model.digitThreshold" size="100" required="true" - label='%{getText("echobase.common.digitThreshold")}'/> - - <s:textfield key="model.acousticDensityUnit" size="100" required="true" - label='%{getText("echobase.common.acousticDensityUnit")}'/> - - <s:textfield key="model.notes" size="100" required="true" - label='%{getText("echobase.common.notes")}'/> - - <s:file key="moviesFile" required="true" - label='%{getText("echobase.common.moviesFile")}'/> - - </fieldset> - <br/> - <s:submit action="configureAccousticData" key='echobase.action.import'/> - -</s:form> - Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticData.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,126 @@ +<%-- + #%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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> +<title> + Configuration <s:text name="echobase.common.importMode.acoustic"/> +</title> + +<script type="text/javascript" + src="<s:url value='/js/gridHelper.js' />"></script> + +<script type="text/javascript"> + + jQuery(document).ready(function () { + + $.autoSelectVoyageAndVessel( + $('[name="model.voyageId"]'), + $('[name="model.vesselId"]'), + '<s:url action="getVesselsForVoyage" namespace="/importData"/>', + '<s:property value="model.voyageId"/>', + '<s:property value="model.vesselId"/>' + ); + }); +</script> + +<s:form namespace="/importData" method="POST" enctype="multipart/form-data"> + + <fieldset> + <legend> + <s:text name="echobase.legend.importData.configure"/> + </legend> + + <s:select key="model.voyageId" required="true" + label='%{getText("echobase.common.voyage")}' + list="voyages" headerKey="" headerValue=""/> + + <sj:select key="model.vesselId" required="true" + label='%{getText("echobase.common.vessel")}'/> + + <s:select key="model.cellPositionReference" required="true" + label='%{getText("echobase.common.cellPositionReference")}' + list="cellPositionReferences" headerKey="" headerValue=""/> + + <s:checkbox key="model.addDataAcquisition" + label='%{getText("echobase.common.addDataAcquisition")}'/> + + <s:textfield key="model.transceiverAcquisitionAbsorptionDescription" + size="80" required="true" + label='%{getText("echobase.common.transceiverAcquisitionAbsorptionDescription")}'/> + + <s:textfield key="model.acquisitionSoftwareVersionER60" size="80" + required="true" + label='%{getText("echobase.common.acquisitionSoftwareVersionER60")}'/> + + <s:textfield key="model.acquisitionSoftwareVersionME70" size="80" + required="true" + label='%{getText("echobase.common.acquisitionSoftwareVersionME70")}'/> + + <s:textfield key="model.loggedDataFormat" size="80" required="true" + label='%{getText("echobase.common.loggedDataFormat")}'/> + + <s:textfield key="model.loggedDataDatatype" size="80" required="true" + label='%{getText("echobase.common.loggedDataDatatype")}'/> + + <s:textfield key="model.pingDutyCycle" size="80" required="true" + label='%{getText("echobase.common.pingDutyCycle")}'/> + + <s:textfield key="model.soundSpeedCalculationsER60" size="80" + required="true" + label='%{getText("echobase.common.soundSpeedCalculationsER60")}'/> + + <s:textfield key="model.soundSpeedCalculationsME70" size="80" + required="true" + label='%{getText("echobase.common.soundSpeedCalculationsME70")}'/> + + <s:textfield key="model.sounderConstant" size="80" required="true" + label='%{getText("echobase.common.sounderConstant")}'/> + + <s:textfield key="model.processingTemplate" size="80" required="true" + label='%{getText("echobase.common.processingTemplate")}'/> + + <s:textfield key="model.processingDescription" size="80" required="true" + label='%{getText("echobase.common.processingDescription")}'/> + + <s:textfield key="model.digitThreshold" size="80" required="true" + label='%{getText("echobase.common.digitThreshold")}'/> + + <s:textfield key="model.acousticDensityUnit" size="80" required="true" + label='%{getText("echobase.common.acousticDensityUnit")}'/> + + <s:textfield key="model.notes" size="80" required="true" + label='%{getText("echobase.common.dataProcessingNotes")}'/> + + <s:file key="moviesFile" required="true" + label='%{getText("echobase.common.moviesFile")}'/> + + <s:textarea key="model.importNotes" cols="80" rows="5" + label='%{getText("echobase.common.importNotes")}'/> + </fieldset> + <br/> + <s:submit action="configureAcoustic-execute" key='echobase.action.import'/> + +</s:form> + Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,66 +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% - --%> -<%@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.catchesData"/> -</title> - -<script type="text/javascript"> - - jQuery(document).ready(function () { - - }); -</script> - -<s:form namespace="/importData" method="POST" enctype="multipart/form-data"> - - <fieldset> - <legend> - <s:text name="echobase.legend.importData.configure"/> - </legend> - - <s:select key="model.voyageId" required="true" - label='%{getText("echobase.common.voyage")}' - list="voyages" headerKey="" headerValue=""/> - - <s:file key="totalSampleFile" required="true" - label='%{getText("echobase.common.totalSampleFile")}'/> - - <s:file key="subSampleFile" required="true" - label='%{getText("echobase.common.subSampleFile")}'/> - - <s:file key="biometrySampleFile" required="true" - label='%{getText("echobase.common.biometrySampleFile")}'/> - </fieldset> - - <br/> - <s:submit action="configureCatchesData" key='echobase.action.import'/> - - -</s:form> \ No newline at end of file Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,69 @@ +<%-- + #%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% + --%> +<%@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.importMode.catches"/> +</title> + +<script type="text/javascript"> + + jQuery(document).ready(function () { + + }); +</script> + +<s:form namespace="/importData" method="POST" enctype="multipart/form-data"> + + <fieldset> + <legend> + <s:text name="echobase.legend.importData.configure"/> + </legend> + + <s:select key="model.voyageId" required="true" + label='%{getText("echobase.common.voyage")}' + list="voyages" headerKey="" headerValue=""/> + + <s:file key="totalSampleFile" required="true" + label='%{getText("echobase.common.totalSampleFile")}'/> + + <s:file key="subSampleFile" required="true" + label='%{getText("echobase.common.subSampleFile")}'/> + + <s:file key="biometrySampleFile" required="true" + label='%{getText("echobase.common.biometrySampleFile")}'/> + + <s:textarea key="model.importNotes" cols="80" rows="5" + label='%{getText("echobase.common.importNotes")}'/> + </fieldset> + + <br/> + <s:submit action="configureCatches-execute" key='echobase.action.import'/> + + +</s:form> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,149 +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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> - -<title> - Configuration <s:text name="echobase.common.importDataMode.commonData"/> -</title> - -<script type="text/javascript"> - - jQuery(document).ready(function () { - - $('[name="model.importMode"]').change(function (event) { - $('[class~="importMode"]').hide(); - $('#' + this.value).show(); - $('#' + this.value + ' .errorMessage').hide(); - }); - - var incomingVal = $('[name="model.importMode"][checked="checked"]').val(); - $('#' + incomingVal).show(); - - }); -</script> - -<s:radio id='mode' key='model.importMode' list="importModes" - cssClass="cleanBoth" - label='%{getText("echobase.common.importMode")}' - required="true" template="myradiomap"/> - -<hr/> - -<%--Import mode = ALL--%> - -<s:form id="ALL" namespace="/importData" method="POST" - enctype="multipart/form-data" cssClass="hidden importMode"> - - <fieldset> - <legend> - <s:text name="echobase.legend.importData.configure"/> - </legend> - - <s:select key="model.missionId" required="true" - label='%{getText("echobase.common.mission")}' - list="missions" headerKey="" headerValue=""/> - <br/> - - <s:hidden key="model.importMode" value="ALL" label=''/> - - <s:select key="model.areaOfOperationId" required="true" - label='%{getText("echobase.common.areaOfOperation")}' - list="areaOfOperations" headerKey="" headerValue=""/> - - <s:textfield key="model.voyageDescription" size="40" required="true" - label='%{getText("echobase.common.voyageDescription")}'/> - - <s:textfield key="model.datum" size="40" required="true" - label='%{getText("echobase.common.datum")}'/> - - <s:textfield key="model.transitRelatedActivity" size="40" required="true" - label='%{getText("echobase.common.transitRelatedActivity")}'/> - - <s:textfield key="model.transectLicence" size="40" required="true" - label='%{getText("echobase.common.transectLicence")}'/> - - <s:textfield key="model.transectGeospatialVerticalPositive" size="40" - required="true" - label='%{getText("echobase.common.transectGeospatialVerticalPositive")}'/> - - <s:textfield key="model.transectBinUnitsPingAxis" size="40" required="true" - label='%{getText("echobase.common.transectBinUnitsPingAxis")}'/> - - <s:file key="voyageFile" required="true" - label='%{getText("echobase.common.voyageFile")}'/> - - <s:file key="transitFile" required="true" - label='%{getText("echobase.common.transitFile")}'/> - - <s:file key="transectFile" required="true" - label='%{getText("echobase.common.transectFile")}'/> - - </fieldset> - - <br/> - <s:submit action="ConfigureCommonData-modeAll" key='echobase.action.import'/> - -</s:form> - -<%--Import mode = TRANSECT --%> - -<s:form id='TRANSECT' 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="TRANSECT" label=''/> - - <s:select key="model.voyageId" required="true" - label='%{getText("echobase.common.voyage")}' - list="voyages" headerKey="" headerValue=""/> - - <s:textfield key="model.datum" size="40" required="true" - label='%{getText("echobase.common.datum")}'/> - - <s:textfield key="model.transectLicence" size="40" required="true" - label='%{getText("echobase.common.transectLicence")}'/> - - <s:textfield key="model.transectGeospatialVerticalPositive" size="40" - required="true" - label='%{getText("echobase.common.transectGeospatialVerticalPositive")}'/> - - <s:textfield key="model.transectBinUnitsPingAxis" size="40" required="true" - label='%{getText("echobase.common.transectBinUnitsPingAxis")}'/> - - <s:file key="transectFile" required="true" - label='%{getText("echobase.common.transectFile")}'/> - - </fieldset> - - <br/> - <s:submit action="ConfigureCommonData-modeTransect" - key='echobase.action.import'/> - - -</s:form> \ No newline at end of file Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,154 @@ +<%-- + #%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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<title> + Configuration <s:text name="echobase.common.importMode.common"/> +</title> + +<script type="text/javascript"> + + jQuery(document).ready(function () { + + $('[name="model.importMode"]').change(function (event) { + $('[class~="importMode"]').hide(); + $('#' + this.value).show(); + $('#' + this.value + ' .errorMessage').hide(); + }); + + var incomingVal = $('[name="model.importMode"][checked="checked"]').val(); + $('#' + incomingVal).show(); + + }); +</script> + +<s:radio id='mode' key='model.importMode' list="importModes" + cssClass="cleanBoth" + label='%{getText("echobase.common.importMode")}' + required="true" template="myradiomap"/> + +<hr/> + +<%--Import mode = ALL--%> + +<s:form id="ALL" namespace="/importData" method="POST" + enctype="multipart/form-data" cssClass="hidden importMode"> + + <fieldset> + <legend> + <s:text name="echobase.legend.importData.configure"/> + </legend> + + <s:select key="model.missionId" required="true" + label='%{getText("echobase.common.mission")}' + list="missions" headerKey="" headerValue=""/> + <br/> + + <s:hidden key="model.importMode" value="ALL" label=''/> + + <s:select key="model.areaOfOperationId" required="true" + label='%{getText("echobase.common.areaOfOperation")}' + list="areaOfOperations" headerKey="" headerValue=""/> + + <s:textfield key="model.voyageDescription" size="80" required="true" + label='%{getText("echobase.common.voyageDescription")}'/> + + <s:textfield key="model.datum" size="80" required="true" + label='%{getText("echobase.common.datum")}'/> + + <s:textfield key="model.transitRelatedActivity" size="80" required="true" + label='%{getText("echobase.common.transitRelatedActivity")}'/> + + <s:textfield key="model.transectLicence" size="80" required="true" + label='%{getText("echobase.common.transectLicence")}'/> + + <s:textfield key="model.transectGeospatialVerticalPositive" size="80" + required="true" + label='%{getText("echobase.common.transectGeospatialVerticalPositive")}'/> + + <s:textfield key="model.transectBinUnitsPingAxis" size="80" required="true" + label='%{getText("echobase.common.transectBinUnitsPingAxis")}'/> + + <s:file key="voyageFile" required="true" + label='%{getText("echobase.common.voyageFile")}'/> + + <s:file key="transitFile" required="true" + label='%{getText("echobase.common.transitFile")}'/> + + <s:file key="transectFile" required="true" + label='%{getText("echobase.common.transectFile")}'/> + + <s:textarea key="model.importNotes" cols="80" rows="5" + label='%{getText("echobase.common.importNotes")}'/> + + </fieldset> + + <br/> + <s:submit action="configureCommon-modeAll" key='echobase.action.import'/> + +</s:form> + +<%--Import mode = TRANSECT --%> + +<s:form id='TRANSECT' 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="TRANSECT" label=''/> + + <s:select key="model.voyageId" required="true" + label='%{getText("echobase.common.voyage")}' + list="voyages" headerKey="" headerValue=""/> + + <s:textfield key="model.datum" size="80" required="true" + label='%{getText("echobase.common.datum")}'/> + + <s:textfield key="model.transectLicence" size="80" required="true" + label='%{getText("echobase.common.transectLicence")}'/> + + <s:textfield key="model.transectGeospatialVerticalPositive" size="80" + required="true" + label='%{getText("echobase.common.transectGeospatialVerticalPositive")}'/> + + <s:textfield key="model.transectBinUnitsPingAxis" size="80" required="true" + label='%{getText("echobase.common.transectBinUnitsPingAxis")}'/> + + <s:file key="transectFile" required="true" + label='%{getText("echobase.common.transectFile")}'/> + + <s:textarea key="model.importNotes" cols="80" rows="5" + label='%{getText("echobase.common.importNotes")}'/> + + </fieldset> + + <br/> + <s:submit action="configureCommon-modeTransect" key='echobase.action.import'/> + + +</s:form> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,60 +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% - --%> -<%@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.operation"/> -</title> - -<s:form namespace="/importData" method="POST" enctype="multipart/form-data"> - - <fieldset> - <legend> - <s:text - name="echobase.legend.importData.configure"/> - </legend> - - <s:select key="model.voyageId" required="true" - label='%{getText("echobase.common.voyage")}' - list="voyages" headerKey="" headerValue=""/> - - <s:file key="operationFile" required="true" - label='%{getText("echobase.common.operationFile")}'/> - - <s:file key="operationMetadataFile" required="true" - label='%{getText("echobase.common.operationMetadataFile")}'/> - - <s:file key="gearMetadataFile" required="true" - label='%{getText("echobase.common.gearMetadataFile")}'/> - - </fieldset> - - <br/> - <s:submit action="configureOperation" key='echobase.action.import'/> - -</s:form> \ No newline at end of file Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,63 @@ +<%-- + #%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% + --%> +<%@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.importMode.operation"/> +</title> + +<s:form namespace="/importData" method="POST" enctype="multipart/form-data"> + + <fieldset> + <legend> + <s:text + name="echobase.legend.importData.configure"/> + </legend> + + <s:select key="model.voyageId" required="true" + label='%{getText("echobase.common.voyage")}' + list="voyages" headerKey="" headerValue=""/> + + <s:file key="operationFile" required="true" + label='%{getText("echobase.common.operationFile")}'/> + + <s:file key="operationMetadataFile" required="true" + label='%{getText("echobase.common.operationMetadataFile")}'/> + + <s:file key="gearMetadataFile" required="true" + label='%{getText("echobase.common.gearMetadataFile")}'/> + + <s:textarea key="model.importNotes" cols="80" rows="5" + label='%{getText("echobase.common.importNotes")}'/> + + </fieldset> + + <br/> + <s:submit action="configureOperation-execute" key='echobase.action.import'/> + +</s:form> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: 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-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,180 +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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> -<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> -<title> - Configuration <s:text name="echobase.common.importDataMode.results"/> -</title> - -<script type="text/javascript" - src="<s:url value='/js/gridHelper.js' />"></script> - -<script type="text/javascript"> - - 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(); - - $.autoSelectVoyageAndDataProcessing( - $('#voyageSelectBox'), - $('#dataProcessingSelectBox'), - '<s:url action="getDataProcessingsForVoyage" namespace="/importData"/>', - '<s:property value="model.voyageId"/>', - '<s:property value="model.dataProcessingId"/>' - ); - }); -</script> - -<s:radio id='mode' key='model.importMode' list="importModes" - cssClass="cleanBoth" - label='%{getText("echobase.common.importMode")}' - required="true" template="myradiomap"/> - -<s:form id="VOYAGE" 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="VOYAGE" label=''/> - - <s:select key="model.voyageId" required="true" - label='%{getText("echobase.common.voyage")}' - list="voyages" headerKey="" headerValue=""/> - - <s:file key="lengthAgeKeyFile" required="true" - label='%{getText("echobase.common.lengthAgeKeyFile")}'/> - - <s:file key="lengthWeightKeyFile" required="true" - label='%{getText("echobase.common.lengthWeightKeyFile")}'/> - - <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="ESDU" 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="ESDU" label=''/> - - <s:select id='voyageSelectBox' key="model.voyageId" required="true" - label='%{getText("echobase.common.voyage")}' - list="voyages" headerKey="" headerValue=""/> - - <sj:select id='dataProcessingSelectBox' key="model.dataProcessingId" - required="true" - label='%{getText("echobase.common.dataProcessing")}'/> - - <s:textfield key="model.resultLabel" size="40" required="true" - label='%{getText("echobase.common.resultLabel")}'/> - - <s:file key="esduByEchotypeFile" required="true" - label='%{getText("echobase.common.esduByEchotypeFile")}'/> - - <s:file key="esduByEchotypeAndSpeciesCategoryFile" required="true" - label='%{getText("echobase.common.esduByEchotypeAndSpeciesCategoryFile")}'/> - - <s:file key="esduBySpeciesAndSizeCategoryFile" required="true" - label='%{getText("echobase.common.esduBySpeciesAndSizeCategoryFile")}'/> - - <s:file key="esduBySpeciesAndAgeCategoryFile" required="true" - label='%{getText("echobase.common.esduBySpeciesAndAgeCategoryFile")}'/> - </fieldset> - <br/> - <s:submit action="ConfigureResults-modeEsdu" key='echobase.action.import'/> -</s:form> - -<s:form id="REGION" 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="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-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="MAP" 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")}'/> - </fieldset> - <br/> - <s:submit action="ConfigureResults-modeMap" key='echobase.action.import'/> -</s:form> Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,192 @@ +<%-- + #%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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> +<title> + Configuration <s:text name="echobase.common.importMode.results"/> +</title> + +<script type="text/javascript" + src="<s:url value='/js/gridHelper.js' />"></script> + +<script type="text/javascript"> + + 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(); + + $.autoSelectVoyageAndDataProcessing( + $('#voyageSelectBox'), + $('#dataProcessingSelectBox'), + '<s:url action="getDataProcessingsForVoyage" namespace="/importData"/>', + '<s:property value="model.voyageId"/>', + '<s:property value="model.dataProcessingId"/>' + ); + }); +</script> + +<s:radio id='mode' key='model.importMode' list="importModes" + cssClass="cleanBoth" + label='%{getText("echobase.common.importMode")}' + required="true" template="myradiomap"/> + +<s:form id="VOYAGE" 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="VOYAGE" label=''/> + + <s:select key="model.voyageId" required="true" + label='%{getText("echobase.common.voyage")}' + list="voyages" headerKey="" headerValue=""/> + + <s:file key="lengthAgeKeyFile" required="true" + label='%{getText("echobase.common.lengthAgeKeyFile")}'/> + + <s:file key="lengthWeightKeyFile" required="true" + label='%{getText("echobase.common.lengthWeightKeyFile")}'/> + + <s:file key="echotypeFile" required="true" + label='%{getText("echobase.common.echotypeFile")}'/> + + <s:textarea key="model.importNotes" cols="80" rows="5" + label='%{getText("echobase.common.importNotes")}'/> + </fieldset> + <br/> + <s:submit action="configureResults-modeVoyage" key='echobase.action.import'/> +</s:form> + +<s:form id="ESDU" 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="ESDU" label=''/> + + <s:select id='voyageSelectBox' key="model.voyageId" required="true" + label='%{getText("echobase.common.voyage")}' + list="voyages" headerKey="" headerValue=""/> + + <sj:select id='dataProcessingSelectBox' key="model.dataProcessingId" + required="true" + label='%{getText("echobase.common.dataProcessing")}'/> + + <s:textfield key="model.resultLabel" size="40" required="true" + label='%{getText("echobase.common.resultLabel")}'/> + + <s:file key="esduByEchotypeFile" required="true" + label='%{getText("echobase.common.esduByEchotypeFile")}'/> + + <s:file key="esduByEchotypeAndSpeciesCategoryFile" required="true" + label='%{getText("echobase.common.esduByEchotypeAndSpeciesCategoryFile")}'/> + + <s:file key="esduBySpeciesAndSizeCategoryFile" required="true" + label='%{getText("echobase.common.esduBySpeciesAndSizeCategoryFile")}'/> + + <s:file key="esduBySpeciesAndAgeCategoryFile" required="true" + label='%{getText("echobase.common.esduBySpeciesAndAgeCategoryFile")}'/> + + <s:textarea key="model.importNotes" cols="80" rows="5" + label='%{getText("echobase.common.importNotes")}'/> + </fieldset> + <br/> + <s:submit action="configureResults-modeEsdu" key='echobase.action.import'/> +</s:form> + +<s:form id="REGION" 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="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")}'/> + + <s:textarea key="model.importNotes" cols="80" rows="5" + label='%{getText("echobase.common.importNotes")}'/> + </fieldset> + <br/> + <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="MAP" 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:textarea key="model.importNotes" cols="80" rows="5" + label='%{getText("echobase.common.importNotes")}'/> + </fieldset> + <br/> + <s:submit action="configureResults-modeMap" key='echobase.action.import'/> +</s:form> Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,43 +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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> -<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> - -<s:url id="url" action="importAccousticData" namespace="/importData"/> -<meta http-equiv="refresh" content="1;url=${url}"/> - -<title> - <s:text name="echobase.common.importDataMode.accousticData"/> - <s:text name="echobase.common.inProgress"/> -</title> - -<%-- TODO letellier 20111104 : Add warn icon --%> -<p><s:text name="echobase.message.warnImportInProgress"/></p> - -<br/> - -<div> - <sj:progressbar value="%{model.progression}"/> -</div> \ No newline at end of file Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,43 @@ +<%-- + #%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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> + +<s:url id="url" action="importAccoustic" namespace="/importData"/> +<meta http-equiv="refresh" content="1;url=${url}"/> + +<title> + <s:text name="echobase.common.importMode.acoustic"/> + <s:text name="echobase.common.inProgress"/> +</title> + +<%-- TODO letellier 20111104 : Add warn icon --%> +<p><s:text name="echobase.message.warnImportInProgress"/></p> + +<br/> + +<div> + <sj:progressbar value="%{model.progression}"/> +</div> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAcousticImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,43 +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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> -<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> - -<s:url id="url" action="importCatchesData" namespace="/importData"/> -<meta http-equiv="refresh" content="1;url=${url}"/> - -<title> - <s:text name="echobase.common.importDataMode.catchesData"/> - <s:text name="echobase.common.inProgress"/> -</title> - -<%-- TODO letellier 20111104 : Add warn icon --%> -<p><s:text name="echobase.message.warnImportInProgress"/></p> - -<br/> - -<div> - <sj:progressbar value="%{model.progression}"/> -</div> \ No newline at end of file Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,43 @@ +<%-- + #%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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> + +<s:url id="url" action="importCatches" namespace="/importData"/> +<meta http-equiv="refresh" content="1;url=${url}"/> + +<title> + <s:text name="echobase.common.importMode.catches"/> + <s:text name="echobase.common.inProgress"/> +</title> + +<%-- TODO letellier 20111104 : Add warn icon --%> +<p><s:text name="echobase.message.warnImportInProgress"/></p> + +<br/> + +<div> + <sj:progressbar value="%{model.progression}"/> +</div> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,43 +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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> -<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> - -<s:url id="url" action="importCommonData" namespace="/importData"/> -<meta http-equiv="refresh" content="1;url=${url}"/> - -<title> - <s:text name="echobase.common.importDataMode.commonData"/> - <s:text name="echobase.common.inProgress"/> -</title> - -<%-- TODO letellier 20111104 : Add warn icon --%> -<p><s:text name="echobase.message.warnImportInProgress"/></p> - -<br/> - -<div> - <sj:progressbar value="%{model.progression}"/> -</div> \ No newline at end of file Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,43 @@ +<%-- + #%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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> + +<s:url id="url" action="importCommon" namespace="/importData"/> +<meta http-equiv="refresh" content="1;url=${url}"/> + +<title> + <s:text name="echobase.common.importMode.common"/> + <s:text name="echobase.common.inProgress"/> +</title> + +<%-- TODO letellier 20111104 : Add warn icon --%> +<p><s:text name="echobase.message.warnImportInProgress"/></p> + +<br/> + +<div> + <sj:progressbar value="%{model.progression}"/> +</div> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,43 +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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> -<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> - -<s:url id="url" action="importOperation" namespace="/importData"/> -<meta http-equiv="refresh" content="1;url=${url}"/> - -<title> - <s:text name="echobase.common.importDataMode.operation"/> - <s:text name="echobase.common.inProgress"/> -</title> - -<%-- TODO letellier 20111104 : Add warn icon --%> -<p><s:text name="echobase.message.warnImportInProgress"/></p> - -<br/> - -<div> - <sj:progressbar value="%{model.progression}"/> -</div> \ No newline at end of file Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperationImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperationImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperationImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,43 @@ +<%-- + #%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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> + +<s:url id="url" action="importOperation" namespace="/importData"/> +<meta http-equiv="refresh" content="1;url=${url}"/> + +<title> + <s:text name="echobase.common.importMode.operation"/> + <s:text name="echobase.common.inProgress"/> +</title> + +<%-- TODO letellier 20111104 : Add warn icon --%> +<p><s:text name="echobase.message.warnImportInProgress"/></p> + +<br/> + +<div> + <sj:progressbar value="%{model.progression}"/> +</div> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperationImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,43 +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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> -<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> - -<s:url id="url" action="importResults" namespace="/importData"/> -<meta http-equiv="refresh" content="1;url=${url}"/> - -<title> - <s:text name="echobase.common.importDataMode.results"/> - <s:text name="echobase.common.inProgress"/> -</title> - -<%-- TODO letellier 20111104 : Add warn icon --%> -<p><s:text name="echobase.message.warnImportInProgress"/></p> - -<br/> - -<div> - <sj:progressbar value="%{model.progression}"/> -</div> \ No newline at end of file Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResultsImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResultsImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResultsImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,43 @@ +<%-- + #%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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> + +<s:url id="url" action="importResults" namespace="/importData"/> +<meta http-equiv="refresh" content="1;url=${url}"/> + +<title> + <s:text name="echobase.common.importMode.results"/> + <s:text name="echobase.common.inProgress"/> +</title> + +<%-- TODO letellier 20111104 : Add warn icon --%> +<p><s:text name="echobase.message.warnImportInProgress"/></p> + +<br/> + +<div> + <sj:progressbar value="%{model.progression}"/> +</div> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResultsImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,32 +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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> - -<title> - <s:text name="echobase.common.importResult"/> - <s:text name="echobase.common.importDataMode.accousticData"/> -</title> - -<%@ include file="/WEB-INF/includes/importDataResults.jsp" %> Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAcousticImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAcousticImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAcousticImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,32 @@ +<%-- + #%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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<title> + <s:text name="echobase.common.importResult"/> + <s:text name="echobase.common.importMode.acoustic"/> +</title> + +<%@ include file="/WEB-INF/includes/importDataResults.jsp" %> Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAcousticImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,32 +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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> - -<title> - <s:text name="echobase.common.importResult"/> - <s:text name="echobase.common.importDataMode.catchesData"/> -</title> - -<%@ include file="/WEB-INF/includes/importDataResults.jsp" %> Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,32 @@ +<%-- + #%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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<title> + <s:text name="echobase.common.importResult"/> + <s:text name="echobase.common.importMode.catches"/> +</title> + +<%@ include file="/WEB-INF/includes/importDataResults.jsp" %> Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,32 +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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> - -<title> - <s:text name="echobase.common.importResult"/> - <s:text name="echobase.common.importDataMode.commonData"/> -</title> - -<%@ include file="/WEB-INF/includes/importDataResults.jsp" %> \ No newline at end of file Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,31 @@ +<%-- + #%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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<title> + <s:text name="echobase.common.importMode.common"/> +</title> + +<%@ include file="/WEB-INF/includes/importDataResults.jsp" %> \ No newline at end of file Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,32 +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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> - -<title> - <s:text name="echobase.common.importResult"/> - <s:text name="echobase.common.importDataMode.operation"/> -</title> - -<%@ include file="/WEB-INF/includes/importDataResults.jsp" %> Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperationImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperationImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperationImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,32 @@ +<%-- + #%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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<title> + <s:text name="echobase.common.importResult"/> + <s:text name="echobase.common.importMode.operation"/> +</title> + +<%@ include file="/WEB-INF/includes/importDataResults.jsp" %> Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperationImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -1,36 +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% - --%> -<%@page contentType="text/html" pageEncoding="UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> - -<title> - <s:text name="echobase.common.importResult"/> -</title> - -<h4> - <s:text name="echobase.common.importDataMode.results"/> - ( <s:property value="%{getText(model.importMode.i18nKey)}"/> ) -</h4> - -<%@ include file="/WEB-INF/includes/importDataResults.jsp" %> Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResultsImport.jsp (from rev 458, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp) =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResultsImport.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResultsImport.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -0,0 +1,36 @@ +<%-- + #%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% + --%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<title> + <s:text name="echobase.common.importResult"/> +</title> + +<h4> + <s:text name="echobase.common.importMode.results"/> + ( <s:property value="%{getText(model.importMode.i18nKey)}"/> ) +</h4> + +<%@ include file="/WEB-INF/includes/importDataResults.jsp" %> Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResultsImport.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/selectImportType.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/selectImportType.jsp 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/selectImportType.jsp 2012-03-30 16:46:14 UTC (rev 460) @@ -32,7 +32,7 @@ // change the action target $('#selectImportType_configure').attr( 'name', - 'action:configure-' + newValue + '!input'); + 'action:configure' + newValue + '-input'); } jQuery(document).ready(function () { Modified: trunk/echobase-ui/src/main/webapp/css/screen.css =================================================================== --- trunk/echobase-ui/src/main/webapp/css/screen.css 2012-03-30 16:43:51 UTC (rev 459) +++ trunk/echobase-ui/src/main/webapp/css/screen.css 2012-03-30 16:46:14 UTC (rev 460) @@ -86,6 +86,11 @@ hr{ border:none; } + +fieldset pre,#errorStack { + font-size: larger; +} + #footer { clear: both; text-align: center; @@ -202,7 +207,7 @@ .wwlbl { clear: both; float: left; - width: 250px; + width: 350px; margin:5px 0; } .wwctrl { @@ -221,8 +226,9 @@ margin:10px 0; } .required { - color: #880000; + color: #ffe600; font-style: italic; + font-size: large; } .clearfix { display: inline-block; @@ -239,7 +245,7 @@ margin-left: 6em; margin-right: auto; margin-top: 0; - width: 615px; + /*width: 615px;*/ } div#headerRight { float: right; @@ -468,7 +474,28 @@ height:41px; } input[type="file"]{ + color: black; background-color: #FFF; + font-size: 120%; + /*height: 35px;*/ + /*border-style: inset;*/ + /*border-width: 2px;*/ + /*overflow: hidden;*/ + /*padding: 1px;*/ + /*zoom: 1;*/ + /*border-radius:0px;*/ + /*-moz-border-radius:0px;*/ + /*-webkit-border-radius:0px;*/ + width:600px; + /*max-width:300px !important;*/ + cursor:pointer; + /*float:right;*/ + /*display:block;*/ + /*clear:both;*/ +} + +/*input[type="file"]{ + background-color: #FFF; border-style: inset; border-width: 2px; overflow: hidden; @@ -477,14 +504,14 @@ border-radius:0px; -moz-border-radius:0px; -webkit-border-radius:0px; - width:auto !important; - max-width:none !important; + width:300px !important; + max-width:300px !important; cursor:pointer; float:right; display:block; clear:both; - -} +}*/ + #wwctrl_configure_model_voyageIds{ margin-bottom:20px; } @@ -681,4 +708,6 @@ .top a.i18nActive { border: 2px solid white; -} \ No newline at end of file +} + +#errorStack { padding:5px; width:80%; overflow:auto; } \ No newline at end of file