r989 - in trunk: . echobase-domain echobase-domain/src/main/java/fr/ifremer/echobase/config echobase-domain/src/main/java/fr/ifremer/echobase/csv echobase-domain/src/main/resources/i18n echobase-services echobase-services/src/main/java/fr/ifremer/echobase/services echobase-services/src/main/java/fr/ifremer/echobase/services/service echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportdb
Author: tchemit Date: 2014-03-23 20:03:58 +0100 (Sun, 23 Mar 2014) New Revision: 989 Url: http://forge.codelutin.com/projects/echobase/repository/revisions/989 Log: refs-50 #4821 Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/CoserApiService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/CommunityIndicatorExportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/CommunityIndicatorExportRow.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportCoserConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportCoserService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/PopulationIndicatorExportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/PopulationIndicatorExportRow.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/service/CoserApiServiceTest.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/GetZones.java trunk/echobase-ui/src/main/resources/config/struts-exportCoser.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/exportCoser/ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportCoser/ trunk/echobase-ui/src/main/webapp/images/stock_select_clear.png trunk/echobase-ui/src/main/webapp/images/stock_select_table.png trunk/src/site/en/rst/exportCoser.rst trunk/src/site/rst/exportCoser.rst Removed: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportMapConfiguration.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportMapService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportMap/ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportMap/ trunk/echobase-ui/src/main/resources/config/struts-exportMap.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/exportMap/ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportMap/ Modified: trunk/echobase-domain/pom.xml trunk/echobase-domain/src/main/java/fr/ifremer/echobase/config/EchoBaseConfiguration.java trunk/echobase-domain/src/main/java/fr/ifremer/echobase/config/EchoBaseConfigurationOption.java trunk/echobase-domain/src/main/java/fr/ifremer/echobase/csv/EchoBaseCsvUtil.java trunk/echobase-domain/src/main/resources/i18n/echobase-domain_en_GB.properties trunk/echobase-domain/src/main/resources/i18n/echobase-domain_fr_FR.properties trunk/echobase-services/pom.xml trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DefaultEchoBaseServiceContext.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContext.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/DbEditorService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/SpeciesExportModel.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportdb/ExportService.java trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/FakeEchoBaseServiceContext.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/Configure.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/Download.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/Export.java trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/exportCoser/Configure-validation.xml trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties trunk/echobase-ui/src/main/resources/struts.xml trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportCoser/configure.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportCoser/progress.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportCoser/result.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/information.jsp trunk/echobase-ui/src/main/webapp/css/screen.css trunk/echobase-ui/src/main/webapp/js/gridHelper.js trunk/pom.xml Modified: trunk/echobase-domain/pom.xml =================================================================== --- trunk/echobase-domain/pom.xml 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-domain/pom.xml 2014-03-23 19:03:58 UTC (rev 989) @@ -138,27 +138,22 @@ <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </dependency> - <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> </dependency> - <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> - <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> </dependency> - <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </dependency> - <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-exec</artifactId> @@ -175,12 +170,10 @@ <groupId>org.nuiton.topia</groupId> <artifactId>topia-persistence</artifactId> </dependency> - <dependency> <groupId>org.nuiton.topia</groupId> <artifactId>topia-service-migration</artifactId> </dependency> - <dependency> <groupId>org.nuiton.topia</groupId> <artifactId>topia-service-csv</artifactId> @@ -215,13 +208,11 @@ <artifactId>slf4j-jcl</artifactId> <scope>test</scope> </dependency> - <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <scope>test</scope> </dependency> - <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/config/EchoBaseConfiguration.java =================================================================== --- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/config/EchoBaseConfiguration.java 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/config/EchoBaseConfiguration.java 2014-03-23 19:03:58 UTC (rev 989) @@ -228,9 +228,9 @@ } public boolean isEmbedded() { - Boolean result = applicationConfig.getOptionAsBoolean( + boolean result = applicationConfig.getOptionAsBoolean( EchoBaseConfigurationOption.EMBEDDED.key); - return result != null && result; + return result; } public URL getDocumentationUrl() { @@ -239,14 +239,20 @@ return result; } + public URL getCoserApiURL() { + URL result = applicationConfig.getOptionAsURL( + EchoBaseConfigurationOption.COSER_API_URL.key); + return result; + } + public boolean getOptionAsBoolean(String propertyName) { - Boolean result = applicationConfig.getOptionAsBoolean(propertyName); - return result != null && result; + boolean result = applicationConfig.getOptionAsBoolean(propertyName); + return result; } public boolean isUpdateSchema() { - Boolean result = applicationConfig.getOptionAsBoolean(OPTION_UPDATE_SCHEMA); - return result != null && result; + boolean result = applicationConfig.getOptionAsBoolean(OPTION_UPDATE_SCHEMA); + return result; } /** Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/config/EchoBaseConfigurationOption.java =================================================================== --- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/config/EchoBaseConfigurationOption.java 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/config/EchoBaseConfigurationOption.java 2014-03-23 19:03:58 UTC (rev 989) @@ -20,8 +20,8 @@ */ package fr.ifremer.echobase.config; +import org.nuiton.config.ConfigOptionDef; import org.nuiton.util.Version; -import org.nuiton.config.ConfigOptionDef; import java.io.File; import java.net.URL; @@ -42,40 +42,51 @@ "/var/local/echobase/data", File.class), LIBRARY_DIRECTORY("echobase.lib.directory", - n("echobase.config.lib.directory.description"), - "${echobase.data.directory}/lib", - File.class), + n("echobase.config.lib.directory.description"), + "${echobase.data.directory}/lib", + File.class), INTERNAL_DB_DIRECTORY( "echobase.internal.db.directory", n("echobase.config.internal.db.directory.description"), - "${echobase.data.directory}/internaldb", File.class), + "${echobase.data.directory}/internaldb", + File.class), RSCRIPT_EXECTUABLE_PATH( "echobase.Rscript.executable.path", n("echobase.config.Rscript.executable.path.description"), - "/usr/bin/Rscript", File.class), + "/usr/bin/Rscript", + File.class), EMBEDDED("echobase.embedded", n("echobase.config.embedded.description"), - "false", boolean.class), + "false", + boolean.class), + COSER_API_URL("echobase.coser.api.url", + n("echobase.config.coser.api.url"), + "http://www.ifremer.fr/SIH-indices-campagnes/json", + URL.class), VERSION("echobase.version", n("echobase.config.version.description"), - "", Version.class), + "", + Version.class), H2_VERSION("echobase.h2Version", n("echobase.config.h2Version.description"), - "", String.class), + "", + String.class), POSTGRESQL_VERSION("echobase.postgresqlVersion", n("echobase.config.postgresqlVersion.description"), - "", String.class), + "", + String.class), CSV_SEPARATOR("echobase.csv.separator", n("echobase.config.csv.separator.description"), - ";", char.class), + ";", + char.class), WAR_LOCATION("echobase.war.location", n("echobase.config.war.location.description"), "${echobase.lib.directory}/echobase-embedded-${echobase.version}.war", File.class), LOG_CONFIG_FILE("echobase.log.config.file", - n("echobase.config.log.config.file.description"), - "${echobase.data.directory}/echobase-log.config", - File.class), + n("echobase.config.log.config.file.description"), + "${echobase.data.directory}/echobase-log.config", + File.class), DOCUMENTATION_URL("echobase.documentationUrl", n("echobase.config.documentationUrl.description"), "http://doc.codelutin.com/echobase", Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/csv/EchoBaseCsvUtil.java =================================================================== --- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/csv/EchoBaseCsvUtil.java 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/csv/EchoBaseCsvUtil.java 2014-03-23 19:03:58 UTC (rev 989) @@ -25,6 +25,7 @@ import fr.ifremer.echobase.entities.data.Voyage; import fr.ifremer.echobase.entities.references.DataMetadata; import fr.ifremer.echobase.entities.references.DataQuality; +import org.nuiton.csv.ValueParserFormatter; import org.nuiton.topia.service.csv.TopiaCsvCommons; import org.nuiton.csv.ValueParser; import org.nuiton.csv.ValueSetter; @@ -112,6 +113,9 @@ public static final String DEPTH_STRATUM_ID = "depthStratumId"; + public static final ValueParserFormatter<Date> YEAR = + new DateValue("yyyy"); + protected EchoBaseCsvUtil() { // avoid instanciation on helper class } Modified: trunk/echobase-domain/src/main/resources/i18n/echobase-domain_en_GB.properties =================================================================== --- trunk/echobase-domain/src/main/resources/i18n/echobase-domain_en_GB.properties 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-domain/src/main/resources/i18n/echobase-domain_en_GB.properties 2014-03-23 19:03:58 UTC (rev 989) @@ -27,6 +27,7 @@ echobase.common.importType.voyage=Voyage import echobase.common.importType.voyage.short=Complete voyage echobase.config.Rscript.executable.path.description=Location of the R command +echobase.config.coser.api.url=Url to request Coser API echobase.config.csv.separator.description=Csv separator character echobase.config.data.directory.description=Path to application data echobase.config.documentationUrl.description=Where to find EchoBase online documentation Modified: trunk/echobase-domain/src/main/resources/i18n/echobase-domain_fr_FR.properties =================================================================== --- trunk/echobase-domain/src/main/resources/i18n/echobase-domain_fr_FR.properties 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-domain/src/main/resources/i18n/echobase-domain_fr_FR.properties 2014-03-23 19:03:58 UTC (rev 989) @@ -27,6 +27,7 @@ echobase.common.importType.voyage=Import Campagne echobase.common.importType.voyage.short=Campagne complête echobase.config.Rscript.executable.path.description=Chemin vers l'exécutable R +echobase.config.coser.api.url=Url pour intérroger le site des indicateurs echobase.config.csv.separator.description=Caractère séparateur pour les fichiers csv echobase.config.data.directory.description=Répertoire des données de l'application echobase.config.documentationUrl.description=Où trouver la documentation en ligne d'EchoBase Modified: trunk/echobase-services/pom.xml =================================================================== --- trunk/echobase-services/pom.xml 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-services/pom.xml 2014-03-23 19:03:58 UTC (rev 989) @@ -114,17 +114,14 @@ <groupId>org.nuiton</groupId> <artifactId>nuiton-utils</artifactId> </dependency> - <dependency> <groupId>org.nuiton</groupId> <artifactId>nuiton-csv</artifactId> </dependency> - <dependency> <groupId>org.nuiton</groupId> <artifactId>nuiton-decorator</artifactId> </dependency> - <dependency> <groupId>org.nuiton.i18n</groupId> <artifactId>nuiton-i18n</artifactId> @@ -136,44 +133,54 @@ <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> - <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </dependency> - <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> </dependency> - <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-exec</artifactId> </dependency> - <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </dependency> - <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpcore</artifactId> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpmime</artifactId> + </dependency> + <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> </dependency> + <dependency> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + </dependency> + <!-- ToPIA dependencies --> <dependency> <groupId>org.nuiton.topia</groupId> <artifactId>topia-persistence</artifactId> </dependency> - <dependency> <groupId>org.nuiton.topia</groupId> <artifactId>topia-service-csv</artifactId> </dependency> - <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DefaultEchoBaseServiceContext.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DefaultEchoBaseServiceContext.java 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DefaultEchoBaseServiceContext.java 2014-03-23 19:03:58 UTC (rev 989) @@ -27,12 +27,9 @@ import fr.ifremer.echobase.entities.EchoBaseUserTopiaApplicationContext; import fr.ifremer.echobase.persistence.EchoBaseDbMeta; import org.apache.commons.lang3.time.DateUtils; -import org.nuiton.topia.persistence.TopiaDao; -import org.nuiton.topia.persistence.TopiaEntity; -import javax.inject.Named; -import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; +import java.net.URL; import java.util.Date; import java.util.Locale; @@ -57,6 +54,7 @@ protected EchoBaseDbMeta dbMeta; protected EchobaseAieOC injector; + public static EchoBaseServiceContext newContext( Locale locale, EchoBaseConfiguration configuration, @@ -72,7 +70,7 @@ this.locale = locale; this.configuration = configuration; this.dbMeta = dbMeta; - this.injector= new ServiceEchobaseAieOC(); + this.injector = new ServiceEchobaseAieOC(); } @Override @@ -128,6 +126,17 @@ } @Override + public String getUserDbUrl() { + String result = getEchoBaseUserPersistenceContext().getUrl(); + return result; + } + + @Override + public URL getCoserApiURL() { + return getConfiguration().getCoserApiURL(); + } + + @Override public <S extends EchoBaseService> S newService(Class<S> serviceClass) { // instantiate service using empty constructor S service; @@ -151,15 +160,8 @@ } catch (ClassNotFoundException e) { throw new EchoBaseTechnicalException(e); } -// service.setServiceContext(this); return service; } - @Override - public String getUserDbUrl() { - String result = getEchoBaseUserPersistenceContext().getUrl(); - return result; - } - } Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContext.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContext.java 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContext.java 2014-03-23 19:03:58 UTC (rev 989) @@ -27,6 +27,7 @@ import fr.ifremer.echobase.entities.EchoBaseUserTopiaApplicationContext; import fr.ifremer.echobase.persistence.EchoBaseDbMeta; +import java.net.URL; import java.util.Date; import java.util.Locale; @@ -63,4 +64,6 @@ String getUserDbUrl(); <S extends EchoBaseService> S newService(Class<S> serviceClass); + + URL getCoserApiURL(); } Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/CoserApiService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/CoserApiService.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/CoserApiService.java 2014-03-23 19:03:58 UTC (rev 989) @@ -0,0 +1,130 @@ +package fr.ifremer.echobase.services.service; + +/* + * #%L + * EchoBase :: Services + * %% + * Copyright (C) 2011 - 2014 Ifremer, Codelutin, Chemit Tony + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import com.google.common.base.Charsets; +import com.google.common.base.Preconditions; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import fr.ifremer.echobase.EchoBaseTechnicalException; +import fr.ifremer.echobase.services.EchoBaseServiceSupport; +import org.apache.commons.io.IOUtils; +import org.apache.http.NameValuePair; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.client.methods.RequestBuilder; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.message.BasicNameValuePair; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Collections; +import java.util.Map; +import java.util.Set; + +/** + * To request Coser API. + * <p/> + * Created on 3/23/14. + * + * @author Tony Chemit <chemit@codelutin.com> + * @since 2.5 + */ +public class CoserApiService extends EchoBaseServiceSupport { + + public Map<String, String> getFacades() { + + Type type = new TypeToken<Map<String, Map<String, String>>>() { + }.getType(); + Map<String, String> result = executeCoserRequest("get-facades", type); + return Collections.unmodifiableMap(result); + } + + public Map<String, String> getZonesForFacade(String facade) { + Preconditions.checkNotNull(facade); + Type type = new TypeToken<Map<String, Map<String, String>>>() { + }.getType(); + Map<String, String> result = executeCoserRequest("get-zones-for-facade", type, new BasicNameValuePair("facade", facade)); + return Collections.unmodifiableMap(result); + } + + public Set<String> getIndicators() { + + Type type = new TypeToken<Map<String, Set<String>>>() { + }.getType(); + Set<String> result = executeCoserRequest("get-indicators", type); + return Collections.unmodifiableSet(result); + } + + protected <T> T executeCoserRequest(String action, Type type, NameValuePair... nvps) { + + URI endPoint; + try { + URL endPointUrl = serviceContext.getCoserApiURL(); + String url = endPointUrl.toURI().toString(); + if (!url.endsWith("/")) { + url += "/"; + } + + endPoint = new URI(url + action); + + } catch (URISyntaxException e) { + throw new EchoBaseTechnicalException(e); + } + + HttpUriRequest build = RequestBuilder.get(). + setUri(endPoint). + addParameters(nvps). + build(); + + CloseableHttpResponse response; + try { + response = HttpClientBuilder.create().build().execute(build); + + } catch (IOException e) { + throw new EchoBaseTechnicalException("Could not execute request: " + build, e); + } + String stringContent; + InputStream content = null; + try { + content = response.getEntity().getContent(); + stringContent = IOUtils.toString(content, Charsets.UTF_8); + content.close(); + } catch (IOException e) { + throw new EchoBaseTechnicalException("Could not obtain response content", e); + } finally { + IOUtils.closeQuietly(content); + } + + try { + Map<String, T> resultcontent = new GsonBuilder().create().fromJson(stringContent, type); + T result = resultcontent.get("data"); + return result; + } catch (Exception e) { + throw new EchoBaseTechnicalException("Could not obtain response content from: " + action, e); + } + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/CoserApiService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/DbEditorService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/DbEditorService.java 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/DbEditorService.java 2014-03-23 19:03:58 UTC (rev 989) @@ -87,14 +87,6 @@ @Inject private EchoBaseUserPersistenceContext persistenceContext; - -// @Override -// public void setServiceContext(EchoBaseServiceContext serviceContext) { -// super.setServiceContext(serviceContext); -// persistenceService = serviceContext.newService(UserDbPersistenceService.class); -// persistenceContext = serviceContext.getEchoBaseUserPersistenceContext(); -// } - public <E extends TopiaEntity> List<E> getForeignData(Class<E> entityType) { Preconditions.checkNotNull(entityType); try { @@ -650,171 +642,4 @@ } return model; } - -// public <E extends TopiaEntity> List<E> getEntities(TableMeta<EchoBaseEntityEnum> tableMeta, TopiaPagerBean pager) { -// -// //TODO-tchemit-2012-08-19 Replace TopiaQuery with simple hql query -// List<E> result; -// EchoBaseEntityEnum entityEnum = tableMeta.getSource(); -// try { -// TopiaDao<E> dao = (TopiaDao<E>) getDAO(entityEnum.getContract()); -// -// // first query to count datas -// TopiaQuery countQuery = dao.createQuery("e"); -// countQuery.addSelect("count(*)"); -// String filterHql = null; -// -// Map<String, Object> filterParams = Maps.newHashMap(); -// -// if (pager != null && pager.canFilter()) { -// -// DecoratorService decoratorService = getDecoratorService(); -// -// // prepare the filter hql code -// List<FilterRule> rules = pager.getRules(); -// List<String> strFilterRules = Lists.newLinkedList(); -// long timestamp = System.currentTimeMillis(); -// int index = 0; -// for (FilterRule rule : rules) { -// String ruleFilter; -// -// String field = rule.getField(); -// -// ColumnMeta columnMeta = tableMeta.getColumns(field); -// Preconditions.checkNotNull( -// columnMeta, "no property named " + columnMeta); -// -// FilterRuleOperator op = rule.getOp(); -// String data = rule.getData(); -// String paramName = field + "_" + timestamp + (index++); -// String propertyName = "e." + field; -// Object realData = data; -// if (columnMeta.isFK()) { -// -// // must do a select in using the decoration pattern -// -// JXPathDecorator<?> decorator = -// (JXPathDecorator<?>) decoratorService.getDecorator(getLocale(), -// columnMeta.getType(), -// null); -// -// if (decorator.getNbToken() == 1) { -// -// // simple case one token -// String token = "f." + decorator.getProperty(0); -// -// String subQuery = op.toHql(paramName, -// token, -// data, -// filterParams); -// -// ruleFilter = propertyName + " in ( SELECT f FROM " + columnMeta.getType().getName() + " f WHERE " + subQuery + ")"; -// } else { -// -// throw new UnsupportedOperationException(); -// } -// -// -// } else { -// -// if (columnMeta.isNumber()) { -// if (columnMeta.getType() == int.class || -// columnMeta.getType() == Integer.class) { -// realData = Integer.valueOf(data); -// } else { -// -// realData = Double.valueOf(data); -// } -// } else if (columnMeta.isDate()) { -// propertyName = "str(" + propertyName + ")"; -// } -// ruleFilter = op.toHql(paramName, -// propertyName, -// realData, -// filterParams); -// -// } -// -// strFilterRules.add("(" + ruleFilter + ")"); -// } -// -// if (CollectionUtils.isNotEmpty(strFilterRules)) { -// FilterRuleGroupOperator groupOp = -// pager.getGroupOp(); -// filterHql = StringUtils.join(strFilterRules, groupOp.name()); -// } -// } -// -// if (filterHql != null) { -// if (log.isInfoEnabled()) { -// log.info("filterHql = " + filterHql); -// } -// for (Map.Entry<String, Object> e : filterParams.entrySet()) { -// String paramName = e.getKey(); -// Object paramValue = e.getValue(); -// if (log.isInfoEnabled()) { -// log.info("filterParam = " + -// paramName + "/" + paramValue); -// } -// countQuery.addParam(paramName, paramValue); -// } -// countQuery.addWhere(filterHql); -// -// String fullQuery = countQuery.fullQuery(); -// if (log.isInfoEnabled()) { -// log.info("fullquery = " + fullQuery); -// } -// } -// -// int count = dao.countByQuery(countQuery); -// -// TopiaQuery query = dao.createQuery("e"); -// -// if (pager != null) { -// -// pager.setRecords(count); -// PagerBeanUtil.computeRecordIndexesAndPagesNumber(pager); -// -// long from = pager.getRecordStartIndex(); -// long to = pager.getRecordEndIndex(); -// -// if (log.isDebugEnabled()) { -// log.debug("Count = " + count); -// log.debug("page = " + pager.getPageIndex()); -// log.debug("pageSize = " + pager.getPageSize()); -// log.debug("from = " + from); -// log.debug("to = " + to); -// log.debug("pageCount= " + pager.getPagesNumber()); -// } -// -// if (filterHql != null) { -// for (Map.Entry<String, Object> entry : filterParams.entrySet()) { -// String paramName = entry.getKey(); -// Object paramValue = entry.getValue(); -// query.addParam(paramName, paramValue); -// } -// query.addWhere(filterHql); -// } -// -// String sidx = pager.getSortColumn(); -// boolean ascendantOrder = pager.isSortAscendant(); -// -// if (StringUtils.isNotEmpty(sidx)) { -// if (ascendantOrder) { -// query.addOrder(sidx); -// } else { -// query.addOrderDesc(sidx); -// } -// } -// -// query.setLimit((int) from, (int) to - 1); -// } -// -// dao.findAllByQueryAndPager("hql", pager, filterParams.toString()); -// result = dao.findAllByQuery(query); -// return result; -// } catch (TopiaException eee) { -// throw new EchoBaseTechnicalException("Could not obtain data", eee); -// } -// } } Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java 2014-03-23 19:03:58 UTC (rev 989) @@ -25,6 +25,7 @@ import com.google.common.base.Optional; 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.EchoBaseTechnicalException; import fr.ifremer.echobase.entities.EchoBaseUserPersistenceContext; @@ -282,6 +283,16 @@ return dataMetadata; } + public DataMetadata tryToGetDataMetadataByName(String name) { + DataMetadata dataMetadata = persistenceContext.getDataMetadataDao(). + forNameEquals(name).findUniqueOrNull(); + return dataMetadata; + } + + public List<DataMetadata> getDataMetadatasInName(Set<String> names) { + return persistenceContext.getDataMetadataDao().forNameIn(names).findAll(); + } + //------------------------------------------------------------------------// //--- DataProcessing -----------------------------------------------------// //------------------------------------------------------------------------// @@ -490,6 +501,16 @@ return persistenceContext.getResultDao().findByTopiaId(id); } + public List<Result> getResultsForMissionAndDatametadata(Mission mission, DataMetadata metas) { + // TODO + return Lists.newArrayList(); + } + + public Map<String, Result> getResultForCellAndMetadata(Set<String> cellIds, DataMetadata standardDeviationDataMetadata) { + // TODO + return Maps.newTreeMap(); + } + public Result createResult(Result result) { Result resultCreated = persistenceContext.getResultDao().create(result); return resultCreated; Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/CommunityIndicatorExportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/CommunityIndicatorExportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/CommunityIndicatorExportModel.java 2014-03-23 19:03:58 UTC (rev 989) @@ -0,0 +1,47 @@ +package fr.ifremer.echobase.services.service.exportCoser; + +/* + * #%L + * EchoBase :: Services + * %% + * Copyright (C) 2011 - 2014 Ifremer, Codelutin, Chemit Tony + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import fr.ifremer.echobase.csv.EchoBaseCsvUtil; +import org.nuiton.csv.ext.AbstractExportModel; + +/** + * Created on 3/20/14. + * + * @author Tony Chemit <chemit@codelutin.com> + * @since 2.6 + */ +public class CommunityIndicatorExportModel extends AbstractExportModel<CommunityIndicatorExportRow> { + + public CommunityIndicatorExportModel(char separator) { + super(separator); + newColumnForExport("Campagne", EchoBaseCsvUtil.<CommunityIndicatorExportRow, String>newBeanProperty(CommunityIndicatorExportRow.PROPERTY_MISSION_NAME)); + newColumnForExport("Indicateur", EchoBaseCsvUtil.<CommunityIndicatorExportRow, String>newBeanProperty(CommunityIndicatorExportRow.PROPERTY_INDICATOR_NAME)); + newColumnForExport("Espece", EchoBaseCsvUtil.<CommunityIndicatorExportRow, String>newBeanProperty(CommunityIndicatorExportRow.PROPERTY_SPECIES_NAME)); + newColumnForExport("Strate", CommunityIndicatorExportRow.PROPERTY_STRATUM); + newColumnForExport("Annee", CommunityIndicatorExportRow.PROPERTY_DATE, EchoBaseCsvUtil.YEAR); + newColumnForExport("Estimation", CommunityIndicatorExportRow.PROPERTY_ESTIMATION); + newColumnForExport("EcartType", CommunityIndicatorExportRow.PROPERTY_STANDARD_DEVIATION); + newColumnForExport("CV", CommunityIndicatorExportRow.PROPERTY_CV); + } + +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/CommunityIndicatorExportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/CommunityIndicatorExportRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/CommunityIndicatorExportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/CommunityIndicatorExportRow.java 2014-03-23 19:03:58 UTC (rev 989) @@ -0,0 +1,127 @@ +package fr.ifremer.echobase.services.service.exportCoser; + +/* + * #%L + * EchoBase :: Services + * %% + * Copyright (C) 2011 - 2014 Ifremer, Codelutin, Chemit Tony + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import fr.ifremer.echobase.entities.references.DataMetadata; +import fr.ifremer.echobase.entities.references.Mission; +import fr.ifremer.echobase.entities.references.Species; + +import java.util.Date; + +/** + * Created on 3/20/14. + * + * @author Tony Chemit <chemit@codelutin.com> + * @since 2.6 + */ +public class CommunityIndicatorExportRow { + + public static final String PROPERTY_MISSION_NAME = "mission.name"; + + public static final String PROPERTY_INDICATOR_NAME = "indicator.name"; + + public static final String PROPERTY_SPECIES_NAME = "species.codeMemo"; + + public static final String PROPERTY_STRATUM = "stratum"; + + public static final String PROPERTY_DATE = "date"; + + public static final String PROPERTY_ESTIMATION = "estimation"; + + public static final String PROPERTY_STANDARD_DEVIATION = "standardDeviation"; + + public static final String PROPERTY_CV = "cv"; + + protected Mission mission; + + protected DataMetadata indicator; + + protected Species species; + + protected String stratum; + + protected Date date; + + protected float estimation; + + protected float standardDeviation; + + public Mission getMission() { + return mission; + } + + public DataMetadata getIndicator() { + return indicator; + } + + public Species getSpecies() { + return species; + } + + public String getStratum() { + return stratum; + } + + public Date getDate() { + return date; + } + + public float getEstimation() { + return estimation; + } + + public float getStandardDeviation() { + return standardDeviation; + } + + public float getCv() { + return standardDeviation / estimation; + } + + public void setMission(Mission mission) { + this.mission = mission; + } + + public void setIndicator(DataMetadata indicator) { + this.indicator = indicator; + } + + public void setSpecies(Species species) { + this.species = species; + } + + public void setStratum(String stratum) { + this.stratum = stratum; + } + + public void setDate(Date date) { + this.date = date; + } + + public void setEstimation(float estimation) { + this.estimation = estimation; + } + + public void setStandardDeviation(float standardDeviation) { + this.standardDeviation = standardDeviation; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/CommunityIndicatorExportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportCoserConfiguration.java (from rev 985, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportMap/ExportMapConfiguration.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportCoserConfiguration.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportCoserConfiguration.java 2014-03-23 19:03:58 UTC (rev 989) @@ -0,0 +1,186 @@ +package fr.ifremer.echobase.services.service.exportCoser; + +/* + * #%L + * EchoBase :: Services + * %% + * Copyright (C) 2011 - 2014 Ifremer, Codelutin, Chemit Tony + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import fr.ifremer.echobase.persistence.JdbcConfiguration; +import fr.ifremer.echobase.services.AbstractEchobaseActionConfiguration; +import fr.ifremer.echobase.services.ProgressModel; +import org.apache.commons.io.FileUtils; + +import java.io.File; +import java.io.IOException; +import java.util.Set; + +/** + * Created on 3/1/14. + * + * @author Tony Chemit <chemit@codelutin.com> + * @since 2.6 + */ +public class ExportCoserConfiguration extends AbstractEchobaseActionConfiguration { + + private static final long serialVersionUID = 1L; + + /** + * Working directory. + */ + private File workingDirectory; + + /** + * Final export file. + */ + private File exportFile; + + /** + * Id of voyage to export. + */ + private String missionId; + + /** + * Name of the Coser facade. + */ + private String facade; + + /** + * Name of the coser zone. + */ + private String zone; + + + /** + * Ids of community indicators to extract. + */ + private Set<String> communityIndicator; + + /** + * Ids of population indicators to extract. + */ + private Set<String> populationIndicator; + /** + * Should we produce raw data? + */ + private boolean publishRawData; + + /** + * Name of user performing the action. + */ + private String userName; + + /** + * Database configuration. + */ + private JdbcConfiguration dbConfiguration; + + public ExportCoserConfiguration() { + } + + public ExportCoserConfiguration(ProgressModel progressModel) { + super(progressModel); + } + + public File getWorkingDirectory() { + return workingDirectory; + } + + public void setWorkingDirectory(File workingDirectory) { + this.workingDirectory = workingDirectory; + } + + public File getExportFile() { + return exportFile; + } + + public void setExportFile(File exportFile) { + this.exportFile = exportFile; + } + + public String getFacade() { + return facade; + } + + public void setFacade(String facade) { + this.facade = facade; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getMissionId() { + return missionId; + } + + public void setMissionId(String missionId) { + this.missionId = missionId; + } + + public JdbcConfiguration getDbConfiguration() { + return dbConfiguration; + } + + public void setDbConfiguration(JdbcConfiguration dbConfiguration) { + this.dbConfiguration = dbConfiguration; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public boolean isPublishRawData() { + return publishRawData; + } + + public void setPublishRawData(boolean publishRawData) { + this.publishRawData = publishRawData; + } + + public Set<String> getCommunityIndicator() { + return communityIndicator; + } + + public void setCommunityIndicator(Set<String> communityIndicator) { + this.communityIndicator = communityIndicator; + } + + public Set<String> getPopulationIndicator() { + return populationIndicator; + } + + public void setPopulationIndicator(Set<String> populationIndicator) { + this.populationIndicator = populationIndicator; + } + + @Override + public void destroy() throws IOException { + if (workingDirectory != null) { + FileUtils.deleteDirectory(workingDirectory); + } + } +} Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportCoserService.java (from rev 985, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportMap/ExportMapService.java) =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportCoserService.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportCoserService.java 2014-03-23 19:03:58 UTC (rev 989) @@ -0,0 +1,454 @@ +package fr.ifremer.echobase.services.service.exportCoser; + +/* + * #%L + * EchoBase :: Services + * %% + * Copyright (C) 2011 - 2014 Ifremer, Codelutin, Chemit Tony + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import com.google.common.base.Charsets; +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import fr.ifremer.coser.CoserTechnicalException; +import fr.ifremer.coser.bean.EchoBaseProject; +import fr.ifremer.echobase.EchoBaseTechnicalException; +import fr.ifremer.echobase.entities.data.Result; +import fr.ifremer.echobase.entities.references.DataMetadata; +import fr.ifremer.echobase.entities.references.Mission; +import fr.ifremer.echobase.entities.references.Species; +import fr.ifremer.echobase.io.CommandLineUtils; +import fr.ifremer.echobase.io.EchoBaseIOUtil; +import fr.ifremer.echobase.persistence.JdbcConfiguration; +import fr.ifremer.echobase.services.EchoBaseServiceSupport; +import fr.ifremer.echobase.services.service.UserDbPersistenceService; +import org.apache.commons.exec.CommandLine; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.csv.Export; +import org.nuiton.util.TimeLog; + +import javax.inject.Inject; +import java.io.File; +import java.io.FilenameFilter; +import java.io.IOException; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Created on 3/1/14. + * + * @author Tony Chemit <chemit@codelutin.com> + * @since 2.6 + */ +public class ExportCoserService extends EchoBaseServiceSupport { + + /** Logger. */ + private static final Log log = LogFactory.getLog(ExportCoserService.class); + + public static final TimeLog timeLog = new TimeLog(ExportCoserService.class); + + public static final String EXTRACT_MAP_R_SCRIPT = "extractMap.r"; + + @Inject + private UserDbPersistenceService persistenceService; + + public void doExport(ExportCoserConfiguration model) throws IOException { + + Preconditions.checkNotNull(model); + Preconditions.checkNotNull(model.getDbConfiguration()); + Preconditions.checkNotNull(model.getMissionId()); + Preconditions.checkNotNull(model.getPopulationIndicator()); + Preconditions.checkNotNull(model.getCommunityIndicator()); + + model.setNbSteps(5 + + model.getPopulationIndicator().size() + + model.getCommunityIndicator().size()); + + Mission mission = persistenceService.getMission(model.getMissionId()); + Preconditions.checkNotNull(mission); + + File tempDirectory = model.getWorkingDirectory(); + + // 1 - invoke EchoR + File echRMapsDir = generateMaps(mission, + tempDirectory, + model.getDbConfiguration()); + model.incrementsProgress(); + + // 2 - create echobase project + EchoBaseProject project = createProject(tempDirectory, + model, + mission.getName()); + model.incrementsProgress(); + + // 3 - Extract source files + extractRawData(project, model); + model.incrementsProgress(); + + // 4 - Extract population indicators + extractPopulationIndicators(model, project, mission); + + // 5 - Extract community indicators + extractCommunityIndicators(model, project, mission); + + // 6 - Export species file + exportSpeciesFile(project); + model.incrementsProgress(); + + // 7 - create archive + File zipFile = generateArchive(mission, + project, + tempDirectory, + echRMapsDir); + model.setExportFile(zipFile); + + model.incrementsProgress(); + } + + //------------------------------------------------------------------------// + //--- Create / Zip coser project -----------------------------------------// + //------------------------------------------------------------------------// + + protected EchoBaseProject createProject(File tempDirectory, + ExportCoserConfiguration model, + String missionName) throws IOException { + + // Get current Year + Date currentDate = serviceContext.newDate(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(currentDate); + int currentYear = calendar.get(Calendar.YEAR); + + // create project directory + File projectDirectory = new File(tempDirectory, missionName + "-" + currentYear); + EchoBaseIOUtil.forceMkdir(projectDirectory); + + // create project + EchoBaseProject project = new EchoBaseProject(projectDirectory); + + project.setFacadeName(model.getFacade()); + project.setZoneName(model.getZone()); + project.setSurveyName(missionName); + project.setAuthor("EchoBase user: " + model.getUserName()); + project.setCreationDate(serviceContext.newDate()); + project.setComment("Created by Echobase application (db: " + getUserDbUrl() + ")"); + //FIXME when will publish some raw data. + project.setPubliableResult(false); + + project.save(); + + if (log.isInfoEnabled()) { + log.info("Project created at: " + project.getBasedir() + " with name: " + project.getName()); + } + return project; + } + + protected File generateArchive(Mission mission, + EchoBaseProject project, + File tempDirectory, + File echRMapsDir) throws IOException { + + copyMaps(project, echRMapsDir); + + String fileName = project.getZoneName() + "-" + project.getName() + ".zip"; + File zipFile = new File(tempDirectory, fileName); + + EchoBaseIOUtil.compressZipFile(zipFile, project.getBasedir()); + + FileUtils.deleteDirectory(project.getBasedir()); + zipFile.deleteOnExit(); + return zipFile; + } + + //------------------------------------------------------------------------// + //--- Extract population indicators --------------------------------------// + //------------------------------------------------------------------------// + + protected void extractPopulationIndicators(ExportCoserConfiguration model, + EchoBaseProject echoBaseProject, + Mission mission) { + + File exportFile = echoBaseProject.getPopulationIndicatorsFile(); + + PopulationIndicatorExportModel exportModel = new PopulationIndicatorExportModel(getCsvSeparator()); + + List<PopulationIndicatorExportRow> rows = Lists.newArrayList(); + + Set<String> indicators = model.getPopulationIndicator(); + for (String indicator : indicators) { + loadPopulationIndicatorValues(mission, indicator, rows); + } + Export<PopulationIndicatorExportRow> export = Export.newExport(exportModel, rows); + try { + export.write(exportFile, Charsets.UTF_8); + } catch (Exception e) { + throw new EchoBaseTechnicalException("Can not export population indicators", e); + } + model.incrementsProgress(); + } + + protected void loadPopulationIndicatorValues(Mission mission, + String indicator, + List<PopulationIndicatorExportRow> rows) { + + if (log.isInfoEnabled()) { + log.info("Extract population indicator: " + indicator); + } + DataMetadata dataMetadata = persistenceService.getDataMetadata(indicator); + DataMetadata standardDeviationDataMetadata = + persistenceService.tryToGetDataMetadataByName(dataMetadata.getName() + "_stdev"); + + Map<String, PopulationIndicatorExportRow> rowsByCellId = Maps.newTreeMap(); + + List<Result> results = persistenceService.getResultsForMissionAndDatametadata(mission, dataMetadata); + + for (Result result : results) { + // create row + PopulationIndicatorExportRow row = new PopulationIndicatorExportRow(); + row.setMission(mission); + row.setIndicator(dataMetadata); + row.setList("L1"); //FIXME FAKE! Should remove it + Species species = result.getCategory().getSpeciesCategory().getSpecies(); + row.setSpecies(species); + row.setStratum("Total"); //FIXME How to find this ? + row.setDate(new Date()); //FIXME How to find back date + row.setEstimation(Float.valueOf(result.getResultValue())); + row.setStandardDeviation(0); + if (standardDeviationDataMetadata != null) { + rowsByCellId.put(result.getCell().getTopiaId(), row); + } + } + + if (standardDeviationDataMetadata != null) { + + // find standard deviation values + + Map<String, Result> deviationResults = persistenceService.getResultForCellAndMetadata( + rowsByCellId.keySet(), standardDeviationDataMetadata); + + for (Map.Entry<String, Result> entry : deviationResults.entrySet()) { + String cellId = entry.getKey(); + Result deviationResult = entry.getValue(); + if (deviationResult != null) { + PopulationIndicatorExportRow row = rowsByCellId.get(cellId); + row.setStandardDeviation(Float.valueOf(deviationResult.getResultValue())); + } + } + } + rows.addAll(rows); + } + + //------------------------------------------------------------------------// + //--- Extract community indicators ---------------------------------------// + //------------------------------------------------------------------------// + + protected void extractCommunityIndicators(ExportCoserConfiguration model, + EchoBaseProject echoBaseProject, + Mission mission) { + + File exportFile = echoBaseProject.getCommunityIndicatorsFile(); + + CommunityIndicatorExportModel exportModel = new CommunityIndicatorExportModel(getCsvSeparator()); + + List<CommunityIndicatorExportRow> rows = Lists.newArrayList(); + + Set<String> indicators = model.getCommunityIndicator(); + for (String indicator : indicators) { + loadCommunityIndicatorValues(mission, indicator, rows); + } + Export<CommunityIndicatorExportRow> export = Export.newExport(exportModel, rows); + try { + export.write(exportFile, Charsets.UTF_8); + } catch (Exception e) { + throw new EchoBaseTechnicalException("Can not export community indicators", e); + } + + model.incrementsProgress(); + } + + protected void loadCommunityIndicatorValues(Mission mission, + String indicator, + List<CommunityIndicatorExportRow> rows) { + + if (log.isInfoEnabled()) { + log.info("Extract community indicator: " + indicator); + } + + DataMetadata dataMetadata = persistenceService.getDataMetadata(indicator); + DataMetadata standardDeviationDataMetadata = + persistenceService.tryToGetDataMetadataByName(dataMetadata.getName() + "_stdev"); + + Map<String, CommunityIndicatorExportRow> rowsByCellId = Maps.newTreeMap(); + + List<Result> results = persistenceService.getResultsForMissionAndDatametadata(mission, dataMetadata); + + for (Result result : results) { + // create row + CommunityIndicatorExportRow row = new CommunityIndicatorExportRow(); + row.setMission(mission); + row.setIndicator(dataMetadata); + Species species = result.getCategory().getSpeciesCategory().getSpecies(); + row.setSpecies(species); + row.setStratum("Total"); //FIXME How to find this ? + row.setDate(new Date()); //FIXME How to find back date + row.setEstimation(Float.valueOf(result.getResultValue())); + row.setStandardDeviation(0); + if (standardDeviationDataMetadata != null) { + rowsByCellId.put(result.getCell().getTopiaId(), row); + } + } + + if (standardDeviationDataMetadata != null) { + + // find standard deviation values + + Map<String, Result> deviationResults = persistenceService.getResultForCellAndMetadata( + rowsByCellId.keySet(), standardDeviationDataMetadata); + + for (Map.Entry<String, Result> entry : deviationResults.entrySet()) { + String cellId = entry.getKey(); + Result deviationResult = entry.getValue(); + if (deviationResult != null) { + CommunityIndicatorExportRow row = rowsByCellId.get(cellId); + row.setStandardDeviation(Float.valueOf(deviationResult.getResultValue())); + } + } + } + rows.addAll(rows); + } + + //------------------------------------------------------------------------// + //--- Generate Maps ------------------------------------------------------// + //------------------------------------------------------------------------// + + protected File generateMaps(Mission mission, + File tempDirectory, + JdbcConfiguration dbConfiguration) throws IOException { + + String missionName = mission.getName(); + + File rExecutableFile = getConfiguration().getRscriptExecutablePath(); + if (!EchoBaseIOUtil.isExecutableFile(rExecutableFile)) { + throw new EchoBaseTechnicalException("Could not find R executable at: " + rExecutableFile); + } + + if (log.isInfoEnabled()) { + log.info("Will invoke EchoR on mission: " + missionName); + log.info("Will connect to db: " + dbConfiguration.getUrl()); + } + File workingDirectory = new File(tempDirectory, "r"); + EchoBaseIOUtil.forceMkdir(workingDirectory); + + // copy script to temporary directory + String scriptPrefixPath = new File(workingDirectory, "EchoR").getAbsolutePath(); + File scriptFile = new File(tempDirectory, EXTRACT_MAP_R_SCRIPT); + EchoBaseIOUtil.copyResource("/rscript/" + EXTRACT_MAP_R_SCRIPT, scriptFile, true); + + // Extract params from jdbcurl + // example jdbc:postgresql://demo.codelutin.com/echobase-latest-2011-2.6 (port=5432) + // example jdbc:postgresql://demo.codelutin.com:5433/echobase-latest-2011-2.6 + String url = StringUtils.substringAfter(dbConfiguration.getUrl(), "jdbc:postgresql://"); + if (!url.contains("/")) { + throw new CoserTechnicalException("Invalid jdbc url: " + url + " (should contains a /"); + } + String dbHost = StringUtils.substringBefore(url, "/"); + String dbName = StringUtils.substringAfter(url, "/"); + String dbPort = "5432"; + if (dbHost.contains(":")) { + // a port is given + dbHost = StringUtils.substringBefore(dbHost, ":"); + dbPort = StringUtils.substringAfter(dbHost, ":"); + } + if (log.isInfoEnabled()) { + log.info("mission: " + missionName); + log.info("extractPath: " + scriptPrefixPath); + log.info("dbHost: " + dbHost); + log.info("dbPort: " + dbPort); + log.info("dbName: " + dbName); + } + + CommandLine commandLine = CommandLineUtils.newCommand( + rExecutableFile, + scriptFile, + missionName, + scriptPrefixPath, + dbHost, + dbPort, + dbName, + dbConfiguration.getLogin(), + dbConfiguration.getPassword()); + + CommandLineUtils.invokeCommandeLine(log, commandLine, "Failed to launch R script: " + scriptFile, workingDirectory); + + File result = new File(scriptPrefixPath + "meanMaps"); + return result; + } + + protected void copyMaps(EchoBaseProject coserProject, File mapsDirectory) throws IOException { + + File mapDir = coserProject.getMapsDirectory(); + + EchoBaseIOUtil.forceMkdir(mapDir); + + FilenameFilter filter = + EchoBaseProject.newMapSpeciesFilenameFilter(coserProject.getSurveyName()); + + // copy all of them in mapDir + File[] files = mapsDirectory.listFiles(filter); + if (files != null) { + for (File file : files) { + FileUtils.copyFileToDirectory(file, mapDir); + } + } + } + + //------------------------------------------------------------------------// + //--- Extract Raw Data ---------------------------------------------------// + //------------------------------------------------------------------------// + + protected void extractRawData(EchoBaseProject project, + ExportCoserConfiguration model) throws IOException { + //TODO Do this + if (log.isInfoEnabled()) { + log.info("Extract raw data for mission: " + model.getMissionId() + + " to : " + project.getRawDataDirectory()); + } + + FileUtils.write(new File(project.getRawDataDirectory(), "TODO.txt"), "TODO"); + } + + //------------------------------------------------------------------------// + //--- Extract Species File -----------------------------------------------// + //------------------------------------------------------------------------// + + protected void exportSpeciesFile(EchoBaseProject project) { + File speciesFile = project.getSpeciesDefinitionFile(); + SpeciesExportModel speciesExportModel = new SpeciesExportModel(getCsvSeparator()); + try { + Export.exportToFile(speciesExportModel, persistenceService.getSpecies(), speciesFile); + } catch (Exception e) { + throw new EchoBaseTechnicalException("Could not export species list to " + speciesFile, e); + } + } +} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportMapConfiguration.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportMap/ExportMapConfiguration.java 2014-03-17 17:26:31 UTC (rev 985) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportMapConfiguration.java 2014-03-23 19:03:58 UTC (rev 989) @@ -1,159 +0,0 @@ -package fr.ifremer.echobase.services.service.exportMap; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ - -import fr.ifremer.echobase.persistence.JdbcConfiguration; -import fr.ifremer.echobase.services.AbstractEchobaseActionConfiguration; -import fr.ifremer.echobase.services.ProgressModel; -import org.apache.commons.io.FileUtils; - -import java.io.File; -import java.io.IOException; - -/** - * Created on 3/1/14. - * - * @author Tony Chemit <chemit@codelutin.com> - * @since 2.6 - */ -public class ExportMapConfiguration extends AbstractEchobaseActionConfiguration { - - private static final long serialVersionUID = 1L; - - /** - * Working directory. - */ - private File workingDirectory; - - /** - * Final export file. - */ - private File exportFile; - - /** - * Id of voyage to export. - */ - private String missionId; - - /** - * Name of the facade. - */ - private String facadeName; - - /** - * Name of the export zone. - */ - private String zoneName; - - /** - * Should we produce raw data? - */ - private boolean publishRawData; - - /** - * Name of user performing the action. - */ - private String userName; - - /** - * Database configuration. - */ - private JdbcConfiguration dbConfiguration; - - public ExportMapConfiguration() { - } - - public ExportMapConfiguration(ProgressModel progressModel) { - super(progressModel); - } - - public File getWorkingDirectory() { - return workingDirectory; - } - - public void setWorkingDirectory(File workingDirectory) { - this.workingDirectory = workingDirectory; - } - - public File getExportFile() { - return exportFile; - } - - public void setExportFile(File exportFile) { - this.exportFile = exportFile; - } - - public String getMissionId() { - return missionId; - } - - public void setMissionId(String missionId) { - this.missionId = missionId; - } - - public String getFacadeName() { - return facadeName; - } - - public void setFacadeName(String facadeName) { - this.facadeName = facadeName; - } - - public String getZoneName() { - return zoneName; - } - - public void setZoneName(String zoneName) { - this.zoneName = zoneName; - } - - public JdbcConfiguration getDbConfiguration() { - return dbConfiguration; - } - - public void setDbConfiguration(JdbcConfiguration dbConfiguration) { - this.dbConfiguration = dbConfiguration; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public boolean isPublishRawData() { - return publishRawData; - } - - public void setPublishRawData(boolean publishRawData) { - this.publishRawData = publishRawData; - } - - @Override - public void destroy() throws IOException { - if (workingDirectory != null) { - FileUtils.deleteDirectory(workingDirectory); - } - } -} Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportMapService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportMap/ExportMapService.java 2014-03-17 17:26:31 UTC (rev 985) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/ExportMapService.java 2014-03-23 19:03:58 UTC (rev 989) @@ -1,257 +0,0 @@ -package fr.ifremer.echobase.services.service.exportMap; - -/* - * #%L - * EchoBase :: Services - * %% - * Copyright (C) 2011 - 2014 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ - -import com.google.common.base.Preconditions; -import fr.ifremer.coser.CoserTechnicalException; -import fr.ifremer.coser.bean.EchoBaseProject; -import fr.ifremer.echobase.EchoBaseTechnicalException; -import fr.ifremer.echobase.entities.references.Mission; -import fr.ifremer.echobase.io.CommandLineUtils; -import fr.ifremer.echobase.io.EchoBaseIOUtil; -import fr.ifremer.echobase.persistence.JdbcConfiguration; -import fr.ifremer.echobase.services.EchoBaseServiceSupport; -import fr.ifremer.echobase.services.service.UserDbPersistenceService; -import org.apache.commons.exec.CommandLine; -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.nuiton.csv.Export; -import org.nuiton.util.TimeLog; - -import javax.inject.Inject; -import java.io.File; -import java.io.FilenameFilter; -import java.io.IOException; -import java.util.Calendar; -import java.util.Date; - -/** - * Created on 3/1/14. - * - * @author Tony Chemit <chemit@codelutin.com> - * @since 2.6 - */ -public class ExportMapService extends EchoBaseServiceSupport { - - /** Logger. */ - private static final Log log = LogFactory.getLog(ExportMapService.class); - - public static final TimeLog timeLog = new TimeLog(ExportMapService.class); - - public static final String EXTRACT_MAP_R_SCRIPT = "extractMap.r"; - - @Inject - private UserDbPersistenceService persistenceService; - - public void doExport(ExportMapConfiguration model) throws IOException { - - Preconditions.checkNotNull(model); - Preconditions.checkNotNull(model.getDbConfiguration()); - Preconditions.checkNotNull(model.getFacadeName()); - Preconditions.checkNotNull(model.getZoneName()); - Preconditions.checkNotNull(model.getMissionId()); - - model.setNbSteps(7); - - Mission mission = persistenceService.getMission(model.getMissionId()); - Preconditions.checkNotNull(mission); - - String missionName = mission.getName(); - - File tempDirectory = model.getWorkingDirectory(); - - // 1 - invoke EchoR - File echRMapsDir = generateMaps(missionName, - tempDirectory, - model.getDbConfiguration()); - model.incrementsProgress(); - - // 2 - create echobase project - EchoBaseProject echoBaseProject = createProject(tempDirectory, - model, - missionName); - model.incrementsProgress(); - - // 3 - Extract source files - if (model.isPublishRawData()) { - extractRawData(echoBaseProject, model); - } - model.incrementsProgress(); - - - // 4 - Export species file - exportSpeciesFile(echoBaseProject); - model.incrementsProgress(); - - // 5 - Copy maps - copyMaps(echoBaseProject, echRMapsDir); - model.incrementsProgress(); - - // 6 - create archive - String fileName = model.getZoneName() + "-" + missionName + "-" + echoBaseProject.getName() + ".zip"; - File zipFile = new File(tempDirectory, fileName); - - model.setExportFile(zipFile); - EchoBaseIOUtil.compressZipFile(zipFile, echoBaseProject.getBasedir()); - model.incrementsProgress(); - - // 7 - delete archive - FileUtils.deleteDirectory(echoBaseProject.getBasedir()); - zipFile.deleteOnExit(); - model.incrementsProgress(); - } - - protected File generateMaps(String missionName, - File tempDirectory, - JdbcConfiguration dbConfiguration) throws IOException { - - File rExecutableFile = getConfiguration().getRscriptExecutablePath(); - if (!EchoBaseIOUtil.isExecutableFile(rExecutableFile)) { - throw new EchoBaseTechnicalException("Could not find R executable at: " + rExecutableFile); - } - - if (log.isInfoEnabled()) { - log.info("Will invoke EchoR on mission: " + missionName); - log.info("Will connect to db: " + dbConfiguration.getUrl()); - } - File workingDirectory = new File(tempDirectory, "r"); - EchoBaseIOUtil.forceMkdir(workingDirectory); - - // copy script to temporary directory - String scriptPrefixPath = new File(workingDirectory, "EchoR").getAbsolutePath(); - File scriptFile = new File(tempDirectory, EXTRACT_MAP_R_SCRIPT); - EchoBaseIOUtil.copyResource("/rscript/" + EXTRACT_MAP_R_SCRIPT, scriptFile, true); - - // Extract params from jdbcurl - // example jdbc:postgresql://demo.codelutin.com/echobase-latest-2011-2.6 (port=5432) - // example jdbc:postgresql://demo.codelutin.com:5433/echobase-latest-2011-2.6 - String url = StringUtils.substringAfter(dbConfiguration.getUrl(), "jdbc:postgresql://"); - if (!url.contains("/")) { - throw new CoserTechnicalException("Invalid jdbc url: " + url + " (should contains a /"); - } - String dbHost = StringUtils.substringBefore(url, "/"); - String dbName = StringUtils.substringAfter(url, "/"); - String dbPort = "5432"; - if (dbHost.contains(":")) { - // a port is given - dbHost = StringUtils.substringBefore(dbHost, ":"); - dbPort = StringUtils.substringAfter(dbHost, ":"); - } - if (log.isInfoEnabled()) { - log.info("mission: " + missionName); - log.info("extractPath: " + scriptPrefixPath); - log.info("dbHost: " + dbHost); - log.info("dbPort: " + dbPort); - log.info("dbName: " + dbName); - } - - CommandLine commandLine = CommandLineUtils.newCommand( - rExecutableFile, - scriptFile, - missionName, - scriptPrefixPath, - dbHost, - dbPort, - dbName, - dbConfiguration.getLogin(), - dbConfiguration.getPassword()); - - CommandLineUtils.invokeCommandeLine(log, commandLine, "Failed to launch R script: " + scriptFile, workingDirectory); - - File result = new File(scriptPrefixPath + "meanMaps"); - return result; - } - - protected EchoBaseProject createProject(File tempDirectory, - ExportMapConfiguration model, - String missionName) throws IOException { - - // Get current Year - Date currentDate = serviceContext.newDate(); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(currentDate); - int currentYear = calendar.get(Calendar.YEAR); - - // create project directory - File projectDirectory = new File(tempDirectory, missionName + "-" + currentYear); - EchoBaseIOUtil.forceMkdir(projectDirectory); - - // create project - EchoBaseProject project = new EchoBaseProject(projectDirectory); - - project.setFacadeName(model.getFacadeName()); - project.setZoneName(model.getZoneName()); - project.setSurveyName(missionName); - project.setAuthor("EchoBase user: " + model.getUserName()); - project.setCreationDate(serviceContext.newDate()); - project.setComment("Created by Echobase application (db: " + getUserDbUrl() + ")"); - project.setPubliableResult(model.isPublishRawData()); - - project.save(); - - if (log.isInfoEnabled()) { - log.info("Project created at: " + project.getBasedir() + " with name: " + project.getName()); - } - return project; - } - - protected void extractRawData(EchoBaseProject project, - ExportMapConfiguration model) throws IOException { - //TODO Do this - if (log.isInfoEnabled()) { - log.info("Extract raw data for mission: " + model.getMissionId() + - " to : " + project.getRawDataDirectory()); - } - - FileUtils.write(new File(project.getRawDataDirectory(), "TODO.txt"), "TODO"); - } - - protected void exportSpeciesFile(EchoBaseProject coserProject) { - File speciesFile = coserProject.getSpeciesDefinitionFile(); - SpeciesExportModel speciesExportModel = new SpeciesExportModel(getCsvSeparator()); - try { - Export.exportToFile(speciesExportModel, persistenceService.getSpecies(), speciesFile); - } catch (Exception e) { - throw new EchoBaseTechnicalException("Could not export species list to " + speciesFile, e); - } - } - - protected void copyMaps(EchoBaseProject coserProject, File mapsDirectory) throws IOException { - - File mapDir = coserProject.getMapsDirectory(); - - EchoBaseIOUtil.forceMkdir(mapDir); - - FilenameFilter filter = - EchoBaseProject.newMapSpeciesFilenameFilter(coserProject.getSurveyName()); - - // copy all of them in mapDir - File[] files = mapsDirectory.listFiles(filter); - if (files != null) { - for (File file : files) { - FileUtils.copyFileToDirectory(file, mapDir); - } - } - } -} Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/PopulationIndicatorExportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/PopulationIndicatorExportModel.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/PopulationIndicatorExportModel.java 2014-03-23 19:03:58 UTC (rev 989) @@ -0,0 +1,48 @@ +package fr.ifremer.echobase.services.service.exportCoser; + +/* + * #%L + * EchoBase :: Services + * %% + * Copyright (C) 2011 - 2014 Ifremer, Codelutin, Chemit Tony + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import fr.ifremer.echobase.csv.EchoBaseCsvUtil; +import org.nuiton.csv.ext.AbstractExportModel; + +/** + * Created on 3/20/14. + * + * @author Tony Chemit <chemit@codelutin.com> + * @since 2.6 + */ +public class PopulationIndicatorExportModel extends AbstractExportModel<PopulationIndicatorExportRow> { + + public PopulationIndicatorExportModel(char separator) { + super(separator); + newColumnForExport("Campagne", EchoBaseCsvUtil.<PopulationIndicatorExportRow, String>newBeanProperty(PopulationIndicatorExportRow.PROPERTY_MISSION_NAME)); + newColumnForExport("Indicateur", EchoBaseCsvUtil.<PopulationIndicatorExportRow, String>newBeanProperty(PopulationIndicatorExportRow.PROPERTY_INDICATOR_NAME)); + newColumnForExport("Liste", PopulationIndicatorExportRow.PROPERTY_LIST); + newColumnForExport("Espece", EchoBaseCsvUtil.<PopulationIndicatorExportRow, String>newBeanProperty(PopulationIndicatorExportRow.PROPERTY_SPECIES_NAME)); + newColumnForExport("Strate", PopulationIndicatorExportRow.PROPERTY_STRATUM); + newColumnForExport("Annee", PopulationIndicatorExportRow.PROPERTY_DATE, EchoBaseCsvUtil.YEAR); + newColumnForExport("Estimation", PopulationIndicatorExportRow.PROPERTY_ESTIMATION); + newColumnForExport("EcartType", PopulationIndicatorExportRow.PROPERTY_STANDARD_DEVIATION); + newColumnForExport("CV", PopulationIndicatorExportRow.PROPERTY_CV); + } + +} \ No newline at end of file Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/PopulationIndicatorExportModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/PopulationIndicatorExportRow.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/PopulationIndicatorExportRow.java (rev 0) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/PopulationIndicatorExportRow.java 2014-03-23 19:03:58 UTC (rev 989) @@ -0,0 +1,140 @@ +package fr.ifremer.echobase.services.service.exportCoser; + +/* + * #%L + * EchoBase :: Services + * %% + * Copyright (C) 2011 - 2014 Ifremer, Codelutin, Chemit Tony + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import fr.ifremer.echobase.entities.references.DataMetadata; +import fr.ifremer.echobase.entities.references.Mission; +import fr.ifremer.echobase.entities.references.Species; + +import java.util.Date; + +/** + * Created on 3/20/14. + * + * @author Tony Chemit <chemit@codelutin.com> + * @since 2.6 + */ +public class PopulationIndicatorExportRow { + + public static final String PROPERTY_MISSION_NAME = "mission.name"; + + public static final String PROPERTY_INDICATOR_NAME = "indicator.name"; + + public static final String PROPERTY_LIST = "list"; + + public static final String PROPERTY_SPECIES_NAME = "species.codeMemo"; + + public static final String PROPERTY_STRATUM = "stratum"; + + public static final String PROPERTY_DATE = "date"; + + public static final String PROPERTY_ESTIMATION = "estimation"; + + public static final String PROPERTY_STANDARD_DEVIATION = "standardDeviation"; + + public static final String PROPERTY_CV = "cv"; + + protected Mission mission; + + protected DataMetadata indicator; + + protected String list; + + protected Species species; + + protected String stratum; + + protected Date date; + + protected float estimation; + + protected float standardDeviation; + + public Mission getMission() { + return mission; + } + + public DataMetadata getIndicator() { + return indicator; + } + + public String getList() { + return list; + } + + + public Species getSpecies() { + return species; + } + + public String getStratum() { + return stratum; + } + + public Date getDate() { + return date; + } + + public float getEstimation() { + return estimation; + } + + public float getStandardDeviation() { + return standardDeviation; + } + + public float getCv() { + return standardDeviation / estimation; + } + + public void setMission(Mission mission) { + this.mission = mission; + } + + public void setIndicator(DataMetadata indicator) { + this.indicator = indicator; + } + + public void setList(String list) { + this.list = list; + } + + public void setSpecies(Species species) { + this.species = species; + } + + public void setStratum(String stratum) { + this.stratum = stratum; + } + + public void setDate(Date date) { + this.date = date; + } + + public void setEstimation(float estimation) { + this.estimation = estimation; + } + + public void setStandardDeviation(float standardDeviation) { + this.standardDeviation = standardDeviation; + } +} Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/PopulationIndicatorExportRow.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/SpeciesExportModel.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportMap/SpeciesExportModel.java 2014-03-17 17:26:31 UTC (rev 985) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportCoser/SpeciesExportModel.java 2014-03-23 19:03:58 UTC (rev 989) @@ -1,10 +1,10 @@ -package fr.ifremer.echobase.services.service.exportMap; +package fr.ifremer.echobase.services.service.exportCoser; /* * #%L * EchoBase :: Services * %% - * Copyright (C) 2011 - 2014 Ifremer, Codelutin + * Copyright (C) 2011 - 2014 Ifremer, Codelutin, Chemit Tony * %% * 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 Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportdb/ExportService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportdb/ExportService.java 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/service/exportdb/ExportService.java 2014-03-23 19:03:58 UTC (rev 989) @@ -62,12 +62,6 @@ @Inject private DecoratorService decoratorService; -// @Override -// public void setServiceContext(EchoBaseServiceContext serviceContext) { -// super.setServiceContext(serviceContext); -// persistenceService = serviceContext.newService(UserDbPersistenceService.class); -// } - public String exportData(TableMeta<EchoBaseUserEntityEnum> meta, boolean asSeen) { if (log.isInfoEnabled()) { Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/FakeEchoBaseServiceContext.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/FakeEchoBaseServiceContext.java 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/FakeEchoBaseServiceContext.java 2014-03-23 19:03:58 UTC (rev 989) @@ -44,6 +44,8 @@ import java.io.IOException; import java.io.InputStream; import java.lang.reflect.InvocationTargetException; +import java.net.MalformedURLException; +import java.net.URL; import java.util.Date; import java.util.Locale; import java.util.Properties; @@ -216,6 +218,15 @@ } @Override + public URL getCoserApiURL() { + try { + return new URL("http://localhost:8080/coser-web/json"); + } catch (MalformedURLException e) { + throw new EchoBaseTechnicalException(e); + } + } + + @Override public <S extends EchoBaseService> S newService(Class<S> serviceClass) { // instantiate service using empty constructor S service; Added: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/service/CoserApiServiceTest.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/service/CoserApiServiceTest.java (rev 0) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/service/CoserApiServiceTest.java 2014-03-23 19:03:58 UTC (rev 989) @@ -0,0 +1,86 @@ +package fr.ifremer.echobase.services.service; + +/* + * #%L + * EchoBase :: Services + * %% + * Copyright (C) 2011 - 2014 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import fr.ifremer.echobase.services.EchoBaseTestServiceSupport; +import fr.ifremer.echobase.services.FakeEchoBaseServiceContext; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.junit.Assert; +import org.junit.Assume; +import org.junit.BeforeClass; +import org.junit.Test; + +import javax.inject.Inject; +import java.io.IOException; +import java.net.URL; +import java.util.Map; +import java.util.Set; + +/** + * Created on 3/23/14. + * + * @author Tony Chemit <chemit@codelutin.com> + * @since 2.5 + */ +public class CoserApiServiceTest extends EchoBaseTestServiceSupport { + + @Inject + private CoserApiService service; + + @BeforeClass + public static void setupClass() { + URL coserApiURL = new FakeEchoBaseServiceContext(null).getCoserApiURL(); + try { + coserApiURL.openStream(); + } catch (IOException e) { + Assume.assumeTrue("Could not find coser server: "+coserApiURL, false); + } + } + @Test + public void testGetFacades() throws Exception { + + Map<String, String> facades = service.getFacades(); + Assert.assertTrue(MapUtils.isNotEmpty(facades)); + } + + @Test + public void testGetZonesForFacade() throws Exception { + Map<String, String> zones = service.getZonesForFacade("atlantique"); + Assert.assertTrue(MapUtils.isNotEmpty(zones)); + + zones = service.getZonesForFacade("atlantique" + System.nanoTime()); + Assert.assertTrue(MapUtils.isEmpty(zones)); + } + + @Test + public void testGetIndicators() throws Exception { + + Set<String> indicators = service.getIndicators(); + Assert.assertTrue(CollectionUtils.isNotEmpty(indicators)); + } + + @Override + protected FakeEchoBaseServiceContext initContext() { + return new FakeEchoBaseServiceContext(null); + } +} Property changes on: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/service/CoserApiServiceTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java 2014-03-23 19:03:58 UTC (rev 989) @@ -117,18 +117,6 @@ @Inject private transient EchoBaseServiceContext serviceContext; -// public void setApplicationContext(EchoBaseApplicationContext applicationContext) { -// this.applicationContext = applicationContext; -// } - -// public void setEchoBaseSession(EchoBaseSession echoBaseSession) { -// this.echoBaseSession = echoBaseSession; -// } - -// public void setServiceContext(EchoBaseServiceContext serviceContext) { -// this.serviceContext = serviceContext; -// } - public EchoBaseApplicationContext getEchoBaseApplicationContext() { Preconditions.checkNotNull("No applicationContext is your action " + this); return applicationContext; Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/Configure.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportMap/Configure.java 2014-03-17 17:26:31 UTC (rev 985) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/Configure.java 2014-03-23 19:03:58 UTC (rev 989) @@ -1,10 +1,10 @@ -package fr.ifremer.echobase.ui.actions.exportMap; +package fr.ifremer.echobase.ui.actions.exportCoser; /* * #%L * EchoBase :: UI * %% - * Copyright (C) 2011 - 2014 Ifremer, Codelutin + * Copyright (C) 2011 - 2014 Ifremer, Codelutin, Chemit Tony * %% * 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 @@ -21,19 +21,26 @@ * #L% */ +import com.google.common.collect.Maps; +import fr.ifremer.echobase.entities.references.DataMetadata; import fr.ifremer.echobase.entities.references.Mission; import fr.ifremer.echobase.persistence.JdbcConfiguration; -import fr.ifremer.echobase.services.service.exportMap.ExportMapConfiguration; +import fr.ifremer.echobase.services.service.CoserApiService; +import fr.ifremer.echobase.services.service.exportCoser.ExportCoserConfiguration; import fr.ifremer.echobase.ui.EchoBaseSession; import fr.ifremer.echobase.ui.actions.AbstractConfigureAction; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.util.FileUtil; +import javax.inject.Inject; import java.io.File; import java.io.IOException; +import java.util.List; import java.util.Map; +import java.util.Set; /** * Created on 3/1/14. @@ -41,50 +48,69 @@ * @author Tony Chemit <chemit@codelutin.com> * @since 2.6 */ -public class Configure extends AbstractConfigureAction<ExportMapConfiguration> { +public class Configure extends AbstractConfigureAction<ExportCoserConfiguration> { private static final long serialVersionUID = 1L; /** Logger. */ private static final Log log = LogFactory.getLog(Configure.class); - /** Universe of voyages to export in db. */ + @Inject + private transient CoserApiService coserApiService; + + /** + * Universe of missions. + */ protected Map<String, String> missions; + /** + * Universe of population indicators. + */ + protected Map<String, String> populationIndicators; + + /** + * Universe of community indicators. + */ + protected Map<String, String> communityIndicators; + + /** + * Universe of facades (coming from Coser). + */ + protected Map<String, String> facades; + + /** + * Universe of zones (coming from Coser) + * for a given facade. + */ + protected Map<String, String> zones; + public Configure() { - super(ExportMapConfiguration.class); + super(ExportCoserConfiguration.class); } public Map<String, String> getMissions() { return missions; } - - public String getFacadeName() { - return getModel().getFacadeName(); + public Map<String, String> getFacades() { + return facades; } - public void setFacadeName(String facadeName) { - getModel().setFacadeName(facadeName); + public Map<String, String> getZones() { + return zones; } - public String getZoneName() { - return getModel().getZoneName(); + public Map<String, String> getPopulationIndicators() { + return populationIndicators; } - public void setZoneName(String zoneName) { - getModel().setZoneName(zoneName); + public Map<String, String> getCommunityIndicators() { + return communityIndicators; } - public String getMissionId() { - return getModel().getMissionId(); - } - @Override - protected ExportMapConfiguration createModel() { - ExportMapConfiguration result = new ExportMapConfiguration(); - result.setFacadeName("atlantique"); - result.setZoneName("gdgciem8"); + protected ExportCoserConfiguration createModel() { + ExportCoserConfiguration result = new ExportCoserConfiguration(); EchoBaseSession userSession = getEchoBaseSession(); JdbcConfiguration workingDbConfiguration = userSession.getWorkingDbConfiguration(); @@ -94,25 +120,47 @@ } @Override - protected void prepareInputAction(ExportMapConfiguration model) { - - missions = userDbPersistenceService.loadSortAndDecorate(Mission.class); + protected void prepareInputAction(ExportCoserConfiguration model) { + loadInputs(); } @Override - protected void prepareExecuteAction(ExportMapConfiguration model) throws IOException { + protected void prepareExecuteAction(ExportCoserConfiguration model) throws IOException { File tempDirectory = FileUtils.getTempDirectory(); File dataDirectory = new File(tempDirectory, - "echobase-exportMap-" + - System.currentTimeMillis() - ); + "echobase-exportCoser-" + System.currentTimeMillis()); FileUtil.createDirectoryIfNecessary(dataDirectory); model.setWorkingDirectory(dataDirectory); if (log.isInfoEnabled()) { log.info("Temporary directory to use : " + dataDirectory); } + loadInputs(); + } + protected void loadInputs() { + + // Get missions missions = userDbPersistenceService.loadSortAndDecorate(Mission.class); + + // Get facades from Coser + facades = coserApiService.getFacades(); + + // Get Zones from Coser + if (StringUtils.isNotEmpty(getModel().getFacade())) { + + zones = coserApiService.getZonesForFacade(getModel().getFacade()); + } else { + + // No zone to display + zones = Maps.newHashMap(); + } + + // Get indicators names from Coser + Set<String> indicatorNames = coserApiService.getIndicators(); + + List<DataMetadata> dataMetadatas = userDbPersistenceService.getDataMetadatasInName(indicatorNames); + populationIndicators = decoratorService.sortAndDecorate(getLocale(), dataMetadatas, null); + communityIndicators = decoratorService.sortAndDecorate(getLocale(), dataMetadatas, null); } } Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/Download.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportMap/Download.java 2014-03-17 17:26:31 UTC (rev 985) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/Download.java 2014-03-23 19:03:58 UTC (rev 989) @@ -1,10 +1,10 @@ -package fr.ifremer.echobase.ui.actions.exportMap; +package fr.ifremer.echobase.ui.actions.exportCoser; /* * #%L * EchoBase :: UI * %% - * Copyright (C) 2011 - 2014 Ifremer, Codelutin + * Copyright (C) 2011 - 2014 Ifremer, Codelutin, Chemit Tony * %% * 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 @@ -21,7 +21,7 @@ * #L% */ -import fr.ifremer.echobase.services.service.exportMap.ExportMapConfiguration; +import fr.ifremer.echobase.services.service.exportCoser.ExportCoserConfiguration; import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; import java.io.BufferedInputStream; @@ -70,17 +70,17 @@ @Override public String execute() throws Exception { - ExportMapConfiguration model = - getEchoBaseSession().getActionConfiguration(ExportMapConfiguration.class); + ExportCoserConfiguration model = + getEchoBaseSession().getActionConfiguration(ExportCoserConfiguration.class); if (model == null) { - addFlashError(t("echobase.error.no.exportMap.configurationFound")); + addFlashError(t("echobase.error.no.exportCoser.configurationFound")); return ERROR; } File exportFile = model.getExportFile(); if (exportFile == null) { - addFlashError(t("echobase.error.no.exportMap.exportFileFound")); + addFlashError(t("echobase.error.no.exportCoser.exportFileFound")); return ERROR; } Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/Export.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportMap/Export.java 2014-03-17 17:26:31 UTC (rev 985) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/Export.java 2014-03-23 19:03:58 UTC (rev 989) @@ -1,10 +1,10 @@ -package fr.ifremer.echobase.ui.actions.exportMap; +package fr.ifremer.echobase.ui.actions.exportCoser; /* * #%L * EchoBase :: UI * %% - * Copyright (C) 2011 - 2014 Ifremer, Codelutin + * Copyright (C) 2011 - 2014 Ifremer, Codelutin, Chemit Tony * %% * 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 @@ -21,8 +21,8 @@ * #L% */ -import fr.ifremer.echobase.services.service.exportMap.ExportMapConfiguration; -import fr.ifremer.echobase.services.service.exportMap.ExportMapService; +import fr.ifremer.echobase.services.service.exportCoser.ExportCoserConfiguration; +import fr.ifremer.echobase.services.service.exportCoser.ExportCoserService; import fr.ifremer.echobase.ui.actions.AbstractWaitAndExecAction; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -33,7 +33,7 @@ * @author Tony Chemit <chemit@codelutin.com> * @since 2.6 */ -public class Export extends AbstractWaitAndExecAction<ExportMapConfiguration, ExportMapService> { +public class Export extends AbstractWaitAndExecAction<ExportCoserConfiguration, ExportCoserService> { private static final long serialVersionUID = 1L; @@ -41,36 +41,36 @@ private static final Log log = LogFactory.getLog(Export.class); public Export() { - super(ExportMapConfiguration.class, ExportMapService.class); + super(ExportCoserConfiguration.class, ExportCoserService.class); } @Override - protected void startAction(ExportMapService service, - ExportMapConfiguration model) throws Exception { + protected void startAction(ExportCoserService service, + ExportCoserConfiguration model) throws Exception { if (log.isInfoEnabled()) { - log.info("Start export map for mission" + model.getMissionId()); + log.info("Start Coser export for mission" + model.getMissionId()); } service.doExport(model); } @Override protected String getSuccesMessage() { - return t("echobase.info.exportMap.succeded"); + return t("echobase.info.exportCoser.succeded"); } @Override protected String getErrorMessage() { - return t("echobase.info.exportMap.failed"); + return t("echobase.info.exportCoser.failed"); } @Override public String getActionResumeTitle() { - return t("echobase.legend.exportMap.resume"); + return t("echobase.legend.exportCoser.resume"); } @Override - protected String getResultMessage(ExportMapConfiguration model) { - String result = t("echobase.message.exportMap.result", + protected String getResultMessage(ExportCoserConfiguration model) { + String result = t("echobase.message.exportCoser.result", model.getExportFile().getName(), model.getActionTime()); Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/GetZones.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/GetZones.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/GetZones.java 2014-03-23 19:03:58 UTC (rev 989) @@ -0,0 +1,58 @@ +package fr.ifremer.echobase.ui.actions.exportCoser; + +/* + * #%L + * EchoBase :: UI + * %% + * Copyright (C) 2011 - 2014 Ifremer, Codelutin, Chemit Tony + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import fr.ifremer.echobase.services.service.CoserApiService; +import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; + +import javax.inject.Inject; +import java.util.Map; + +/** + * Created on 3/23/14. + * + * @author Tony Chemit <chemit@codelutin.com> + * @since 2.5 + */ +public class GetZones extends EchoBaseActionSupport { + + private static final long serialVersionUID = 1L; + + @Inject + private transient CoserApiService coserApiService; + + protected Map<String, String> zones; + + protected String facade; + + public void setFacade(String facade) { + this.facade = facade; + } + + public Map<String, String> getZones() { + if (zones == null) { + + zones = coserApiService.getZonesForFacade(facade); + } + return zones; + } +} Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportCoser/GetZones.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Copied: trunk/echobase-ui/src/main/resources/config/struts-exportCoser.xml (from rev 985, trunk/echobase-ui/src/main/resources/config/struts-exportMap.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/config/struts-exportCoser.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/config/struts-exportCoser.xml 2014-03-23 19:03:58 UTC (rev 989) @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + #%L + EchoBase :: UI + %% + 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 struts PUBLIC + "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" + "http://struts.apache.org/dtds/struts-2.3.dtd"> + +<struts> + + <package name="exportCoser" extends="logguedAndWithDb" namespace="/exportCoser"> + + <!-- Configure export (input) --> + <action name="configureInput" method="input" + class="fr.ifremer.echobase.ui.actions.exportCoser.Configure"> + <result name="input">/WEB-INF/jsp/exportCoser/configure.jsp</result> + </action> + + <!-- Configure export --> + <action name="configure" method="execute" + class="fr.ifremer.echobase.ui.actions.exportCoser.Configure"> + <interceptor-ref name="prepareParamsStackLogguedWithDb"/> + <result name="input">/WEB-INF/jsp/exportCoser/configure.jsp</result> + <result type="redirectAction"> + <param name="namespace">/exportCoser</param> + <param name="actionName">export</param> + </result> + </action> + + <!-- Build export --> + <action name="export" method="execute" + class="fr.ifremer.echobase.ui.actions.exportCoser.Export"> + <interceptor-ref name="basicStackLogguedWithdb"/> + <interceptor-ref name="execAndWait"/> + <result name="wait">/WEB-INF/jsp/exportCoser/progress.jsp</result> + <result type="redirectAction"> + <param name="namespace">/exportCoser</param> + <param name="actionName">result</param> + </result> + </action> + + <!-- Result Build export --> + <action name="result" method="result" + class="fr.ifremer.echobase.ui.actions.exportCoser.Export"> + <result>/WEB-INF/jsp/exportCoser/result.jsp</result> + </action> + + <!-- Download export --> + <action name="download" method="execute" + class="fr.ifremer.echobase.ui.actions.exportCoser.Download"> + <interceptor-ref name="prepareParamsStackLogguedWithDb"/> + <result type="stream"> + <param name="contentType">${contentType}</param> + <param name="contentLength">${contentLength}</param> + <param name="contentDisposition">attachment; filename="${fileName}"</param> + </result> + </action> + + <!-- Get zones for a given facade --> + <action name="getZones" + class="fr.ifremer.echobase.ui.actions.exportCoser.GetZones"> + <result type="json"/> + </action> + + </package> + +</struts> + Deleted: trunk/echobase-ui/src/main/resources/config/struts-exportMap.xml =================================================================== --- trunk/echobase-ui/src/main/resources/config/struts-exportMap.xml 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-ui/src/main/resources/config/struts-exportMap.xml 2014-03-23 19:03:58 UTC (rev 989) @@ -1,77 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!-- - #%L - EchoBase :: UI - %% - 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 struts PUBLIC - "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" - "http://struts.apache.org/dtds/struts-2.3.dtd"> - -<struts> - - <package name="exportMap" extends="logguedAndWithDb" namespace="/exportMap"> - - <!-- Configure export (input) --> - <action name="configureInput" method="input" - class="fr.ifremer.echobase.ui.actions.exportMap.Configure"> - <result name="input">/WEB-INF/jsp/exportMap/configure.jsp</result> - </action> - - <!-- Configure export --> - <action name="configure" method="execute" - class="fr.ifremer.echobase.ui.actions.exportMap.Configure"> - <interceptor-ref name="prepareParamsStackLogguedWithDb"/> - <result name="input">/WEB-INF/jsp/exportMap/configure.jsp</result> - <result type="redirectAction"> - <param name="namespace">/exportMap</param> - <param name="actionName">export</param> - </result> - </action> - - <!-- Build export --> - <action name="export" method="execute" - class="fr.ifremer.echobase.ui.actions.exportMap.Export"> - <interceptor-ref name="basicStackLogguedWithdb"/> - <interceptor-ref name="execAndWait"/> - <result name="wait">/WEB-INF/jsp/exportMap/progress.jsp</result> - <result type="redirectAction"> - <param name="namespace">/exportMap</param> - <param name="actionName">result</param> - </result> - </action> - - <!-- Result Build export --> - <action name="result" method="result" - class="fr.ifremer.echobase.ui.actions.exportMap.Export"> - <result>/WEB-INF/jsp/exportMap/result.jsp</result> - </action> - - <!-- Download export --> - <action name="download" method="execute" - class="fr.ifremer.echobase.ui.actions.exportMap.Download"> - <interceptor-ref name="prepareParamsStackLogguedWithDb"/> - <result type="stream"> - <param name="contentType">${contentType}</param> - <param name="contentLength">${contentLength}</param> - <param name="contentDisposition">attachment; filename="${fileName}"</param> - </result> - </action> - - </package> - -</struts> - Modified: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/exportCoser/Configure-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/exportMap/Configure-validation.xml 2014-03-17 17:26:31 UTC (rev 985) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/exportCoser/Configure-validation.xml 2014-03-23 19:03:58 UTC (rev 989) @@ -22,20 +22,34 @@ <field name="model.missionId"> <field-validator type="requiredstring"> - <message key="echobase.error.exportMap.mission.required"/> + <message key="echobase.error.exportCoser.mission.required"/> </field-validator> </field> - <field name="model.facadeName"> + <field name="model.facade"> <field-validator type="requiredstring"> - <message key="echobase.error.exportMap.facadeName.required"/> + <message key="echobase.error.exportCoser.facade.required"/> </field-validator> </field> - <field name="model.zoneName"> + <field name="model.zone"> <field-validator type="requiredstring"> - <message key="echobase.error.exportMap.zoneName.required"/> + <message key="echobase.error.exportCoser.zone.required"/> </field-validator> </field> + <field name="model.populationIndicator"> + <field-validator type="fieldexpression"> + <param name="expression">!(model.populationIndicator == null || model.populationIndicator.empty)</param> + <message key="echobase.error.exportCoser.populationIndicator.required"/> + </field-validator> + </field> + + <field name="model.communityIndicator"> + <field-validator type="fieldexpression"> + <param name="expression">!(model.communityIndicator == null || model.communityIndicator.empty)</param> + <message key="echobase.error.exportCoser.communityIndicator.required"/> + </field-validator> + </field> + </validators> Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties =================================================================== --- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties 2014-03-23 19:03:58 UTC (rev 989) @@ -15,8 +15,8 @@ echobase.action.delete.selectedImport=Delete selected imports echobase.action.deleteConfiguration=Delete echobase.action.downloadEmbeddedApplicationFile=Download the portable database +echobase.action.downloadExportCoserFile=Download Coser export file echobase.action.downloadExportDbFile=Download database export file -echobase.action.downloadExportMapFile=Download voyage maps export file echobase.action.export=Export echobase.action.exportSqlData=Data export echobase.action.exportTable=Export @@ -35,8 +35,8 @@ echobase.action.save=Save echobase.action.saveSqlQuery=Update query echobase.action.show.embedded.documentation=How to use a portable database +echobase.action.show.exportCoser.documentation=How to export Coser data echobase.action.show.exportDb.documentation=How to export a database -echobase.action.show.exportMap.documentation=How to export voyage maps (Coser) echobase.action.show.import.documentation=How to import data echobase.action.show.importDb.documentation=How to import a database echobase.action.show.showSpatialData.documentation=How to display spatial data @@ -65,6 +65,7 @@ echobase.common.cellRegionAssociationFile= echobase.common.cellRegionResultFile= echobase.common.cellRegionsFile= +echobase.common.communityIndicator=Community indicators echobase.common.dataCentre=Data center echobase.common.dataCentreEmail=Data center email echobase.common.dataProcessing=DataProcessing @@ -82,6 +83,7 @@ echobase.common.esduBySpeciesAndAgeCategoryFile= echobase.common.esduBySpeciesAndSizeCategoryFile= echobase.common.exportDbMode=Mode +echobase.common.facade=Facade (Coser) echobase.common.gearMetadataFile= echobase.common.id=ID echobase.common.importDataMode=Import type @@ -129,12 +131,15 @@ echobase.common.pilotVersion=Jdbc pilot version echobase.common.pingDutyCycle=pingDutyCycle echobase.common.platform=Platform +echobase.common.populationIndicator=Population indicators echobase.common.principalInvestigator=Researcher echobase.common.principalInvestigatorEmail=Researcher e-mail echobase.common.processingDescription=Data processing description echobase.common.processingTemplate=Data processing template echobase.common.project=Project echobase.common.resultLabel=Results label +echobase.common.selectall=Select All +echobase.common.selectnone=Unselect All echobase.common.soundSpeedCalculationsER60=Sound speed calculations method (ER60 instrument) echobase.common.soundSpeedCalculationsME70=Sound speed calculation method (ME70 instrument) echobase.common.sounderConstant=Sounder constant (if relevant) @@ -156,6 +161,7 @@ echobase.common.voyage=Cruise echobase.common.voyageDescription=Description echobase.common.voyageFile= +echobase.common.zone=Zone (Coser) echobase.confirm.delete.query=Delete query echobase.confirm.delete.selected.importData=Delete selected imports echobase.confirm.delete.workingDbConfiguration=Delete working database configuration @@ -168,10 +174,11 @@ echobase.error.export.sqlQuery.forbidden.insert.word=La requète contient le mot 'INSERT', ce qui est interdit echobase.error.export.sqlQuery.forbidden.update.word=La requète contient le mot 'UPDATE', ce qui est interdit echobase.error.export.sqlQuery.requiredstring=La requète de l'export est obligatoire -echobase.error.exportMap.facadeName.required=Name of facade is mandatory -echobase.error.exportMap.filename.required=Export filename required -echobase.error.exportMap.mission.required=No mission selected -echobase.error.exportMap.zoneName.required=Name of zone is mandatory +echobase.error.exportCoser.communityIndicator.required=You must select at least one community indicator +echobase.error.exportCoser.facade.required=No facade selected +echobase.error.exportCoser.mission.required=No mission selected +echobase.error.exportCoser.populationIndicator.required=You must select at least one population indicator +echobase.error.exportCoser.zone.required=No zone selected echobase.error.import.acousticDensityUnit.required=acousticDensityUnit non renseigné echobase.error.import.acquisitionSoftwareVersionER60.required=acquisitionSoftwareVersionER60 non renseigné echobase.error.import.acquisitionSoftwareVersionME70.required=acquisitionSoftwareVersionME70 non renseigné @@ -221,10 +228,10 @@ echobase.error.mission.name.already.exist=The mission name already exists echobase.error.no.embeddedApplication.configurationFound=Portable database configuration not found echobase.error.no.embeddedApplication.exportFileFound=New portable database not found +echobase.error.no.exportCoser.configurationFound=Coser export configuration not found +echobase.error.no.exportCoser.exportFileFound=Coser archive not found echobase.error.no.exportDb.configurationFound=Database export configuration not found echobase.error.no.exportDb.exportFileFound=Database export archive not found -echobase.error.no.exportMap.configurationFound=Voyage maps export configuration not found -echobase.error.no.exportMap.exportFileFound=Voyage maps archive not found echobase.error.query.invalid.name=\=Query names must only contains alphanumeric characters echobase.error.query.name.already.exists=Query name already exists echobase.error.required.email=E-mail address required @@ -246,12 +253,11 @@ echobase.info.documentation=EchoBase online documentation echobase.info.downloadFiles=Download EchoBase or some import files echobase.info.echoR=EchoR project +echobase.info.exportCoser.failed=Coser export failed +echobase.info.exportCoser.succeded=Coser export successful echobase.info.exportDb.archive=Basename of the archive, extension <strong>.echobase</strong> will be added to it. echobase.info.exportDb.failed=Database export failed echobase.info.exportDb.succeded=Database export successful -echobase.info.exportMap.archive=Basename of the archive, extension <strong>.zip</strong> will be added to it. -echobase.info.exportMap.failed=Voyage maps export failed -echobase.info.exportMap.succeded=Voyage maps export successful echobase.info.import.failed=Import failed echobase.info.importData.failed=Data import failed echobase.info.importData.succeded=Data import sucessful @@ -299,10 +305,6 @@ echobase.label.exportAsSeen=Export as displayed on the screen echobase.label.exportDbFileName=Name of export file echobase.label.exportFileName=Name of export file -echobase.label.exportMap.facadeName=Facade -echobase.label.exportMap.publishRawData=Publish raw data -echobase.label.exportMap.zoneName=Zone -echobase.label.exportMapFileName=Name of export file echobase.label.importFile=File to export echobase.label.login=Connection echobase.label.numberOfCreatedEntities=No. of fields created @@ -324,9 +326,10 @@ echobase.legend.dbeditor.edit=Editing '%s' echobase.legend.dbeditor.show=Displaying '%s' echobase.legend.embeddedApplication.configuration=Portable database configuration +echobase.legend.exportCoser.configuration.files=Export configuration +echobase.legend.exportCoser.resume=Resume of Coser export echobase.legend.exportDb.configuration.files=Export configuration echobase.legend.exportDb.resume=Resume of database export -echobase.legend.exportMap.resume=Resume of voyage maps export echobase.legend.importData.configuration.selectImportType=Type of import selection echobase.legend.importData.configure=Import configuration echobase.legend.importData.createMission=Mission caracteristics @@ -347,8 +350,8 @@ echobase.menu.dashboard=Dashboard echobase.menu.editData=Modify data echobase.menu.export=Export data +echobase.menu.exportCoser=Coser export echobase.menu.exportDb=Database export -echobase.menu.exportMap=Voyage maps export echobase.menu.importData=Import data echobase.menu.importDb=Database import echobase.menu.logs=Change log @@ -359,8 +362,8 @@ echobase.message.clickToShowImportDefail=Click to show import detail echobase.message.createEmbedded.result=Portable application was successful in %s. echobase.message.download.link=If download did not start by itself, you can start it manually from this link\: +echobase.message.exportCoser.result=Coser Export was successful (file %s) in %s. echobase.message.exportDb.result=Export of database (mode %s) was successful (file %s) in %s. -echobase.message.exportMap.result=Export of voyage maps was successful (file %s) in %s. echobase.message.importData.result=Data import successful in %s \:\n%s echobase.message.no.row.selected=No data selected echobase.message.no.spatial.database.support=The working db you are using is not compatible with postgis 2. @@ -386,12 +389,12 @@ echobase.title.embeddedApplicationResult=Results of the portable database creation echobase.title.entityModificationLogs=Change log echobase.title.export=SQL export +echobase.title.exportCoser=Coser maps +echobase.title.exportCoserProgress=Coser export in progress +echobase.title.exportCoserResult=Coser export results echobase.title.exportDb=Export a complete database echobase.title.exportDbProgress=Export database in progress echobase.title.exportDbResult=Database export results -echobase.title.exportMap=Export voyage maps -echobase.title.exportMapProgress=Voyage maps export in progress -echobase.title.exportMapResult=Voyage maps export results echobase.title.exportTable=Export a table echobase.title.importData.selectImportType=Select type of import echobase.title.importDb=Database import 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 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2014-03-23 19:03:58 UTC (rev 989) @@ -1,87 +1,89 @@ -echobase.action.backToImportLogs=Retour à la liste des imports -echobase.action.backToUserList=Retour à la liste des utilisateurs +echobase.action.backToImportLogs=Retour \u00E0 la liste des imports +echobase.action.backToUserList=Retour \u00E0 la liste des utilisateurs echobase.action.cancel=Annuler echobase.action.clone=Cloner echobase.action.configureImport=Configurer l'import echobase.action.connectToWorkingDb=Se connecter -echobase.action.create=Créer -echobase.action.createEmbeddedApplication=Créer l'application -echobase.action.createMission=Créer la mission -echobase.action.createNewMission=Créer une nouvelle mission -echobase.action.createPostgresDb=Créer la base +echobase.action.create=Cr\u00E9er +echobase.action.createEmbeddedApplication=Cr\u00E9er l'application +echobase.action.createMission=Cr\u00E9er la mission +echobase.action.createNewMission=Cr\u00E9er une nouvelle mission +echobase.action.createPostgresDb=Cr\u00E9er la base echobase.action.createSqlQuery=Enregistrer echobase.action.createWorkingDbConfiguration=Enregistrer echobase.action.delete=Suppression -echobase.action.delete.selectedImport=Supprimer les imports sélectionnés +echobase.action.delete.selectedImport=Supprimer les imports s\u00E9lectionn\u00E9s echobase.action.deleteConfiguration=Supprimer -echobase.action.downloadEmbeddedApplicationFile=Télécharger l'application embarquée -echobase.action.downloadExportDbFile=Télécharger le fichier d'export de la base complète -echobase.action.downloadExportMapFile=Télécharger le fichier d'export des cartes d'une campagne +echobase.action.downloadEmbeddedApplicationFile=T\u00E9l\u00E9charger l'application embarqu\u00E9e +echobase.action.downloadExportCoserFile=T\u00E9l\u00E9charger le fichier d'export Coser +echobase.action.downloadExportDbFile=T\u00E9l\u00E9charger le fichier d'export de la base compl\u00E8te echobase.action.export=Exporter -echobase.action.exportSqlData=Exporter les données +echobase.action.exportSqlData=Exporter les donn\u00E9es echobase.action.exportTable=Exporter -echobase.action.generateSqlQuery=Générer la requête +echobase.action.generateSqlQuery=G\u00E9n\u00E9rer la requ\u00EAte echobase.action.import=Importer -echobase.action.importLibreOfficeQuery=Importer une requête Libre Office +echobase.action.importLibreOfficeQuery=Importer une requ\u00EAte Libre Office echobase.action.importTable=Importer echobase.action.login=Connexion -echobase.action.logout=Déconnexion -echobase.action.newQuery=Nouvelle requête +echobase.action.logout=D\u00E9connexion +echobase.action.newQuery=Nouvelle requ\u00EAte echobase.action.newWorkingDbContiguration=Nouvelle configuration de base de travail -echobase.action.reloadSpatialData=Recharger les données spatiales +echobase.action.reloadSpatialData=Recharger les donn\u00E9es spatiales echobase.action.reloadSqlQuery=Annuler les modifications echobase.action.reset=Annuler echobase.action.return=Retour echobase.action.save=Sauvegarder -echobase.action.saveSqlQuery=Mettre à jour -echobase.action.show.embedded.documentation=Comment utiliser une application embarquée +echobase.action.saveSqlQuery=Mettre \u00E0 jour +echobase.action.show.embedded.documentation=Comment utiliser une application embarqu\u00E9e +echobase.action.show.exportCoser.documentation=Comment exporter des donn\u00E9es vers Coser echobase.action.show.exportDb.documentation=Comment exporter une base -echobase.action.show.exportMap.documentation=Comment exporter les cartes d'une campagne (Coser) -echobase.action.show.import.documentation=Comment importer des données +echobase.action.show.import.documentation=Comment importer des donn\u00E9es echobase.action.show.importDb.documentation=Comment importer une base -echobase.action.show.showSpatialData.documentation=Comment visualiser des données spatiales -echobase.action.show.workingDb.documentation=Comment se connecter à une base de travail +echobase.action.show.showSpatialData.documentation=Comment visualiser des donn\u00E9es spatiales +echobase.action.show.workingDb.documentation=Comment se connecter \u00E0 une base de travail echobase.action.toEnglish=En anglais -echobase.action.toFrench=En français +echobase.action.toFrench=En fran\u00E7ais echobase.action.usingEnglish=Version anglaise -echobase.action.usingFrench=Version française +echobase.action.usingFrench=Version fran\u00E7aise echobase.action.workingDbconfiguration.addSpatial=Spatialiser la base -echobase.action.workingDbconfiguration.connect=Sélectionner une base de travail -echobase.action.workingDbconfiguration.disconnect=Se déconnecter -echobase.action.workingDbconfiguration.downloadDriver=Télécharger le pilote jdbc -echobase.common.acousticDensityUnit=Unité des densités acoustiques +echobase.action.workingDbconfiguration.connect=S\u00E9lectionner une base de travail +echobase.action.workingDbconfiguration.disconnect=Se d\u00E9connecter +echobase.action.workingDbconfiguration.downloadDriver=T\u00E9l\u00E9charger le pilote jdbc +echobase.common.acousticDensityUnit=Unit\u00E9 des densit\u00E9s acoustiques echobase.common.acquisitionSoftwareVersionER60=Version du logiciel d'acquisition ER60 echobase.common.acquisitionSoftwareVersionME70=Version du logiciel d'acquisition ME70 -echobase.common.actionError=Une erreur est survenue pendant l'opération \: -echobase.common.addDataAcquisition=Toujours créer de nouvelles entrées DataAcqusitions +echobase.common.actionError=Une erreur est survenue pendant l'op\u00E9ration \: +echobase.common.addDataAcquisition=Toujours cr\u00E9er de nouvelles entr\u00E9es DataAcqusitions echobase.common.admin=Administrateur -echobase.common.areaOfOperation=Zone d'activités +echobase.common.areaOfOperation=Zone d'activit\u00E9s echobase.common.author=Auteur echobase.common.authorEmail=Courriel de l'auteur echobase.common.biometrySampleFile= echobase.common.cellMapsFishFile=Fichier des cellules Cartes (Poisson) echobase.common.cellMapsOtherFile=Fichier des cellules Cartes (Autre) -echobase.common.cellPositionReference=Référentiel géographique des cellules des cartes +echobase.common.cellPositionReference=R\u00E9f\u00E9rentiel g\u00E9ographique des cellules des cartes echobase.common.cellRegionAssociationFile= echobase.common.cellRegionResultFile= echobase.common.cellRegionsFile= -echobase.common.dataCentre=Centre de données -echobase.common.dataCentreEmail=Courriel du centre de données +echobase.common.communityIndicator=indicateurs de communaut\u00E9 +echobase.common.dataCentre=Centre de donn\u00E9es +echobase.common.dataCentreEmail=Courriel du centre de donn\u00E9es echobase.common.dataProcessing=DataProcessing -echobase.common.dataProcessingNotes=Notes sur le pré-traitement des données -echobase.common.datum=Référenciel +echobase.common.dataProcessingNotes=Notes sur le pr\u00E9-traitement des donn\u00E9es +echobase.common.datum=R\u00E9f\u00E9renciel echobase.common.description=Description -echobase.common.digitThreshold=Seuil de numérisation -echobase.common.distributionStatement=Conditions de diffusion des données +echobase.common.digitThreshold=Seuil de num\u00E9risation +echobase.common.distributionStatement=Conditions de diffusion des donn\u00E9es echobase.common.echotypeFile= echobase.common.email=Courriel -echobase.common.entityId=Identifiant de l'entité -echobase.common.entityType=Type d'entité +echobase.common.entityId=Identifiant de l'entit\u00E9 +echobase.common.entityType=Type d'entit\u00E9 echobase.common.esduByEchotypeAndSpeciesCategoryFile= echobase.common.esduByEchotypeFile= echobase.common.esduBySpeciesAndAgeCategoryFile= echobase.common.esduBySpeciesAndSizeCategoryFile= echobase.common.exportDbMode=Mode +echobase.common.facade=Facade (Coser) echobase.common.gearMetadataFile= echobase.common.id=Identifiant echobase.common.importDataMode=Type d'import @@ -91,14 +93,14 @@ echobase.common.importError=Une erreur est survenue pendant l'import \: echobase.common.importLogToDelete=Campagne %s - Type d'import %s - Date %s echobase.common.importNotes=Remarques sur l'import -echobase.common.importResult=Résultat de l'import +echobase.common.importResult=R\u00E9sultat de l'import echobase.common.importText=Description echobase.common.importType=Type d'import echobase.common.importType.acoustic= echobase.common.importType.catches= -echobase.common.importType.common=Import des données de Voyage / Transit / Transect +echobase.common.importType.common=Import des donn\u00E9es de Voyage / Transit / Transect echobase.common.importType.operation= -echobase.common.importType.results=Import des résultats +echobase.common.importType.results=Import des r\u00E9sultats echobase.common.importUser=Utilisateur echobase.common.inProgress=En cours... echobase.common.institution=Institution @@ -107,15 +109,15 @@ echobase.common.jdbcPassword=Mot de passe echobase.common.jdbcUrl=URL de connexion echobase.common.keywords=Mots clefs -echobase.common.lastModifiedDate=Date de dernière modification -echobase.common.lastModifiedUser=Utilisateur de dernière modification +echobase.common.lastModifiedDate=Date de derni\u00E8re modification +echobase.common.lastModifiedUser=Utilisateur de derni\u00E8re modification echobase.common.lengthAgeKeyFile= echobase.common.lengthWeightKeyFile= -echobase.common.litteratureReferences=Références +echobase.common.litteratureReferences=R\u00E9f\u00E9rences echobase.common.loggedDataDatatype=loggedDataDatatype echobase.common.loggedDataFormat=loggedDataFormat echobase.common.mission=Mission -echobase.common.missionAbstract=Résumé de la mission +echobase.common.missionAbstract=R\u00E9sum\u00E9 de la mission echobase.common.modificationDate=Date de modification echobase.common.modificationText=Modification echobase.common.modificationUser=Utilisateur @@ -124,293 +126,295 @@ echobase.common.operationFile= echobase.common.operationMetadataFile= echobase.common.organisationLevelAcknowledgements=organisationLevelAcknowledgements -echobase.common.organisationReferences=Références de l'organisation +echobase.common.organisationReferences=R\u00E9f\u00E9rences de l'organisation echobase.common.password=Mot de passe echobase.common.pilotVersion=Version du pilote jdbc echobase.common.pingDutyCycle=pingDutyCycle echobase.common.platform=Plate-forme +echobase.common.populationIndicator=indicateurs de population echobase.common.principalInvestigator=Chercheur echobase.common.principalInvestigatorEmail=Courriel du chercheur -echobase.common.processingDescription=Description de la méthode de pré-traitement des données -echobase.common.processingTemplate=Intitulé de la méthode de pré-traitement des données +echobase.common.processingDescription=Description de la m\u00E9thode de pr\u00E9-traitement des donn\u00E9es +echobase.common.processingTemplate=Intitul\u00E9 de la m\u00E9thode de pr\u00E9-traitement des donn\u00E9es echobase.common.project=Projet -echobase.common.resultLabel=Intitulé des résultats -echobase.common.soundSpeedCalculationsER60=Méthode de calcul de la célérité du son (ER60) -echobase.common.soundSpeedCalculationsME70=Méthode de calcul de la célérité du son (ME70) +echobase.common.resultLabel=Intitul\u00E9 des r\u00E9sultats +echobase.common.selectall=Tout s\u00E9lectionner +echobase.common.selectnone=Tout d\u00E9s\u00E9lectionner +echobase.common.soundSpeedCalculationsER60=M\u00E9thode de calcul de la c\u00E9l\u00E9rit\u00E9 du son (ER60) +echobase.common.soundSpeedCalculationsME70=M\u00E9thode de calcul de la c\u00E9l\u00E9rit\u00E9 du son (ME70) echobase.common.sounderConstant=Constante sondeur (si besoin) echobase.common.source=Source -echobase.common.spatialAware=Base spatialisée ? -echobase.common.startEndDate=Date de début - fin -echobase.common.startEndPort=Port de départ - arrivé +echobase.common.spatialAware=Base spatialis\u00E9e ? +echobase.common.startEndDate=Date de d\u00E9but - fin +echobase.common.startEndPort=Port de d\u00E9part - arriv\u00E9 echobase.common.subSampleFile= echobase.common.totalSampleFile= -echobase.common.transceiverAcquisitionAbsorptionDescription=Méthode de calcul du coefficient d'absorption pour l'acquisition des données -echobase.common.transectBinUnitsPingAxis=Unité de la dimension horizontale des ESDU +echobase.common.transceiverAcquisitionAbsorptionDescription=M\u00E9thode de calcul du coefficient d'absorption pour l'acquisition des donn\u00E9es +echobase.common.transectBinUnitsPingAxis=Unit\u00E9 de la dimension horizontale des ESDU echobase.common.transectFile= echobase.common.transectGeospatialVerticalPositive=Direction de l'axe vertical des profondeurs (transect) -echobase.common.transectLicence=Licence pour la diffusion des données (transect) +echobase.common.transectLicence=Licence pour la diffusion des donn\u00E9es (transect) echobase.common.transitFile= -echobase.common.transitRelatedActivity=Travaux réalisés pendant le transit +echobase.common.transitRelatedActivity=Travaux r\u00E9alis\u00E9s pendant le transit echobase.common.user=Utilisateur echobase.common.vessel=Navire echobase.common.voyage=Campagne echobase.common.voyageDescription=Description echobase.common.voyageFile= -echobase.confirm.delete.query=Confirmer la suppression de la requête -echobase.confirm.delete.selected.importData=Confirmer la suppression des imports sélectionnés +echobase.common.zone=Zone (Coser) +echobase.confirm.delete.query=Confirmer la suppression de la requ\u00EAte +echobase.confirm.delete.selected.importData=Confirmer la suppression des imports s\u00E9lectionn\u00E9s echobase.confirm.delete.workingDbConfiguration=Confirmer la suppression de la configuration suivante -echobase.error.email.already.used=Nom d'utilisateur déjà utilisé +echobase.error.email.already.used=Nom d'utilisateur d\u00E9j\u00E0 utilis\u00E9 echobase.error.export.description.requiredstring=La description de l'export est obligatoire echobase.error.export.name.requiredstring=Le nom de l'export est obligatoire -echobase.error.export.sqlQuery.forbidden.alter.word=La requète contient le mot 'ALTER', ce qui est interdit -echobase.error.export.sqlQuery.forbidden.delete.word=La requète contient le mot 'DELETE', ce qui est interdit -echobase.error.export.sqlQuery.forbidden.drop.word=La requète contient le mot 'DROP', ce qui est interdit -echobase.error.export.sqlQuery.forbidden.insert.word=La requète contient le mot 'INSERT', ce qui est interdit -echobase.error.export.sqlQuery.forbidden.update.word=La requète contient le mot 'UPDATE', ce qui est interdit -echobase.error.export.sqlQuery.requiredstring=La requète de l'export est obligatoire -echobase.error.exportMap.facadeName.required=Le nom de la facade est obligatoire -echobase.error.exportMap.filename.required=Le nom d'un fichier d'export est obligatoire -echobase.error.exportMap.mission.required=La sélection d'une série est obligatoire -echobase.error.exportMap.zoneName.required=Le nom de la zone est obligatoire -echobase.error.import.acousticDensityUnit.required=acousticDensityUnit non renseigné -echobase.error.import.acquisitionSoftwareVersionER60.required=acquisitionSoftwareVersionER60 non renseigné -echobase.error.import.acquisitionSoftwareVersionME70.required=acquisitionSoftwareVersionME70 non renseigné -echobase.error.import.areaOfOperation.required=La sélection d'une zone d'opération est obligatoire -echobase.error.import.cellPositionReference.required=La sélection d'un cellPositionReference est obligatoire -echobase.error.import.dataProcessing.required=Data Processing non renseigné -echobase.error.import.datum.required=Datum de la campagne non rengeigné -echobase.error.import.gearMetadataFile.required=La sélection d'un fichier GearMetadata est obligatoire -echobase.error.import.loggedDataDatatype.required=loggedDataDatatype non renseigné -echobase.error.import.loggedDataFormat.required=loggedDataFormat non renseigné -echobase.error.import.mapsFile.required=La sélection d'un fichier Carte est obligatoire -echobase.error.import.mission.required=La sélection d'une mission est obligatoire -echobase.error.import.missionAbstract.required=Le résumé de la mission est obligatoire +echobase.error.export.sqlQuery.forbidden.alter.word=La requ\u00E8te contient le mot 'ALTER', ce qui est interdit +echobase.error.export.sqlQuery.forbidden.delete.word=La requ\u00E8te contient le mot 'DELETE', ce qui est interdit +echobase.error.export.sqlQuery.forbidden.drop.word=La requ\u00E8te contient le mot 'DROP', ce qui est interdit +echobase.error.export.sqlQuery.forbidden.insert.word=La requ\u00E8te contient le mot 'INSERT', ce qui est interdit +echobase.error.export.sqlQuery.forbidden.update.word=La requ\u00E8te contient le mot 'UPDATE', ce qui est interdit +echobase.error.export.sqlQuery.requiredstring=La requ\u00E8te de l'export est obligatoire +echobase.error.exportCoser.communityIndicator.required=Il faut s\u00E9lectionner au moins un indicateur de communaut\u00E9 +echobase.error.exportCoser.facade.required=La s\u00E9lection d'une facade est obligatoire +echobase.error.exportCoser.mission.required=La s\u00E9lection d'une s\u00E9rie est obligatoire +echobase.error.exportCoser.populationIndicator.required=Il faut s\u00E9lectionner au moins un indicateur de population +echobase.error.exportCoser.zone.required=La s\u00E9lection d'une zone est obligatoire +echobase.error.import.acousticDensityUnit.required=acousticDensityUnit non renseign\u00E9 +echobase.error.import.acquisitionSoftwareVersionER60.required=acquisitionSoftwareVersionER60 non renseign\u00E9 +echobase.error.import.acquisitionSoftwareVersionME70.required=acquisitionSoftwareVersionME70 non renseign\u00E9 +echobase.error.import.areaOfOperation.required=La s\u00E9lection d'une zone d'op\u00E9ration est obligatoire +echobase.error.import.cellPositionReference.required=La s\u00E9lection d'un cellPositionReference est obligatoire +echobase.error.import.dataProcessing.required=Data Processing non renseign\u00E9 +echobase.error.import.datum.required=Datum de la campagne non rengeign\u00E9 +echobase.error.import.gearMetadataFile.required=La s\u00E9lection d'un fichier GearMetadata est obligatoire +echobase.error.import.loggedDataDatatype.required=loggedDataDatatype non renseign\u00E9 +echobase.error.import.loggedDataFormat.required=loggedDataFormat non renseign\u00E9 +echobase.error.import.mapsFile.required=La s\u00E9lection d'un fichier Carte est obligatoire +echobase.error.import.mission.required=La s\u00E9lection d'une mission est obligatoire +echobase.error.import.missionAbstract.required=Le r\u00E9sum\u00E9 de la mission est obligatoire echobase.error.import.missionName.required=Le nom de la mission est obligatoire -echobase.error.import.moviesFile.required=La sélection d'un fichier Movies est obligatoire -echobase.error.import.notes.required=Note des DataProcessing non renseigné -echobase.error.import.oneImportFile.required=La sélection d'un fichier d'import est obligatoire -echobase.error.import.operationFile.required=La sélection d'un fichier Operation est obligatoire -echobase.error.import.operationMetadataFile.required=La sélection d'un fichier OperationMetadata est obligatoire -echobase.error.import.pingDutyCycle.required=pingDutyCycle non renseigné -echobase.error.import.processingDescription.required=processingDescription non renseigné -echobase.error.import.processingTemplate.required=processingTemplate non renseigné -echobase.error.import.regionAssociationFile.required=La sélection d'un fichier d'association de Région est obligatoire -echobase.error.import.regionResultFile.required=La sélection d'un fichier de résultats de Région est obligatoire -echobase.error.import.regionsFile.required=La sélection d'un fichier Region est obligatoire -echobase.error.import.resultImportFile.required=Veuillez sélectionner au moins un fichier à importer +echobase.error.import.moviesFile.required=La s\u00E9lection d'un fichier Movies est obligatoire +echobase.error.import.notes.required=Note des DataProcessing non renseign\u00E9 +echobase.error.import.oneImportFile.required=La s\u00E9lection d'un fichier d'import est obligatoire +echobase.error.import.operationFile.required=La s\u00E9lection d'un fichier Operation est obligatoire +echobase.error.import.operationMetadataFile.required=La s\u00E9lection d'un fichier OperationMetadata est obligatoire +echobase.error.import.pingDutyCycle.required=pingDutyCycle non renseign\u00E9 +echobase.error.import.processingDescription.required=processingDescription non renseign\u00E9 +echobase.error.import.processingTemplate.required=processingTemplate non renseign\u00E9 +echobase.error.import.regionAssociationFile.required=La s\u00E9lection d'un fichier d'association de R\u00E9gion est obligatoire +echobase.error.import.regionResultFile.required=La s\u00E9lection d'un fichier de r\u00E9sultats de R\u00E9gion est obligatoire +echobase.error.import.regionsFile.required=La s\u00E9lection d'un fichier Region est obligatoire +echobase.error.import.resultImportFile.required=Veuillez s\u00E9lectionner au moins un fichier \u00E0 importer echobase.error.import.resultLabel.required=Le champs ResultLabel est obligatoire -echobase.error.import.soundSpeedCalculationsER60.required=soundSpeedCalculationsER60 non renseigné -echobase.error.import.soundSpeedCalculationsME70.required=soundSpeedCalculationsME70 non renseigné -echobase.error.import.sounderConstant.required=sounderConstant non renseigné -echobase.error.import.transceiverAcquisitionAbsorptionDescription.required=transceiverAcquisitionAbsorptionDescription non renseigné -echobase.error.import.transectBinUnitsPingAxis.required=BinUnitsPingAxis des transtects non rengeigné -echobase.error.import.transectFile.required=La sélection d'un fichier Transect est obligatoire -echobase.error.import.transectGeospatialVerticalPositive.required=GeospatialVerticalPositive des transtects non rengeigné -echobase.error.import.transectLicence.required=Licence des transtects non rengeigné -echobase.error.import.transitFile.required=La sélection d'un fichier Transit est obligatoire -echobase.error.import.transitRelatedActivity.required=RelatedActivity des transits non rengeigné -echobase.error.import.vessel.required=La sélection d'un navire est obligatoire -echobase.error.import.voyage.required=La sélection d'une campagne est obligatoire -echobase.error.import.voyageDescription.required=Description de la campagne non rengeigné -echobase.error.import.voyageFile.required=La sélection d'un fichier Voyage est obligatoire +echobase.error.import.soundSpeedCalculationsER60.required=soundSpeedCalculationsER60 non renseign\u00E9 +echobase.error.import.soundSpeedCalculationsME70.required=soundSpeedCalculationsME70 non renseign\u00E9 +echobase.error.import.sounderConstant.required=sounderConstant non renseign\u00E9 +echobase.error.import.transceiverAcquisitionAbsorptionDescription.required=transceiverAcquisitionAbsorptionDescription non renseign\u00E9 +echobase.error.import.transectBinUnitsPingAxis.required=BinUnitsPingAxis des transtects non rengeign\u00E9 +echobase.error.import.transectFile.required=La s\u00E9lection d'un fichier Transect est obligatoire +echobase.error.import.transectGeospatialVerticalPositive.required=GeospatialVerticalPositive des transtects non rengeign\u00E9 +echobase.error.import.transectLicence.required=Licence des transtects non rengeign\u00E9 +echobase.error.import.transitFile.required=La s\u00E9lection d'un fichier Transit est obligatoire +echobase.error.import.transitRelatedActivity.required=RelatedActivity des transits non rengeign\u00E9 +echobase.error.import.vessel.required=La s\u00E9lection d'un navire est obligatoire +echobase.error.import.voyage.required=La s\u00E9lection d'une campagne est obligatoire +echobase.error.import.voyageDescription.required=Description de la campagne non rengeign\u00E9 +echobase.error.import.voyageFile.required=La s\u00E9lection d'un fichier Voyage est obligatoire echobase.error.importDb.input.extension.mismatch=Le fichier n'est pas un fichier .echobase echobase.error.importDb.input.required=Le fichier d'import est obligatoire echobase.error.importFile.required=Fichier d'import obligatoire -echobase.error.invalid.sql=Requête non valide \: %s -echobase.error.login.wrongLogin=Le login est déjà utilisé -echobase.error.mission.name.already.exist=Nom de mission déjà utilisé -echobase.error.no.embeddedApplication.configurationFound=Configuration de création d'application embarquée non trouvée -echobase.error.no.embeddedApplication.exportFileFound=Application embarquée générée non trouvée -echobase.error.no.exportDb.configurationFound=Configuration de l'export de la base non trouvée +echobase.error.invalid.sql=Requ\u00EAte non valide \: %s +echobase.error.login.wrongLogin=Le login est d\u00E9j\u00E0 utilis\u00E9 +echobase.error.mission.name.already.exist=Nom de mission d\u00E9j\u00E0 utilis\u00E9 +echobase.error.no.embeddedApplication.configurationFound=Configuration de cr\u00E9ation d'application embarqu\u00E9e non trouv\u00E9e +echobase.error.no.embeddedApplication.exportFileFound=Application embarqu\u00E9e g\u00E9n\u00E9r\u00E9e non trouv\u00E9e +echobase.error.no.exportCoser.configurationFound=Configuration de l'export Coser +echobase.error.no.exportCoser.exportFileFound=Archive d'export Coser introuvable +echobase.error.no.exportDb.configurationFound=Configuration de l'export de la base non trouv\u00E9e echobase.error.no.exportDb.exportFileFound=Archive d'export de la base introuvable -echobase.error.no.exportMap.configurationFound=Configuration de l'export des cartes d'une campagne -echobase.error.no.exportMap.exportFileFound=Archive d'export des cartes d'une campagne introuvable -echobase.error.query.invalid.name=Le nom de la requête doit être constitué uniquement de caractères alphanumériques -echobase.error.query.name.already.exists=Nom de requête déjà utilisé +echobase.error.query.invalid.name=Le nom de la requ\u00EAte doit \u00EAtre constitu\u00E9 uniquement de caract\u00E8res alphanum\u00E9riques +echobase.error.query.name.already.exists=Nom de requ\u00EAte d\u00E9j\u00E0 utilis\u00E9 echobase.error.required.email=Courriel obligatoire echobase.error.required.password=Le mot de passe est obligatoire -echobase.error.warlocation.notFound=L'application n'a pas été trouvée à l'emplacement suivant %s +echobase.error.warlocation.notFound=L'application n'a pas \u00E9t\u00E9 trouv\u00E9e \u00E0 l'emplacement suivant %s echobase.error.workingDbConfiguration.couldNotConnect=Impossible de se connecter (%s) -echobase.error.workingDbConfiguration.createOnlyOnPostgresql=La création d'une base n'est possible que pour le type *Postgresql* +echobase.error.workingDbConfiguration.createOnlyOnPostgresql=La cr\u00E9ation d'une base n'est possible que pour le type *Postgresql* echobase.error.workingDbConfiguration.description.required=Description obligatoire -echobase.error.workingDbConfiguration.url.already.exists=Une configuration existe déjà avec cette url +echobase.error.workingDbConfiguration.url.already.exists=Une configuration existe d\u00E9j\u00E0 avec cette url echobase.error.workingDbConfiguration.url.required=Url jdbc obligatoire -echobase.header.request.result=Résultat de la requête SQL -echobase.importDb.freeResult=L'import de type libre s'est déroulé avec succès en %s. -echobase.importDb.referentialResult=L'import de type référentiel s'est déroulé avec succès en %s. +echobase.header.request.result=R\u00E9sultat de la requ\u00EAte SQL +echobase.importDb.freeResult=L'import de type libre s'est d\u00E9roul\u00E9 avec succ\u00E8s en %s. +echobase.importDb.referentialResult=L'import de type r\u00E9f\u00E9rentiel s'est d\u00E9roul\u00E9 avec succ\u00E8s en %s. echobase.info.REchoBase=Scripts pour interroger EchoBase dans R -echobase.info.click.to.select=Vous pouvez sélectionner la valeur en un simple click puis la copier (Ctrl-C) -echobase.info.createEmbedded.failed=Création de l'application embarqué réussi -echobase.info.createEmbedded.succeded=Création de l'application embarqué a échoué -echobase.info.dbeditor.propertyDiffsResult=Résultat d'import de données +echobase.info.click.to.select=Vous pouvez s\u00E9lectionner la valeur en un simple click puis la copier (Ctrl-C) +echobase.info.createEmbedded.failed=Cr\u00E9ation de l'application embarqu\u00E9 r\u00E9ussi +echobase.info.createEmbedded.succeded=Cr\u00E9ation de l'application embarqu\u00E9 a \u00E9chou\u00E9 +echobase.info.dbeditor.propertyDiffsResult=R\u00E9sultat d'import de donn\u00E9es echobase.info.documentation=Documentation en ligne d'EchoBase -echobase.info.downloadFiles=Télécharger l'application ou des fichiers d'imports +echobase.info.downloadFiles=T\u00E9l\u00E9charger l'application ou des fichiers d'imports echobase.info.echoR=Projet EchoR -echobase.info.exportDb.archive=Il s'agit du nom de l'archive, l'extension <strong>.echobase</strong> sera automatiquement rajoutée. -echobase.info.exportDb.failed=L'export de la base de données a échoué -echobase.info.exportDb.succeded=L'export de la base de données a réussi -echobase.info.exportMap.archive=Il s'agit du nom de l'archive, l'extension <strong>.zip</strong> sera automatiquement rajoutée. -echobase.info.exportMap.failed=L'export des cartes d'une campagne a échoué -echobase.info.exportMap.succeded=L'export des cartes d'une campagne a réussi -echobase.info.import.failed=L'import a échoué -echobase.info.importData.failed=L'import des données a échoué -echobase.info.importData.succeded=L'import des données a réussi -echobase.info.importDb.failed=L'import de la base de données a échoué -echobase.info.importDb.succeded=L'import de la base de données a réussi +echobase.info.exportCoser.archive=Il s'agit du nom de l'archive, l'extension <strong>.zip</strong> sera automatiquement rajout\u00E9e. +echobase.info.exportCoser.failed=L'export Coser a \u00E9chou\u00E9 +echobase.info.exportCoser.succeded=L'export Coser a r\u00E9ussi +echobase.info.exportDb.archive=Il s'agit du nom de l'archive, l'extension <strong>.echobase</strong> sera automatiquement rajout\u00E9e. +echobase.info.exportDb.failed=L'export de la base de donn\u00E9es a \u00E9chou\u00E9 +echobase.info.exportDb.succeded=L'export de la base de donn\u00E9es a r\u00E9ussi +echobase.info.import.failed=L'import a \u00E9chou\u00E9 +echobase.info.importData.failed=L'import des donn\u00E9es a \u00E9chou\u00E9 +echobase.info.importData.succeded=L'import des donn\u00E9es a r\u00E9ussi +echobase.info.importDb.failed=L'import de la base de donn\u00E9es a \u00E9chou\u00E9 +echobase.info.importDb.succeded=L'import de la base de donn\u00E9es a r\u00E9ussi echobase.info.license=Licence AGPL V3 -echobase.info.new.sqlQuery.inprogress=Nouvelle requête en cours de création -echobase.info.new.workingDbConfiguration.inprogress=Nouvelle configuration de base de travail en cours de création -echobase.info.no.sqlQuery.saved=Aucune requête d'export SQL enregistrée -echobase.info.no.table.selected=Aucune table sélectionnée -echobase.info.no.voyagee.found=Aucune campagne à exporter -echobase.info.no.workingDb.selected=Aucune base de travail sélectionnée -echobase.info.no.workingDbConfiguration.saved=Aucune configuration de base de travail enregistrée -echobase.info.no.workingDbConfiguration.selected=Sélectionner une configuration pour ensuite vous y connecter -echobase.info.query.cloned=Requête dupliquée -echobase.info.query.created=Requête créée -echobase.info.query.removed=Requête supprimée -echobase.info.query.saved=Requête mise à jour -echobase.info.reload.spatialData=Pensez à recharger les données spatiales dans la page de visualisation des données spatiales\! -echobase.info.removeData.failed=La suppresion de l'import a échoué -echobase.info.removeData.succeded=La suppresion de l'import a réussi +echobase.info.new.sqlQuery.inprogress=Nouvelle requ\u00EAte en cours de cr\u00E9ation +echobase.info.new.workingDbConfiguration.inprogress=Nouvelle configuration de base de travail en cours de cr\u00E9ation +echobase.info.no.sqlQuery.saved=Aucune requ\u00EAte d'export SQL enregistr\u00E9e +echobase.info.no.table.selected=Aucune table s\u00E9lectionn\u00E9e +echobase.info.no.voyagee.found=Aucune campagne \u00E0 exporter +echobase.info.no.workingDb.selected=Aucune base de travail s\u00E9lectionn\u00E9e +echobase.info.no.workingDbConfiguration.saved=Aucune configuration de base de travail enregistr\u00E9e +echobase.info.no.workingDbConfiguration.selected=S\u00E9lectionner une configuration pour ensuite vous y connecter +echobase.info.query.cloned=Requ\u00EAte dupliqu\u00E9e +echobase.info.query.created=Requ\u00EAte cr\u00E9\u00E9e +echobase.info.query.removed=Requ\u00EAte supprim\u00E9e +echobase.info.query.saved=Requ\u00EAte mise \u00E0 jour +echobase.info.reload.spatialData=Pensez \u00E0 recharger les donn\u00E9es spatiales dans la page de visualisation des donn\u00E9es spatiales\! +echobase.info.removeData.failed=La suppresion de l'import a \u00E9chou\u00E9 +echobase.info.removeData.succeded=La suppresion de l'import a r\u00E9ussi echobase.info.reportBug=Rapport de bug -echobase.info.sqlQuery.not.modifiable=Vous ne disposez pas des droits nécessaires pour modifier la requête sélectionnée +echobase.info.sqlQuery.not.modifiable=Vous ne disposez pas des droits n\u00E9cessaires pour modifier la requ\u00EAte s\u00E9lectionn\u00E9e echobase.info.update.user.password=Pour ne pas modifier le mot de passe laisser ce champs vide. echobase.info.usefulLinks=Quelques liens utiles -echobase.info.user.create=L'utilisateur '%s' a été créé -echobase.info.user.delete=L'utilisateur '%s' a été supprimé -echobase.info.user.update=L'utilisateur '%s' a été mis à jour +echobase.info.user.create=L'utilisateur '%s' a \u00E9t\u00E9 cr\u00E9\u00E9 +echobase.info.user.delete=L'utilisateur '%s' a \u00E9t\u00E9 supprim\u00E9 +echobase.info.user.update=L'utilisateur '%s' a \u00E9t\u00E9 mis \u00E0 jour echobase.info.userSupport=Support utilisateur -echobase.info.workingDb.created=Nouvelle base de donnée %s créée -echobase.info.workingDbconfiguration.connected=Connexion à la base de travail '%s' réussie -echobase.info.workingDbconfiguration.created=Configuration à la base de travail '%s' créée -echobase.info.workingDbconfiguration.deleted=Configuration à la base de travail '%s' supprimée -echobase.info.workingDbconfiguration.disconnected=Déconnexion de la base de travail '%s' -echobase.info.workingDbconfiguration.spatialStructureAdded=La base a été spatialisée (ajout des tables echobase_cell_spatial et echobase_operation_spatial) -echobase.information.mission.created=La mission %s a été créée -echobase.information.one.file.required=Veuillez fournir au moins un fichiers à importer -echobase.label.admin.user.create=Création d'un utilisateur +echobase.info.workingDb.created=Nouvelle base de donn\u00E9e %s cr\u00E9\u00E9e +echobase.info.workingDbconfiguration.connected=Connexion \u00E0 la base de travail '%s' r\u00E9ussie +echobase.info.workingDbconfiguration.created=Configuration \u00E0 la base de travail '%s' cr\u00E9\u00E9e +echobase.info.workingDbconfiguration.deleted=Configuration \u00E0 la base de travail '%s' supprim\u00E9e +echobase.info.workingDbconfiguration.disconnected=D\u00E9connexion de la base de travail '%s' +echobase.info.workingDbconfiguration.spatialStructureAdded=La base a \u00E9t\u00E9 spatialis\u00E9e (ajout des tables echobase_cell_spatial et echobase_operation_spatial) +echobase.information.mission.created=La mission %s a \u00E9t\u00E9 cr\u00E9\u00E9e +echobase.information.one.file.required=Veuillez fournir au moins un fichiers \u00E0 importer +echobase.label.admin.user.create=Cr\u00E9ation d'un utilisateur echobase.label.admin.user.delete=Suppression d'un utilisateur -echobase.label.admin.user.edit=Mise à jour d'un utilisateur -echobase.label.createIfNotFound=Créer les entités non trouvées dans la base +echobase.label.admin.user.edit=Mise \u00E0 jour d'un utilisateur +echobase.label.createIfNotFound=Cr\u00E9er les entit\u00E9s non trouv\u00E9es dans la base echobase.label.driverType=Type de base -echobase.label.embeddedApplicationFileName=Nom de l'archive à télécharger -echobase.label.embeddedWarFileName=Nom du fichier compressé .war à utiliser -echobase.label.exportAsSeen=Exporter "comme à l'écran" +echobase.label.embeddedApplicationFileName=Nom de l'archive \u00E0 t\u00E9l\u00E9charger +echobase.label.embeddedWarFileName=Nom du fichier compress\u00E9 .war \u00E0 utiliser +echobase.label.exportAsSeen=Exporter "comme \u00E0 l'\u00E9cran" echobase.label.exportDbFileName=Nom du fichier d'export echobase.label.exportFileName=Nom du fichier d'export -echobase.label.exportMap.facadeName=Facade -echobase.label.exportMap.publishRawData=Publier les sources -echobase.label.exportMap.zoneName=Zone -echobase.label.exportMapFileName=Nom du fichier d'export -echobase.label.importFile=Fichier à importer +echobase.label.importFile=Fichier \u00E0 importer echobase.label.login=Connexion -echobase.label.numberOfCreatedEntities=Nombre de champs créés -echobase.label.numberOfUpdatedEntities=Nombre de champs mis à jour +echobase.label.numberOfCreatedEntities=Nombre de champs cr\u00E9\u00E9s +echobase.label.numberOfUpdatedEntities=Nombre de champs mis \u00E0 jour echobase.label.query.description=Description echobase.label.query.name=Nom echobase.label.query.sql=SQL -echobase.label.sqlQueries=Requêtes enregistrées +echobase.label.sqlQueries=Requ\u00EAtes enregistr\u00E9es echobase.label.user.login=Utilisateur \: %s -echobase.label.voyageToSelect=Voyage à exporter +echobase.label.voyageToSelect=Voyage \u00E0 exporter echobase.label.workingDbConfiguration.description=Description echobase.label.workingDbConfiguration.login=Login echobase.label.workingDbConfiguration.password=Mot de passe echobase.label.workingDbConfiguration.url=Url de connexion -echobase.label.workingDbConfigurations=Bases de travail enregistrées -echobase.label.workingDbSelected=Base de travail sélectionnée <strong>%s</strong> -echobase.legend.connectionToDb.detail=Informations détaillées de connexion à la base de données -echobase.legend.createEmbedded.resume=Résumé de la création d'une application embarquée +echobase.label.workingDbConfigurations=Bases de travail enregistr\u00E9es +echobase.label.workingDbSelected=Base de travail s\u00E9lectionn\u00E9e <strong>%s</strong> +echobase.legend.connectionToDb.detail=Informations d\u00E9taill\u00E9es de connexion \u00E0 la base de donn\u00E9es +echobase.legend.createEmbedded.resume=R\u00E9sum\u00E9 de la cr\u00E9ation d'une application embarqu\u00E9e echobase.legend.dbeditor.edit=Edition de '%s' echobase.legend.dbeditor.show=Visualisation de '%s' -echobase.legend.embeddedApplication.configuration=Configuration de l'application embarquée +echobase.legend.embeddedApplication.configuration=Configuration de l'application embarqu\u00E9e +echobase.legend.exportCoser.configuration.files=Configuration de l'export +echobase.legend.exportCoser.resume=R\u00E9sum\u00E9 de l'export Coser echobase.legend.exportDb.configuration.files=Configuration de l'export -echobase.legend.exportDb.resume=Résumé de l'export de base -echobase.legend.exportMap.resume=Résumé de l'export des cartes -echobase.legend.importData.configuration.selectImportType=Sélection du type d'import +echobase.legend.exportDb.resume=R\u00E9sum\u00E9 de l'export de base +echobase.legend.importData.configuration.selectImportType=S\u00E9lection du type d'import echobase.legend.importData.configure=Configurer l'import -echobase.legend.importData.createMission=Caractéristiques de la mission -echobase.legend.importData.result.resume=Résultats de l'import de données +echobase.legend.importData.createMission=Caract\u00E9ristiques de la mission +echobase.legend.importData.result.resume=R\u00E9sultats de l'import de donn\u00E9es echobase.legend.importDb.configuration=Configuration de l'import -echobase.legend.importDb.resume=Résumé de l'import de base de données -echobase.legend.libreOfficeQuery=Traduire une requête SQL issue de Libre Office -echobase.legend.removeData.resume=Résumé de la suppression d'un import +echobase.legend.importDb.resume=R\u00E9sum\u00E9 de l'import de base de donn\u00E9es +echobase.legend.libreOfficeQuery=Traduire une requ\u00EAte SQL issue de Libre Office +echobase.legend.removeData.resume=R\u00E9sum\u00E9 de la suppression d'un import echobase.legend.select.voyage=Filtre Campagne -echobase.legend.showData.configure=Configurer les données à visualiser -echobase.legend.showData.result=Résultats à visualiser -echobase.legend.sqlQuery.configuration=Définition de la requête -echobase.legend.sqlQuery.result=Résultats de la requête -echobase.legend.workingDbConfiguration.create=Création d'une configuration de base de travail -echobase.legend.workingDbConfiguration.use=Créer une base de travail -echobase.menu.connectToDbInformations=Informations de connexion à la base de données -echobase.menu.createEmbeddedApplication=Créer une application embarquée +echobase.legend.showData.configure=Configurer les donn\u00E9es \u00E0 visualiser +echobase.legend.showData.result=R\u00E9sultats \u00E0 visualiser +echobase.legend.sqlQuery.configuration=D\u00E9finition de la requ\u00EAte +echobase.legend.sqlQuery.result=R\u00E9sultats de la requ\u00EAte +echobase.legend.workingDbConfiguration.create=Cr\u00E9ation d'une configuration de base de travail +echobase.legend.workingDbConfiguration.use=Cr\u00E9er une base de travail +echobase.menu.connectToDbInformations=Informations de connexion \u00E0 la base de donn\u00E9es +echobase.menu.createEmbeddedApplication=Cr\u00E9er une application embarqu\u00E9e echobase.menu.dashboard=Tableau de bord -echobase.menu.editData=Modifier les données -echobase.menu.export=Exporter des données +echobase.menu.editData=Modifier les donn\u00E9es +echobase.menu.export=Exporter des donn\u00E9es +echobase.menu.exportCoser=Exporter vers Coser echobase.menu.exportDb=Exporter une base -echobase.menu.exportMap=Exporter les cartes -echobase.menu.importData=Importer des données +echobase.menu.importData=Importer des donn\u00E9es echobase.menu.importDb=Importer une base echobase.menu.logs=Journal des modifications -echobase.menu.removeData=Supprimer des données -echobase.menu.showSpatialData=Voir les données spatiales -echobase.menu.users=Gérer les utilisateurs -echobase.menu.viewData=Visualiser les données -echobase.message.clickToShowImportDefail=Cliquer pour obtenir les détails de l'import -echobase.message.createEmbedded.result=La création de l'application embarqué a réussi en %s -echobase.message.download.link=Si le téléchargement n'a pas démarré automatiquement, suivez ce lien \: -echobase.message.exportDb.result=L'export de la base (mode %s) a réussi (fichier %s) en %s -echobase.message.exportMap.result=L'export des cartes a réussi (fichier %s) en %s -echobase.message.importData.result=Import de données réussi en %s \:\n%s -echobase.message.no.row.selected=Aucune donnée sélectionnée -echobase.message.no.spatial.database.support=La base de travail que vous utilisez ne possède pas de support spatiale. -echobase.message.noEntrySelection=Pas de champ sélectionné -echobase.message.noImportLogSelected=Pas d'import sélectionné -echobase.message.noVoyageSelected=Pas de campagne sélectionné -echobase.message.removeData.result=La suppression de l'import s'est déroule avec succès en %s \:\n%s -echobase.message.warnEmbeddedApplicationInProgress=Merci de ne pas fermer la fenêtre pour pouvoir accéder aux résultats de la création de l'application embarquée -echobase.message.warnExportInProgress=Merci de ne pas fermer la fenêtre pour pouvoir accéder aux résultats de l'export -echobase.message.warnImportInProgress=Merci de ne pas fermer la fenêtre pour pouvoir accéder aux résultats de l'import -echobase.message.warnRemoveDataInProgress=Merci de ne pas fermer la fenètre pour pouvoir accéder aux résultats de la suppression de l'import -echobase.spatialView.loading=Chargement des données... -echobase.title.confirm.deleteImportLogs=Supprimer des données -echobase.title.confirm.deleteQuery=Supprimer une requête +echobase.menu.removeData=Supprimer des donn\u00E9es +echobase.menu.showSpatialData=Voir les donn\u00E9es spatiales +echobase.menu.users=G\u00E9rer les utilisateurs +echobase.menu.viewData=Visualiser les donn\u00E9es +echobase.message.clickToShowImportDefail=Cliquer pour obtenir les d\u00E9tails de l'import +echobase.message.createEmbedded.result=La cr\u00E9ation de l'application embarqu\u00E9 a r\u00E9ussi en %s +echobase.message.download.link=Si le t\u00E9l\u00E9chargement n'a pas d\u00E9marr\u00E9 automatiquement, suivez ce lien \: +echobase.message.exportCoser.result=L'export Coser a r\u00E9ussi (fichier %s) en %s +echobase.message.exportDb.result=L'export de la base (mode %s) a r\u00E9ussi (fichier %s) en %s +echobase.message.importData.result=Import de donn\u00E9es r\u00E9ussi en %s \:\n%s +echobase.message.no.row.selected=Aucune donn\u00E9e s\u00E9lectionn\u00E9e +echobase.message.no.spatial.database.support=La base de travail que vous utilisez ne poss\u00E8de pas de support spatiale. +echobase.message.noEntrySelection=Pas de champ s\u00E9lectionn\u00E9 +echobase.message.noImportLogSelected=Pas d'import s\u00E9lectionn\u00E9 +echobase.message.noVoyageSelected=Pas de campagne s\u00E9lectionn\u00E9 +echobase.message.removeData.result=La suppression de l'import s'est d\u00E9roule avec succ\u00E8s en %s \:\n%s +echobase.message.warnEmbeddedApplicationInProgress=Merci de ne pas fermer la fen\u00EAtre pour pouvoir acc\u00E9der aux r\u00E9sultats de la cr\u00E9ation de l'application embarqu\u00E9e +echobase.message.warnExportInProgress=Merci de ne pas fermer la fen\u00EAtre pour pouvoir acc\u00E9der aux r\u00E9sultats de l'export +echobase.message.warnImportInProgress=Merci de ne pas fermer la fen\u00EAtre pour pouvoir acc\u00E9der aux r\u00E9sultats de l'import +echobase.message.warnRemoveDataInProgress=Merci de ne pas fermer la fen\u00E8tre pour pouvoir acc\u00E9der aux r\u00E9sultats de la suppression de l'import +echobase.spatialView.loading=Chargement des donn\u00E9es... +echobase.title.confirm.deleteImportLogs=Supprimer des donn\u00E9es +echobase.title.confirm.deleteQuery=Supprimer une requ\u00EAte echobase.title.confirm.deleteWorkingDbConfiguration=Supprimer la configuration -echobase.title.connectToDbInformations=Informations de connexion à la base de données -echobase.title.createEmbeddedApplication=Création de l'application embarquée -echobase.title.createMission=Créer une mission +echobase.title.connectToDbInformations=Informations de connexion \u00E0 la base de donn\u00E9es +echobase.title.createEmbeddedApplication=Cr\u00E9ation de l'application embarqu\u00E9e +echobase.title.createMission=Cr\u00E9er une mission echobase.title.dashboard=Tableau de bord -echobase.title.dbEditor=Modification des données -echobase.title.dbEditor.read=Visualisation des données -echobase.title.embeddedApplicationProgress=Création de l'application embarquée en cours -echobase.title.embeddedApplicationResult=Résultat de la création de l'application embarquée +echobase.title.dbEditor=Modification des donn\u00E9es +echobase.title.dbEditor.read=Visualisation des donn\u00E9es +echobase.title.embeddedApplicationProgress=Cr\u00E9ation de l'application embarqu\u00E9e en cours +echobase.title.embeddedApplicationResult=R\u00E9sultat de la cr\u00E9ation de l'application embarqu\u00E9e echobase.title.entityModificationLogs=Journal des modifications echobase.title.export=Export SQL +echobase.title.exportCoser=Export Coser +echobase.title.exportCoserProgress=Export Coser en cours +echobase.title.exportCoserResult=R\u00E9sultats de l'export Coser echobase.title.exportDb=Export complet de la base -echobase.title.exportDbProgress=Export de la base de données en cours -echobase.title.exportDbResult=Résultats de l'export de la base de données -echobase.title.exportMap=Export des cartes -echobase.title.exportMapProgress=Export des cartes en cours -echobase.title.exportMapResult=Résultats de l'export des cartes +echobase.title.exportDbProgress=Export de la base de donn\u00E9es en cours +echobase.title.exportDbResult=R\u00E9sultats de l'export de la base de donn\u00E9es echobase.title.exportTable=Exporter une table -echobase.title.importData.selectImportType=Sélection du type d'import +echobase.title.importData.selectImportType=S\u00E9lection du type d'import echobase.title.importDb=Import d'une base -echobase.title.importDbProgress=Import de données en cours -echobase.title.importDbResult=Résultats de l'import de données -echobase.title.importLog.detail=Détail d'un import +echobase.title.importDbProgress=Import de donn\u00E9es en cours +echobase.title.importDbResult=R\u00E9sultats de l'import de donn\u00E9es +echobase.title.importLog.detail=D\u00E9tail d'un import echobase.title.importLogs=Liste des imports echobase.title.importTable=Importer une table echobase.title.login=Connexion -echobase.title.modification.detail=Détails de la modification -echobase.title.newLibreOfficeQuery=Traduire une requête SQL issue de Libre Office +echobase.title.modification.detail=D\u00E9tails de la modification +echobase.title.newLibreOfficeQuery=Traduire une requ\u00EAte SQL issue de Libre Office echobase.title.removeDataProgress=Suppression d'un import en cours... -echobase.title.removeDataResult=Résultat de la suppression d'un import -echobase.title.show.spatial=Visualisation des données +echobase.title.removeDataResult=R\u00E9sultat de la suppression d'un import +echobase.title.show.spatial=Visualisation des donn\u00E9es echobase.title.users=Administration des utilisateurs -echobase.title.voyage.detail=Détail de la campagne +echobase.title.voyage.detail=D\u00E9tail de la campagne echobase.title.welcome=Bienvenue dans EchoBase echobase.title.workingDbConfiguration=Administration des configurations de base de travail echobase.tooltip.disconnectWorkingDb=Changer de base de travail -echobase.tooltip.logout=Se déconnecter -echobase.tooltip.selectWorkingDb=Sélectionner une base de travail -echobase.warning.no.importLog.selected=Aucun import sélectionné +echobase.tooltip.logout=Se d\u00E9connecter +echobase.tooltip.selectWorkingDb=S\u00E9lectionner une base de travail +echobase.warning.no.importLog.selected=Aucun import s\u00E9lectionn\u00E9 Modified: trunk/echobase-ui/src/main/resources/struts.xml =================================================================== --- trunk/echobase-ui/src/main/resources/struts.xml 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-ui/src/main/resources/struts.xml 2014-03-23 19:03:58 UTC (rev 989) @@ -289,7 +289,7 @@ <include file="config/struts-importDb.xml"/> <include file="config/struts-exportDb.xml"/> - <include file="config/struts-exportMap.xml"/> + <include file="config/struts-exportCoser.xml"/> <include file="config/struts-removeData.xml"/> <include file="config/struts-spatial.xml"/> Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml 2014-03-23 19:03:58 UTC (rev 989) @@ -28,6 +28,7 @@ <pattern>/index*</pattern> <pattern>/dbeditor/getForeignEntities*</pattern> <pattern>/dbeditor/doExport*</pattern> + <pattern>/exportCoser/get*</pattern> <pattern>/exportQuery/exportQueryResult*</pattern> <pattern>/exportQuery/openNewLibreOfficeQuery*</pattern> <pattern>/exportQuery/newLibreOfficeQuery*</pattern> Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp 2014-03-23 19:03:58 UTC (rev 989) @@ -147,9 +147,9 @@ </s:a> </li> <li> - <s:a action="configureInput" namespace="/exportMap" cssClass="spatial"> + <s:a action="configureInput" namespace="/exportCoser" cssClass="spatial"> <span> - <s:text name="echobase.menu.exportMap"/> + <s:text name="echobase.menu.exportCoser"/> </span> </s:a> </li> Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportCoser/configure.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportMap/configure.jsp 2014-03-17 17:26:31 UTC (rev 985) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportCoser/configure.jsp 2014-03-23 19:03:58 UTC (rev 989) @@ -19,42 +19,106 @@ <%@page contentType="text/html" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> -<title><s:text name="echobase.title.exportMap"/></title> +<title><s:text name="echobase.title.exportCoser"/></title> +<s:url id="getZonesUrl" namespace="/exportCoser" action="getZones"/> + +<script type="text/javascript" + src="<s:url value='/js/gridHelper.js' />"></script> + <script type="text/javascript"> - jQuery(document).ready(function () { + // selection tous les elements d'un select + function coserSelectAll(select) { + $(select).children("option").prop('selected', true); + $(select).change(); + } + // deselection tous les elements d'un select + function coserUnSelectAll(select) { + $(select).children("option").prop('selected', false); + $(select).change(); + } + + $(document).ready(function () { + + $.autoSelectZones( + $('#facadeSelectBox'), + $('#zoneSelectBox'), + '<s:url action="getZones" namespace="/exportCoser"/>', + '<s:property value="model.facade"/>', + '<s:property value="model.zone"/>' + ); }); </script> - -<s:form namespace="/exportMap" method="POST"> +<s:form namespace="/exportCoser" method="POST"> <fieldset> <legend> - <s:text name="echobase.legend.exportDb.configuration.files"/> + <s:text name="echobase.legend.exportCoser.configuration.files"/> </legend> <div class="cleanBoth help"> - <s:a href="%{getDocumentation('exportMap.html', null)}" target="doc"> - <s:text name="echobase.action.show.exportMap.documentation"/> + <s:a href="%{getDocumentation(exportCoser, null)}" target="doc"> + <s:text name="echobase.action.show.exportCoser.documentation"/> </s:a> </div> <br/> - <s:select key="model.missionId" requiredLabel="true" + <s:select id='missionField' key="model.missionId" requiredLabel="true" label='%{getText("echobase.common.mission")}' list="missions" headerKey="" headerValue=""/> <div class="cleanBoth"></div> <br/> - <s:textfield key="model.facadeName" requiredLabel="true" size="100" - label="%{getText('echobase.label.exportMap.facadeName')}"/> + + <s:select id='facadeSelectBox' key="model.facade" requiredLabel="true" + label='%{getText("echobase.common.facade")}' + list="facades" headerKey="" headerValue=""/> + + <div class="cleanBoth"></div> <br/> - <s:textfield key="model.zoneName" requiredLabel="true" size="100" - label="%{getText('echobase.label.exportMap.zoneName')}"/> - <s:checkbox key="model.publishRawData" - label="%{getText('echobase.label.exportMap.publishRawData')}"/> + + <s:select id='zoneSelectBox' key="model.zone" requiredLabel="true" + label='%{getText("echobase.common.zone")}' + list="zones" headerKey="" headerValue=""/> + + <div class="cleanBoth"></div> <br/> + <s:select id='populationIndicator' key="model.populationIndicator" + label='%{getText("echobase.common.populationIndicator")}' + list="communityIndicators" multiple="true" size="10" + cssClass="ui-pg-input" requiredLabel="true"/> + <br/> + <span style="vertical-align:top"> + <img src="<s:url value='/images/stock_select_table.png' />" + onClick="coserSelectAll($('#populationIndicator'))" + title="<s:text name="echobase.common.selectall" />"/> + <br/> + <img src="<s:url value='/images/stock_select_clear.png' />" + onClick="coserUnSelectAll($('#populationIndicator'))" + title="<s:text name="echobase.common.selectnone" />"/> + </span> + + <div class="cleanBoth"></div> + <br/> + + <s:select id='communityIndicator' key="model.communityIndicator" + label='%{getText("echobase.common.communityIndicator")}' + list="communityIndicators" multiple="true" size="10" + cssClass="ui-pg-input" requiredLabel="true"/> + <br/> + <span style="vertical-align:top"> + <img src="<s:url value='/images/stock_select_table.png' />" + onClick="coserSelectAll($('#communityIndicator'))" + title="<s:text name="echobase.common.selectall" />"/> + <br/> + <img src="<s:url value='/images/stock_select_clear.png' />" + onClick="coserUnSelectAll($('#communityIndicator'))" + title="<s:text name="echobase.common.selectnone" />"/> + </span> + + <div class="cleanBoth"></div> + <br/> </fieldset> <br/> <s:submit action="configure" value='%{getText("echobase.action.export")}'/> Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportCoser/progress.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportMap/progress.jsp 2014-03-17 17:26:31 UTC (rev 985) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportCoser/progress.jsp 2014-03-23 19:03:58 UTC (rev 989) @@ -20,9 +20,9 @@ <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> -<meta http-equiv="refresh" content='10;url=<s:url action="export" namespace="/exportMap"/>'/> +<meta http-equiv="refresh" content='10;url=<s:url action="export" namespace="/exportCoser"/>'/> -<title><s:text name="echobase.title.exportMapProgress"/></title> +<title><s:text name="echobase.title.exportCoserProgress"/></title> <%-- TODO letellier 20111104 : Add warn icon --%> <p><s:text name="echobase.message.warnExportInProgress"/></p> Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportCoser/result.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportMap/result.jsp 2014-03-17 17:26:31 UTC (rev 985) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportCoser/result.jsp 2014-03-23 19:03:58 UTC (rev 989) @@ -19,7 +19,7 @@ <%@page contentType="text/html" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> -<s:url id="downloadUrl" namespace="/exportMap" action="download"/> +<s:url id="downloadUrl" namespace="/exportCoser" action="download"/> <s:if test="error == null"> <script type="text/javascript"> @@ -31,7 +31,7 @@ }); </script> </s:if> -<title><s:text name="echobase.title.exportMapResult"/></title> +<title><s:text name="echobase.title.exportCoserResult"/></title> <%@ include file="/WEB-INF/includes/actionResult.jsp" %> @@ -40,7 +40,7 @@ <div> Si le téléchargement n'a pas démarré automatiquement, suivez ce lien : <a href="${downloadUrl}" target="download" id="download"> - <s:text name="echobase.action.downloadExportMapFile"/> + <s:text name="echobase.action.downloadExportCoserFile"/> </a> </div> </s:if> Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/information.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/information.jsp 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/information.jsp 2014-03-23 19:03:58 UTC (rev 989) @@ -39,14 +39,14 @@ <br/> <fieldset> <legend><s:text name="echobase.legend.connectionToDb.detail"/></legend> - <s:textfield key="dbConfiguration.url" cssClass="notInput" readonly="true" + <s:textfield key="dbConfiguration.url" cssClass="autoSelect" readonly="true" label='%{getText("echobase.common.jdbcUrl")} (*)'/> - <s:textfield key="dbConfiguration.login" cssClass="notInput" readonly="true" + <s:textfield key="dbConfiguration.login" cssClass="autoSelect" readonly="true" label='%{getText("echobase.common.jdbcLogin")} (*)'/> - <s:textfield key="dbConfiguration.password" cssClass="notInput" readonly="true" + <s:textfield key="dbConfiguration.password" cssClass="autoSelect" readonly="true" label='%{getText("echobase.common.jdbcPassword")} (*)'/> <s:textfield key="dbConfiguration.driverType.driverClass.name" - cssClass="notInput" readonly="true" + cssClass="autoSelect" readonly="true" label='%{getText("echobase.common.jdbcDriver")} (*)'/> <s:label key="pilotVersion" label='%{getText("echobase.common.pilotVersion")}'/> Modified: trunk/echobase-ui/src/main/webapp/css/screen.css =================================================================== --- trunk/echobase-ui/src/main/webapp/css/screen.css 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-ui/src/main/webapp/css/screen.css 2014-03-23 19:03:58 UTC (rev 989) @@ -433,12 +433,11 @@ label{ font-size:140%; } -.notInput { - width:400px; - font-size:140%; +.autoSelect { + min-width:400px; } -input:not(.notInput), textarea, select{ +input, textarea, select{ border:3px solid #0063ab; border-radius:5px; /* -moz-border-radius:5px; */ @@ -447,7 +446,7 @@ margin-bottom: 10px; max-width: 500px; } -input[type="password"], input[type="text"]:not(.notInput), select{ +input[type="password"], input[type="text"]:not(.ui-pg-input), select:not(.ui-pg-input){ height:35px; } input[type="submit"]{ Added: trunk/echobase-ui/src/main/webapp/images/stock_select_clear.png =================================================================== (Binary files differ) Property changes on: trunk/echobase-ui/src/main/webapp/images/stock_select_clear.png ___________________________________________________________________ Added: svn:mime-type + image/png Added: trunk/echobase-ui/src/main/webapp/images/stock_select_table.png =================================================================== (Binary files differ) Property changes on: trunk/echobase-ui/src/main/webapp/images/stock_select_table.png ___________________________________________________________________ Added: svn:mime-type + image/png Modified: trunk/echobase-ui/src/main/webapp/js/gridHelper.js =================================================================== --- trunk/echobase-ui/src/main/webapp/js/gridHelper.js 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/echobase-ui/src/main/webapp/js/gridHelper.js 2014-03-23 19:03:58 UTC (rev 989) @@ -237,6 +237,36 @@ } ); } + }, + // auto-selection des zones + autoSelectZones: function (facadeSelectBox, zoneSelectBox, getUrl, facadeId, zoneId) { + + facadeSelectBox.change({zoneSelectBox: zoneSelectBox, + getUrl: getUrl}, function (event) { + + $.updateSelectBoxContent(event.data.getUrl, + {facade: this.value}, + 'zones', + event.data.zoneSelectBox + ); + }); + + if (facadeId) { + + facadeSelectBox.change(facadeId); + + $.updateSelectBoxContent(getUrl, + {facade: facadeId}, + 'zones', + zoneSelectBox, function () { + + if (zoneId) { + + zoneSelectBox.val(zoneId); + } + } + ); + } } }); @@ -281,6 +311,9 @@ }, autoSelectVoyageAndDataProcessing: function (voyageSelectBox, dataProcessingSelectBox, getUrl, voyageId, dataProcessingId) { return $(document).autoSelectVoyageAndDataProcessing(voyageSelectBox, dataProcessingSelectBox, getUrl, voyageId, dataProcessingId); + }, + autoSelectZones: function (facadeSelectBox, zoneSelectBox, getUrl, facadeId, zoneId) { + return $(document).autoSelectZones(facadeSelectBox, zoneSelectBox, getUrl, facadeId, zoneId); } }); })(jQuery); Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2014-03-21 17:30:46 UTC (rev 988) +++ trunk/pom.xml 2014-03-23 19:03:58 UTC (rev 989) @@ -201,37 +201,31 @@ <artifactId>nuiton-config</artifactId> <version>3.0-alpha-2</version> </dependency> - <dependency> <groupId>org.nuiton</groupId> <artifactId>nuiton-decorator</artifactId> <version>3.0-alpha-3</version> </dependency> - <dependency> <groupId>org.nuiton</groupId> <artifactId>nuiton-validator</artifactId> <version>3.0-rc-1</version> </dependency> - <dependency> <groupId>org.nuiton</groupId> <artifactId>nuiton-csv</artifactId> <version>3.0-alpha-3</version> </dependency> - <dependency> <groupId>org.nuiton.web</groupId> <artifactId>nuiton-struts2</artifactId> <version>1.16</version> </dependency> - <dependency> <groupId>org.nuiton.web</groupId> <artifactId>nuiton-web</artifactId> <version>1.16</version> </dependency> - <dependency> <groupId>org.nuiton.i18n</groupId> <artifactId>nuiton-i18n</artifactId> @@ -250,13 +244,11 @@ </exclusion> </exclusions> </dependency> - <dependency> <groupId>org.nuiton.topia</groupId> <artifactId>topia-service-migration</artifactId> <version>${topiaVersion}</version> </dependency> - <dependency> <groupId>org.nuiton.topia</groupId> <artifactId>topia-service-csv</artifactId> @@ -276,6 +268,12 @@ <version>1.1</version> </dependency> + <dependency> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + <version>2.2.4</version> + </dependency> + <!-- base postgres --> <dependency> <groupId>org.postgresql</groupId> Added: trunk/src/site/en/rst/exportCoser.rst =================================================================== --- trunk/src/site/en/rst/exportCoser.rst (rev 0) +++ trunk/src/site/en/rst/exportCoser.rst 2014-03-23 19:03:58 UTC (rev 989) @@ -0,0 +1,42 @@ +.. - +.. * #%L +.. * EchoBase +.. * %% +.. * Copyright (C) 2011 - 2014 Ifremer, Codelutin +.. * %% +.. * This program is free software: you can redistribute it and/or modify +.. * it under the terms of the GNU Affero General Public License as published by +.. * the Free Software Foundation, either version 3 of the License, or +.. * (at your option) any later version. +.. * +.. * This program is distributed in the hope that it will be useful, +.. * but WITHOUT ANY WARRANTY; without even the implied warranty of +.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. * GNU General Public License for more details. +.. * +.. * You should have received a copy of the GNU Affero General Public License +.. * along with this program. If not, see <http://www.gnu.org/licenses/>. +.. * #L% +.. - +================================ +Export to Indicator site (Coser) +================================ + +Abstract +======== + +*TODO Translation me.* + +Ce document explique comment exporter les données d'une mission vers le site des indicateurs. + +Création de l'archive Coser +--------------------------- + +Il faut dans un premier temps générer une archive compatible avec le client *Coser*. + +Publication sur le site des indicateurs +--------------------------------------- + +Fournir à un des administrateurs Coser l'archive générée, il devra alors +la décompresser dans le dossier des projets *EchoBase* du Coser puis de +publier le nouveau contenu sur le site des indicateurs depuis l'outil dédié. Added: trunk/src/site/rst/exportCoser.rst =================================================================== --- trunk/src/site/rst/exportCoser.rst (rev 0) +++ trunk/src/site/rst/exportCoser.rst 2014-03-23 19:03:58 UTC (rev 989) @@ -0,0 +1,40 @@ +.. - +.. * #%L +.. * EchoBase +.. * %% +.. * Copyright (C) 2011 - 2014 Ifremer, Codelutin +.. * %% +.. * This program is free software: you can redistribute it and/or modify +.. * it under the terms of the GNU Affero General Public License as published by +.. * the Free Software Foundation, either version 3 of the License, or +.. * (at your option) any later version. +.. * +.. * This program is distributed in the hope that it will be useful, +.. * but WITHOUT ANY WARRANTY; without even the implied warranty of +.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. * GNU General Public License for more details. +.. * +.. * You should have received a copy of the GNU Affero General Public License +.. * along with this program. If not, see <http://www.gnu.org/licenses/>. +.. * #L% +.. - +============================================ +Exporter sur le site des indicateurs (Coser) +============================================ + +Abstract +======== + +Ce document explique comment exporter les données d'une mission vers le site des indicateurs. + +Création de l'archive Coser +--------------------------- + +Il faut dans un premier temps générer une archive compatible avec le client *Coser*. + +Publication sur le site des indicateurs +--------------------------------------- + +Fournir à un des administrateurs Coser l'archive générée, il devra alors +la décompresser dans le dossier des projets *EchoBase* du Coser puis de +publier le nouveau contenu sur le site des indicateurs depuis l'outil dédié.
participants (1)
-
tchemit@users.forge.codelutin.com