Echobase-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- 1820 discussions
04 Sep '12
Author: tchemit
Date: 2012-09-04 08:14:33 +0200 (Tue, 04 Sep 2012)
New Revision: 609
Url: http://forge.codelutin.com/repositories/revision/echobase/609
Log:
- introduce topia migration service for both db
- prepare a embedded zip and war with no more usage of a jdk but just a jre
Added:
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/EchoBaseMigrationCallBackResolver.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/internalDb/
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/internalDb/MigrationCallBackForVersion.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/internalDb/MigrationCallback.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallBackForVersion.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallback.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallbackV1_1.java
trunk/echobase-domain/src/main/resources/META-INF/services/fr.ifremer.echobase.persistence.migration.internalDb.MigrationCallBackForVersion
trunk/echobase-domain/src/main/resources/META-INF/services/fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallBackForVersion
trunk/echobase-ui/src/main/assembly/
trunk/echobase-ui/src/main/assembly/bin.xml
trunk/echobase-ui/src/main/assembly/dist/
trunk/echobase-ui/src/main/assembly/dist/README.txt
trunk/echobase-ui/src/main/assembly/dist/echobase.properties
trunk/echobase-ui/src/main/assembly/dist/startEchobase.bat
trunk/echobase-ui/src/main/assembly/dist/startEchobase.sh
Modified:
trunk/echobase-domain/pom.xml
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBaseDbMeta.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBaseEntityHelper.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBasePersistenceHelper.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchobaseTopiaContexts.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/JdbcConfiguration.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceSupport.java
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/services/ServiceFactoryAware.java
trunk/echobase-domain/src/main/resources/echobase-internaldb.properties
trunk/echobase-domain/src/main/resources/echobase-workingdb.properties
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/src/main/java/fr/ifremer/echobase/services/embeddedapplication/EmbeddedApplicationService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/workingDb/WorkingDbConfigurationService.java
trunk/echobase-services/src/main/resources/embedded/echobase.properties
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/AbstractToolTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/TestHelper.java
trunk/echobase-ui/pom.xml
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/Connect.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.java
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/webapp/WEB-INF/jsp/workingDb/information.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/manage.jsp
trunk/pom.xml
Modified: trunk/echobase-domain/pom.xml
===================================================================
--- trunk/echobase-domain/pom.xml 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/pom.xml 2012-09-04 06:14:33 UTC (rev 609)
@@ -146,11 +146,6 @@
<artifactId>nuiton-csv</artifactId>
</dependency>
- <!--dependency>
- <groupId>fr.ird</groupId>
- <artifactId>msaccess-importer</artifactId>
- </dependency-->
-
<!-- comons dependencies -->
<dependency>
@@ -191,6 +186,11 @@
</dependency>
<dependency>
+ <groupId>org.nuiton.topia</groupId>
+ <artifactId>topia-service-migration</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -27,7 +27,6 @@
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.TopiaContextFactory;
import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.ArgumentsParserException;
import org.nuiton.util.FileUtil;
@@ -111,7 +110,7 @@
createDirectory(EchoBaseConfigurationOption.DATA_DIRECTORY);
try {
- FileUtils.forceMkdir(getWarDirectory());
+// FileUtils.forceMkdir(getWarDirectory());
FileUtils.forceMkdir(getLibDirectory());
} catch (IOException e) {
throw new EchoBaseTechnicalException(e);
@@ -153,12 +152,12 @@
return file;
}
- public File getWarDirectory() {
- File file = applicationConfig.getOptionAsFile(
- EchoBaseConfigurationOption.WAR_DIRECTORY.key);
- Preconditions.checkNotNull(file);
- return file;
- }
+// public File getWarDirectory() {
+// File file = applicationConfig.getOptionAsFile(
+// EchoBaseConfigurationOption.WAR_DIRECTORY.key);
+// Preconditions.checkNotNull(file);
+// return file;
+// }
public File getWarLocation() {
File file = applicationConfig.getOptionAsFile(
@@ -195,16 +194,10 @@
return v;
}
- public Class<?> getDriverClass() {
- Class<?> klass = applicationConfig.getOptionAsClass(
- TopiaContextFactory.CONFIG_DRIVER);
- Preconditions.checkNotNull(klass);
- return klass;
- }
-
public boolean isEmbedded() {
- Class<?> driverClass = getDriverClass();
- return driverClass.getName().toLowerCase().contains("h2");
+ Boolean result = applicationConfig.getOptionAsBoolean(
+ EchoBaseConfigurationOption.EMBEDDED.key);
+ return result != null && result;
}
public boolean getOptionAsBoolean(String propertyName) {
Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -61,12 +61,9 @@
CSV_SEPARATOR("echobase.csv.separator",
n_("echobase.config.csv.separator.description"),
";", char.class),
- WAR_DIRECTORY("echobase.war.directory",
- n_("echobase.config.war.directory.description"),
- "${echobase.data.directory}/war", File.class),
WAR_LOCATION("echobase.war.location",
n_("echobase.config.war.location.description"),
- "${echobase.war.directory}/echobase-ui-${echobase.version}.war",
+ "${echobase.data.directory}/war/echobase-ui-${echobase.version}-embedded.war",
File.class);
/** Configuration key. */
Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -54,7 +54,6 @@
import fr.ifremer.echobase.entities.references.Strata;
import fr.ifremer.echobase.entities.references.Vessel;
import fr.ifremer.echobase.entities.references.VesselType;
-import org.nuiton.topia.persistence.TopiaEntity;
import java.io.File;
import java.util.Map;
Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBaseDbMeta.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBaseDbMeta.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBaseDbMeta.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -32,8 +32,6 @@
import java.util.Arrays;
import java.util.List;
-import static org.nuiton.i18n.I18n.n_;
-
/**
* TODO
*
@@ -222,64 +220,4 @@
public EchoBasePersistenceHelper getPersistenceHelper() {
return (EchoBasePersistenceHelper) super.getPersistenceHelper();
}
-
- /**
- *
- * I18n definition (we need it for generic dbeditor, but we don't want
- * ToPIA to generate all keys for all property)
- * @since 1.1
- */
- static {
- n_("echobase.common.admin");
- n_("echobase.common.areaOfOperation");
- n_("echobase.common.author");
- n_("echobase.common.authorEmail");
- n_("echobase.common.calibration");
- n_("echobase.common.cell");
- n_("echobase.common.data");
- n_("echobase.common.dataAcquisition");
- n_("echobase.common.dataCentre");
- n_("echobase.common.dataCentreEmail");
- n_("echobase.common.dataProcessing");
- n_("echobase.common.dataQuality");
- n_("echobase.common.datum");
- n_("echobase.common.depthStratum");
- n_("echobase.common.description");
- n_("echobase.common.distributionStatement");
- n_("echobase.common.echoBaseUser");
- n_("echobase.common.email");
- n_("echobase.common.entityId");
- n_("echobase.common.entityModificationLog");
- n_("echobase.common.entityType");
- n_("echobase.common.exportQuery");
- n_("echobase.common.id");
- n_("echobase.common.institution");
- n_("echobase.common.keywords");
- n_("echobase.common.lastModifiedDate");
- n_("echobase.common.lastModifiedUser");
- n_("echobase.common.litteratureReferences");
- n_("echobase.common.metadata");
- n_("echobase.common.mission");
- n_("echobase.common.missionAbstract");
- n_("echobase.common.modificationDate");
- n_("echobase.common.modificationText");
- n_("echobase.common.modificationUser");
- n_("echobase.common.name");
- n_("echobase.common.organisationLevelAcknowledgements");
- n_("echobase.common.organisationReferences");
- n_("echobase.common.password");
- n_("echobase.common.platform");
- n_("echobase.common.principalInvestigator");
- n_("echobase.common.principalInvestigatorEmail");
- n_("echobase.common.project");
- n_("echobase.common.referenceDatum");
- n_("echobase.common.source");
- n_("echobase.common.species");
- n_("echobase.common.sqlQuery");
- n_("echobase.common.transect");
- n_("echobase.common.transit");
- n_("echobase.common.vessel");
- n_("echobase.common.voyage");
- n_("echobase.config.data.directory.description");
- }
}
Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBaseEntityHelper.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBaseEntityHelper.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBaseEntityHelper.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -23,6 +23,8 @@
* #L%
*/
+import fr.ifremer.echobase.entities.EchoBaseUserImpl;
+import fr.ifremer.echobase.entities.data.VoyageImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Transaction;
@@ -135,4 +137,36 @@
}
}
}
+
+ /**
+ * Tests if the internal database schema created.
+ *
+ * @param tx transaction
+ * @return {@code true} if the schema is already created, {@code false}
+ * otherwise
+ * @throws TopiaException if something was wrong while requesting database
+ */
+ public static boolean isInternalSchemaCreated(TopiaContext tx) throws TopiaException {
+
+ boolean schemaFound =
+ ((TopiaContextImplementor) tx).isSchemaExist(EchoBaseUserImpl.class);
+
+ return schemaFound;
+ }
+
+ /**
+ * Tests if the working database schema created.
+ *
+ * @param tx transaction
+ * @return {@code true} if the schema is already created, {@code false}
+ * otherwise
+ * @throws TopiaException if something was wrong while requesting database
+ */
+ public static boolean isWorkingDbSchemaCreated(TopiaContext tx) throws TopiaException {
+
+ boolean schemaFound =
+ ((TopiaContextImplementor) tx).isSchemaExist(VoyageImpl.class);
+
+ return schemaFound;
+ }
}
Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBasePersistenceHelper.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBasePersistenceHelper.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchoBasePersistenceHelper.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -25,19 +25,18 @@
import fr.ifremer.echobase.entities.EchoBaseDAOHelper;
import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
-import fr.ifremer.echobase.entities.EchoBaseUserImpl;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaRuntimeException;
-import org.nuiton.topia.framework.TopiaContextImplementor;
import org.nuiton.topia.persistence.TopiaDAO;
import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.topia.persistence.TopiaPersistenceHelper;
/**
- * TODO
+ * Persistence helper for working db.
*
* @author tchemit <chemit(a)codelutin.com>
+ * @see TopiaPersistenceHelper
* @since 1.1
*/
public class EchoBasePersistenceHelper implements TopiaPersistenceHelper<EchoBaseEntityEnum> {
@@ -61,19 +60,4 @@
return (TopiaDAO<E>) getDAO(tx, type.getContract());
}
- /**
- * Tests if the internal database schema created.
- *
- * @param tx transaction
- * @return {@code true} if the schema is already created, {@code false}
- * otherwise
- * @throws TopiaException if something was wrong while requesting database
- */
- public boolean isInternalSchemaCreated(TopiaContext tx) throws TopiaException {
-
- boolean schemaFound =
- ((TopiaContextImplementor) tx).isSchemaExist(EchoBaseUserImpl.class);
-
- return schemaFound;
- }
}
Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchobaseTopiaContexts.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchobaseTopiaContexts.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/EchobaseTopiaContexts.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -25,6 +25,7 @@
import com.google.common.base.Charsets;
import fr.ifremer.echobase.EchoBaseConfigurationOption;
+import fr.ifremer.echobase.EchoBaseTechnicalException;
import fr.ifremer.echobase.entities.DriverType;
import fr.ifremer.echobase.entities.EchoBaseDAOHelper;
import fr.ifremer.echobase.entities.EchoBaseInternalDAOHelper;
@@ -32,9 +33,9 @@
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaContextFactory;
+import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaNotFoundException;
import org.nuiton.topia.TopiaRuntimeException;
-import org.nuiton.topia.framework.TopiaContextImplementor;
import org.nuiton.util.RecursiveProperties;
import java.io.File;
@@ -111,8 +112,22 @@
*/
public static TopiaContext newWorkingDb(JdbcConfiguration jdbcConfiguration) {
- Properties result = loadWorkingDbConfiguration(jdbcConfiguration);
- return newDb(result);
+ Properties properties = loadWorkingDbConfiguration(jdbcConfiguration);
+ TopiaContext result = newDb(properties);
+
+ try {
+ if (!EchoBaseEntityHelper.isWorkingDbSchemaCreated(result)) {
+
+ if (log.isInfoEnabled()) {
+ log.info("Will create schema for " +
+ jdbcConfiguration.getUrl());
+ }
+ result.createSchema();
+ }
+ } catch (TopiaException e) {
+ throw new EchoBaseTechnicalException("Could not create db schema", e);
+ }
+ return result;
}
/**
@@ -166,20 +181,18 @@
configuration.get(TopiaContextFactory.CONFIG_URL));
}
TopiaContext result = TopiaContextFactory.getContext(configuration);
+
return result;
} catch (TopiaNotFoundException e) {
throw new TopiaRuntimeException("Could not init db", e);
}
}
- public static void reloadProperty(Properties properties, String propertyName, String propertyNameToRemove) {
+ public static void reloadProperty(Properties properties,
+ String propertyName,
+ String propertyNameToRemove) {
Object o = properties.getProperty(propertyName);
properties.put(propertyName, o);
properties.remove(propertyNameToRemove);
}
-
- public static String getDbUrl(TopiaContext rootContext) {
- String result = (String) ((TopiaContextImplementor) rootContext).getConfig().get(TopiaContextFactory.CONFIG_URL);
- return result;
- }
}
Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/JdbcConfiguration.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/JdbcConfiguration.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/JdbcConfiguration.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -29,15 +29,15 @@
public class JdbcConfiguration implements Serializable {
- public static JdbcConfiguration newConfig(String url,
+ public static JdbcConfiguration newConfig(DriverType driverType,
+ String url,
String login,
- String password,
- DriverType driverType) {
+ String password) {
JdbcConfiguration result = new JdbcConfiguration();
+ result.setDriverType(driverType);
result.setUrl(url);
result.setLogin(login);
result.setPassword(password);
- result.setDriverType(driverType);
return result;
}
@@ -48,7 +48,7 @@
String databaseAbsolutePath = databaseFile.getAbsolutePath();
String url = "jdbc:h2:file:" + databaseAbsolutePath +
"/echobase;LOG=0;CACHE_SIZE=65536;LOCK_MODE=0;UNDO_LOG=0";
- JdbcConfiguration result = newConfig(url, "sa", "sa", DriverType.H2);
+ JdbcConfiguration result = newConfig(DriverType.H2, url, "sa", "sa");
return result;
}
Added: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/EchoBaseMigrationCallBackResolver.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/EchoBaseMigrationCallBackResolver.java (rev 0)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/EchoBaseMigrationCallBackResolver.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -0,0 +1,79 @@
+package fr.ifremer.echobase.persistence.migration;
+
+/*
+ * #%L
+ * EchoBase :: Domain
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.google.common.collect.Maps;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
+import org.nuiton.util.Version;
+import org.nuiton.util.VersionUtil;
+
+import java.util.Map;
+import java.util.ServiceLoader;
+import java.util.Set;
+
+/**
+ * Migration callBack resolver using service loader to discover version to
+ * apply and using also a generic migration call back.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class EchoBaseMigrationCallBackResolver<C extends TopiaMigrationCallbackByClassNG.MigrationCallBackForVersion> implements TopiaMigrationCallbackByClassNG.MigrationCallBackForVersionResolver {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(EchoBaseMigrationCallBackResolver.class);
+
+ public static <C extends TopiaMigrationCallbackByClassNG.MigrationCallBackForVersion> EchoBaseMigrationCallBackResolver<C> newResolver(Class<C> resolverType) {
+ return new EchoBaseMigrationCallBackResolver<C>(resolverType);
+ }
+
+ protected final Map<Version, C> versionMigrationMapping;
+
+ protected EchoBaseMigrationCallBackResolver(Class<C> migrationType) {
+ this.versionMigrationMapping = Maps.newTreeMap(
+ new VersionUtil.VersionComparator());
+ for (C callBackForVersion : ServiceLoader.load(migrationType)) {
+ Version version = callBackForVersion.getVersion();
+ if (log.isInfoEnabled()) {
+ log.info("Detects migration version " + version + " [" +
+ callBackForVersion + "]");
+ }
+ versionMigrationMapping.put(version, callBackForVersion);
+ }
+ }
+
+ @Override
+ public C getCallBack(Version version) {
+ return versionMigrationMapping.get(version);
+ }
+
+ @Override
+ public Set<Version> getAllVersions() {
+ return versionMigrationMapping.keySet();
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/EchoBaseMigrationCallBackResolver.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/internalDb/MigrationCallBackForVersion.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/internalDb/MigrationCallBackForVersion.java (rev 0)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/internalDb/MigrationCallBackForVersion.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -0,0 +1,44 @@
+package fr.ifremer.echobase.persistence.migration.internalDb;
+
+/*
+ * #%L
+ * EchoBase :: Domain
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import org.hibernate.dialect.Dialect;
+import org.nuiton.topia.TopiaNotFoundException;
+import org.nuiton.topia.framework.TopiaContextImplementor;
+import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
+
+/**
+ * Base migration support for a internal db.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public abstract class MigrationCallBackForVersion extends TopiaMigrationCallbackByClassNG.MigrationCallBackForVersion {
+
+ protected Dialect getDialect(TopiaContextImplementor tx) throws TopiaNotFoundException {
+ Dialect dialect =
+ Dialect.getDialect(tx.getHibernateConfiguration().getProperties());
+ return dialect;
+ }
+}
Property changes on: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/internalDb/MigrationCallBackForVersion.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/internalDb/MigrationCallback.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/internalDb/MigrationCallback.java (rev 0)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/internalDb/MigrationCallback.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -0,0 +1,56 @@
+package fr.ifremer.echobase.persistence.migration.internalDb;
+
+/*
+ * #%L
+ * EchoBase :: Domain
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import fr.ifremer.echobase.entities.EchoBaseInternalDAOHelper;
+import fr.ifremer.echobase.persistence.migration.EchoBaseMigrationCallBackResolver;
+import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
+import org.nuiton.util.Version;
+import org.nuiton.util.VersionUtil;
+
+import java.util.List;
+
+/**
+ * EchoBase Migration callback for internal db.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class MigrationCallback extends TopiaMigrationCallbackByClassNG {
+
+ public MigrationCallback() {
+ super(EchoBaseMigrationCallBackResolver.newResolver(
+ fr.ifremer.echobase.persistence.migration.internalDb.MigrationCallBackForVersion.class));
+ }
+
+ @Override
+ public Version getApplicationVersion() {
+ return VersionUtil.valueOf(EchoBaseInternalDAOHelper.getModelVersion());
+ }
+
+ @Override
+ public boolean askUser(Version version, List<Version> versions) {
+ return true;
+ }
+}
Property changes on: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/internalDb/MigrationCallback.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallBackForVersion.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallBackForVersion.java (rev 0)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallBackForVersion.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -0,0 +1,44 @@
+package fr.ifremer.echobase.persistence.migration.workingDb;
+
+/*
+ * #%L
+ * EchoBase :: Domain
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import org.hibernate.dialect.Dialect;
+import org.nuiton.topia.TopiaNotFoundException;
+import org.nuiton.topia.framework.TopiaContextImplementor;
+import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
+
+/**
+ * Base migration support for a working db.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public abstract class MigrationCallBackForVersion extends TopiaMigrationCallbackByClassNG.MigrationCallBackForVersion {
+
+ protected Dialect getDialect(TopiaContextImplementor tx) throws TopiaNotFoundException {
+ Dialect dialect =
+ Dialect.getDialect(tx.getHibernateConfiguration().getProperties());
+ return dialect;
+ }
+}
Property changes on: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallBackForVersion.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallback.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallback.java (rev 0)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallback.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -0,0 +1,56 @@
+package fr.ifremer.echobase.persistence.migration.workingDb;
+
+/*
+ * #%L
+ * EchoBase :: Domain
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import fr.ifremer.echobase.entities.EchoBaseDAOHelper;
+import fr.ifremer.echobase.persistence.migration.EchoBaseMigrationCallBackResolver;
+import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
+import org.nuiton.util.Version;
+import org.nuiton.util.VersionUtil;
+
+import java.util.List;
+
+/**
+ * EchoBase Migration callback for working db.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.3
+ */
+public class MigrationCallback extends TopiaMigrationCallbackByClassNG {
+
+ public MigrationCallback() {
+ super(EchoBaseMigrationCallBackResolver.newResolver(
+ fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallBackForVersion.class));
+ }
+
+ @Override
+ public Version getApplicationVersion() {
+ return VersionUtil.valueOf(EchoBaseDAOHelper.getModelVersion());
+ }
+
+ @Override
+ public boolean askUser(Version version, List<Version> versions) {
+ return true;
+ }
+}
Property changes on: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallback.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallbackV1_1.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallbackV1_1.java (rev 0)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallbackV1_1.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -0,0 +1,61 @@
+package fr.ifremer.echobase.persistence.migration.workingDb;
+
+/*
+ * #%L
+ * EchoBase :: Domain
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.framework.TopiaContextImplementor;
+import org.nuiton.util.Version;
+import org.nuiton.util.VersionUtil;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Migration for version {@code 1.1}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class MigrationCallbackV1_1 extends MigrationCallBackForVersion {
+
+ @Override
+ public Version getVersion() {
+ return VersionUtil.valueOf("1.1");
+ }
+
+ @Override
+ protected void prepareMigrationScript(TopiaContextImplementor tx,
+ List<String> queries,
+ boolean showSql,
+ boolean showProgression) throws TopiaException {
+
+ String[] sqls = new String[]{
+ "DROP TABLE echobaseuser;",
+ "DROP TABLE exportquery;"
+ };
+
+ queries.addAll(Arrays.asList(sqls));
+
+ }
+}
Property changes on: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallbackV1_1.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceSupport.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceSupport.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceSupport.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -26,9 +26,9 @@
import fr.ifremer.echobase.EchoBaseConfiguration;
import fr.ifremer.echobase.EchoBaseTechnicalException;
import fr.ifremer.echobase.entities.EchoBaseDAOHelper;
-import fr.ifremer.echobase.persistence.EchoBaseDbMeta;
import fr.ifremer.echobase.entities.EchoBaseInternalDAOHelper;
import fr.ifremer.echobase.entities.EchobaseInternalEntity;
+import fr.ifremer.echobase.persistence.EchoBaseDbMeta;
import org.apache.commons.lang3.StringUtils;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/services/ServiceFactoryAware.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/services/ServiceFactoryAware.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/services/ServiceFactoryAware.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -29,7 +29,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.1
*/
-public interface ServiceFactoryAware {
+public interface ServiceFactoryAware {
<S extends EchoBaseService> S getService(Class<S> serviceClass);
Property changes on: trunk/echobase-domain/src/main/resources/META-INF/services/fr.ifremer.echobase.persistence.migration.internalDb.MigrationCallBackForVersion
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-domain/src/main/resources/META-INF/services/fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallBackForVersion
===================================================================
--- trunk/echobase-domain/src/main/resources/META-INF/services/fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallBackForVersion (rev 0)
+++ trunk/echobase-domain/src/main/resources/META-INF/services/fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallBackForVersion 2012-09-04 06:14:33 UTC (rev 609)
@@ -0,0 +1 @@
+fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallbackV1_1
\ No newline at end of file
Property changes on: trunk/echobase-domain/src/main/resources/META-INF/services/fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallBackForVersion
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-domain/src/main/resources/echobase-internaldb.properties
===================================================================
--- trunk/echobase-domain/src/main/resources/echobase-internaldb.properties 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/resources/echobase-internaldb.properties 2012-09-04 06:14:33 UTC (rev 609)
@@ -20,9 +20,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# #L%
###
-hibernate.hbm2ddl.auto=update
-hibernate.show_sql=false
+# Database basic configuration
hibernate.dialect=org.hibernate.dialect.H2Dialect
hibernate.connection.provider_class=org.nuiton.topia.framework.TopiaConnectionProvider
hibernate.connection.username=sa
@@ -30,3 +29,16 @@
hibernate.connection.driver_class=org.h2.Driver
hibernate.connection.url=jdbc:h2:file:${echobase.internal.db.directory}/echobase-user
+# Never create/update schema (will do it by logic)
+hibernate.hbm2ddl.auto=none
+
+# To custom sql in logger
+hibernate.show_sql=false
+hibernate.format_sql=false
+hibernate.use_sql_comments=false
+
+# Database migration configuration
+topia.service.migration=org.nuiton.topia.migration.TopiaMigrationEngine
+topia.service.migration.callback=fr.ifremer.echobase.persistence.migration.internalDb.MigrationCallback
+topia.service.migration.showSql=true
+
Modified: trunk/echobase-domain/src/main/resources/echobase-workingdb.properties
===================================================================
--- trunk/echobase-domain/src/main/resources/echobase-workingdb.properties 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/resources/echobase-workingdb.properties 2012-09-04 06:14:33 UTC (rev 609)
@@ -20,11 +20,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# #L%
###
-# DB configuration
-hibernate.show_sql=false
-hibernate.format_sql=false
-hibernate.use_sql_comments=false
-hibernate.hbm2ddl.auto=none
+
+# Database basic configuration
hibernate.connection.username=${configuration.login}
hibernate.connection.password=${configuration.password}
hibernate.connection.url=${configuration.url}
@@ -32,8 +29,16 @@
hibernate.dialect=${configuration.dialect}
hibernate.connection.provider_class=org.nuiton.topia.framework.TopiaConnectionProvider
-# Migration configuration
-#topia.service.migration=org.nuiton.topia.migration.TopiaMigrationEngine
-#topia.service.migration.callback=fr.ird.t3.services.migration.T3MigrationCallback
-#topia.service.migration.showSql=true
+# Never create/update schema (will do it by logic)
+hibernate.hbm2ddl.auto=none
+# To custom sql in logger
+hibernate.show_sql=false
+hibernate.format_sql=false
+hibernate.use_sql_comments=false
+
+# Database migration configuration
+topia.service.migration=org.nuiton.topia.migration.TopiaMigrationEngine
+topia.service.migration.callback=fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallback
+topia.service.migration.showSql=true
+
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 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/resources/i18n/echobase-domain_en_GB.properties 2012-09-04 06:14:33 UTC (rev 609)
@@ -1,55 +1,5 @@
-echobase.common.admin=
-echobase.common.areaOfOperation=
-echobase.common.author=
-echobase.common.authorEmail=
-echobase.common.calibration=
-echobase.common.cell=
-echobase.common.data=
-echobase.common.dataAcquisition=
-echobase.common.dataCentre=
-echobase.common.dataCentreEmail=
-echobase.common.dataProcessing=
-echobase.common.dataQuality=
-echobase.common.datum=
-echobase.common.depthStratum=
-echobase.common.description=
-echobase.common.distributionStatement=
echobase.common.driverType.h2=
echobase.common.driverType.postgres=
-echobase.common.echoBaseUser=
-echobase.common.email=
-echobase.common.entityId=
-echobase.common.entityModificationLog=
-echobase.common.entityType=
-echobase.common.exportQuery=
-echobase.common.id=
-echobase.common.institution=
-echobase.common.keywords=
-echobase.common.lastModifiedDate=
-echobase.common.lastModifiedUser=
-echobase.common.litteratureReferences=
-echobase.common.metadata=
-echobase.common.mission=
-echobase.common.missionAbstract=
-echobase.common.modificationDate=
-echobase.common.modificationText=
-echobase.common.modificationUser=
-echobase.common.name=
-echobase.common.organisationLevelAcknowledgements=
-echobase.common.organisationReferences=
-echobase.common.password=
-echobase.common.platform=
-echobase.common.principalInvestigator=
-echobase.common.principalInvestigatorEmail=
-echobase.common.project=
-echobase.common.referenceDatum=
-echobase.common.source=
-echobase.common.species=
-echobase.common.sqlQuery=
-echobase.common.transect=
-echobase.common.transit=
-echobase.common.vessel=
-echobase.common.voyage=
echobase.config.csv.separator.description=
echobase.config.data.directory.description=
echobase.config.embedded.description=
@@ -57,6 +7,5 @@
echobase.config.internal.db.directory.description=
echobase.config.postgresqlVersion.description=
echobase.config.version.description=
-echobase.config.war.directory.description=
echobase.config.war.location.description=
-echobase.configuration.description=Configuration d'EchoBase
+echobase.configuration.description=EchoBase configuration
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 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-domain/src/main/resources/i18n/echobase-domain_fr_FR.properties 2012-09-04 06:14:33 UTC (rev 609)
@@ -1,62 +1,11 @@
-echobase.common.admin=Administrateur
-echobase.common.areaOfOperation=AreaOfOperation
-echobase.common.author=Auteur
-echobase.common.authorEmail=Courriel de l'auteur
-echobase.common.calibration=Calibration
-echobase.common.cell=Cell
-echobase.common.data=Data
-echobase.common.dataAcquisition=DataAcquisition
-echobase.common.dataCentre=Centre de données
-echobase.common.dataCentreEmail=Courriel du centre de données
-echobase.common.dataProcessing=DataProcessing
-echobase.common.dataQuality=DataQuality
-echobase.common.datum=Datum
-echobase.common.depthStratum=DepthStratum
-echobase.common.description=Description
-echobase.common.distributionStatement=distributionStatement
echobase.common.driverType.h2=Base H2
echobase.common.driverType.postgres=Base Postgresql
-echobase.common.echoBaseUser=Utilisateur
-echobase.common.email=Courriel
-echobase.common.entityId=Identifiant de l'entité
-echobase.common.entityModificationLog=Journal des modifications
-echobase.common.entityType=Type de l'entité
-echobase.common.exportQuery=Requête d'export
-echobase.common.id=Identifiant
-echobase.common.institution=Institution
-echobase.common.keywords=Môts clefs
-echobase.common.lastModifiedDate=Date de dernière modification
-echobase.common.lastModifiedUser=Utilisateur de dernière modification
-echobase.common.litteratureReferences=Références
-echobase.common.metadata=Metadata
-echobase.common.mission=Mission
-echobase.common.missionAbstract=Résumé de la mission
-echobase.common.modificationDate=Date de modification
-echobase.common.modificationText=Modification
-echobase.common.modificationUser=Utilisateur
-echobase.common.name=Nom
-echobase.common.organisationLevelAcknowledgements=organisationLevelAcknowledgements
-echobase.common.organisationReferences=Références organisation
-echobase.common.password=Mot de passe
-echobase.common.platform=Platform
-echobase.common.principalInvestigator=Chercheur
-echobase.common.principalInvestigatorEmail=Courriel du chercheur
-echobase.common.project=Projet
-echobase.common.referenceDatum=ReferenceDatum
-echobase.common.source=Source
-echobase.common.species=Espèce
-echobase.common.sqlQuery=Requête SQL
-echobase.common.transect=Transect
-echobase.common.transit=Transit
-echobase.common.vessel=Navire
-echobase.common.voyage=Campagne
-echobase.config.csv.separator.description=
+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.embedded.description=
+echobase.config.embedded.description=Pour créer au démarrage une configuration vers la base h2 embarquée (uniquement pour les applications embarquées)
echobase.config.h2Version.description=Version du pilote jdbc H2
echobase.config.internal.db.directory.description=Répertoire de la base interne
echobase.config.postgresqlVersion.description=Version du pilote jdbc Postgresql
echobase.config.version.description=Version de l'application
-echobase.config.war.directory.description=Répertoire où sont accessibles les wars
-echobase.config.war.location.description=chemin d'accèss au war embarqué à utiliser pour créer des applications embarquées
+echobase.config.war.location.description=Chemin d'accèss au war embarqué à utiliser pour créer des applications embarquées
echobase.configuration.description=Configuration d'EchoBase
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/embeddedapplication/EmbeddedApplicationService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/embeddedapplication/EmbeddedApplicationService.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/embeddedapplication/EmbeddedApplicationService.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -26,7 +26,6 @@
import com.google.common.base.Charsets;
import com.google.common.base.Preconditions;
import fr.ifremer.echobase.EchoBaseTechnicalException;
-import fr.ifremer.echobase.entities.DriverType;
import fr.ifremer.echobase.entities.EchoBaseUser;
import fr.ifremer.echobase.entities.ExportQuery;
import fr.ifremer.echobase.entities.WorkingDbConfiguration;
@@ -45,7 +44,6 @@
import fr.ifremer.echobase.services.importdb.ImportDbConfiguration;
import fr.ifremer.echobase.services.importdb.ImportDbService;
import fr.ifremer.echobase.services.workingDb.WorkingDbConfigurationAlreadyExistException;
-import fr.ifremer.echobase.services.workingDb.WorkingDbConfigurationService;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
@@ -189,8 +187,6 @@
model.incrementsProgression();
// get all working db configuration from application
- WorkingDbConfigurationService workingDbConfigurationService =
- newServiceContext.getService(WorkingDbConfigurationService.class);
List<WorkingDbConfiguration> confs =
getEntities(WorkingDbConfiguration.class);
@@ -199,16 +195,6 @@
getInternalTransaction().replicateEntities(
newServiceContext.getInternalTransaction(), confs);
- // add a new configuration to the embedded working db
- WorkingDbConfiguration conf =
- workingDbConfigurationService.newConfiguration();
- conf.setDriverType(DriverType.H2);
- conf.setLogin("sa");
- conf.setDescription("Embedded working db");
- conf.setUrl("jdbc:h2:file:${echobase.data.directory}/db/echobase;CACHE_SIZE=65536;AUTO_SERVER=TRUE");
-
- workingDbConfigurationService.create(conf);
-
model.incrementsProgression();
return admin;
@@ -226,10 +212,9 @@
EchoBaseUser admin) throws IOException, TopiaException {
JdbcConfiguration dbConf = JdbcConfiguration.newEmbeddedConfig(dir);
- TopiaContext rootContext = EchobaseTopiaContexts.newWorkingDb(dbConf);
+ TopiaContext rootContext = EchobaseTopiaContexts.newWorkingDb(
+ dbConf);
try {
- // create db schema
- rootContext.createSchema();
// inject a new transaction in service context
newServiceContext.setTransaction(rootContext.beginTransaction());
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/workingDb/WorkingDbConfigurationService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/workingDb/WorkingDbConfigurationService.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/workingDb/WorkingDbConfigurationService.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -24,6 +24,7 @@
*/
import fr.ifremer.echobase.EchoBaseTechnicalException;
+import fr.ifremer.echobase.entities.DriverType;
import fr.ifremer.echobase.entities.WorkingDbConfiguration;
import fr.ifremer.echobase.entities.WorkingDbConfigurationDAO;
import fr.ifremer.echobase.services.EchoBaseServiceSupport;
@@ -112,6 +113,23 @@
}
}
+ public void createEmbeddedWorkingDbConfiguration() {
+
+ String url = "jdbc:h2:file:${echobase.data.directory}/db/echobase;CACHE_SIZE=65536;AUTO_SERVER=TRUE";
+ if (!isUrlAlreadyUsed(url)) {
+ WorkingDbConfiguration conf = newConfiguration();
+ conf.setDriverType(DriverType.H2);
+ conf.setLogin("sa");
+ conf.setDescription("Embedded working db");
+ conf.setUrl(url);
+ try {
+ create(conf);
+ } catch (WorkingDbConfigurationAlreadyExistException e) {
+ // can not happen
+ }
+ }
+ }
+
protected WorkingDbConfiguration getExistingConf(String id) throws WorkingDbConfigurationNotFoundException {
WorkingDbConfiguration entity =
getEntityById(WorkingDbConfiguration.class, id);
Modified: trunk/echobase-services/src/main/resources/embedded/echobase.properties
===================================================================
--- trunk/echobase-services/src/main/resources/embedded/echobase.properties 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-services/src/main/resources/embedded/echobase.properties 2012-09-04 06:14:33 UTC (rev 609)
@@ -25,5 +25,8 @@
# Where to find data
echobase.data.directory=.
-# where to find war
-echobase.war.directory=${echobase.data.directory}
+# Where to find war
+echobase.war.location=${echobase.data.directory}/echobase-ui-${echobase.version}-embedded.war
+
+# To create embedded working db
+echobase.embedded=true
Modified: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/AbstractToolTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/AbstractToolTest.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/AbstractToolTest.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -94,7 +94,8 @@
JdbcConfiguration dbConf = JdbcConfiguration.newEmbeddedConfig(testdir);
- topiaContext = EchobaseTopiaContexts.newWorkingDb(dbConf);
+ topiaContext = EchobaseTopiaContexts.newWorkingDb(
+ dbConf);
serviceContext = DefaultEchoBaseServiceContext.newContext(
Locale.getDefault(),
Modified: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/TestHelper.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/TestHelper.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/TestHelper.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -23,23 +23,16 @@
*/
package fr.ifremer.echobase.tools;
-import fr.ifremer.echobase.persistence.EchobaseTopiaContexts;
-import fr.ifremer.echobase.persistence.JdbcConfiguration;
-import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Assume;
import org.junit.Ignore;
import org.junit.rules.TestName;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.util.FileUtil;
import java.io.File;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
/**
* Utility methods for tests
@@ -98,32 +91,32 @@
FileUtil.createDirectoryIfNecessary(result);
return result;
}
+//
+// public static TopiaContext getRootContext(File dbDir) {
+//
+// JdbcConfiguration dbConf = JdbcConfiguration.newEmbeddedConfig(dbDir);
+// TopiaContext context = EchobaseTopiaContexts.newWorkingDb(persistenceHelper, dbConf);
+// return context;
+// }
- public static TopiaContext getRootContext(File dbDir) {
+// /**
+// * Used to get all contract of a package
+// *
+// * @param entitiesPackage package contening desired entities
+// * @return contracts contained in entitiesPackage
+// */
+// public static EchoBaseEntityEnum[] getContractsOf(Package entitiesPackage) {
+// EchoBaseEntityEnum[] echoBaseEntityEnums = EchoBaseEntityEnum.values();
+// List<EchoBaseEntityEnum> refClasses = new ArrayList<EchoBaseEntityEnum>();
+// for (EchoBaseEntityEnum echoBaseEntityEnum : echoBaseEntityEnums) {
+//
+// // Get all entities in package fr.ifremer.echobase.entities.references
+// Class<? extends TopiaEntity> contract = echoBaseEntityEnum.getContract();
+// if (entitiesPackage.equals(contract.getPackage())) {
+// refClasses.add(echoBaseEntityEnum);
+// }
+// }
+// return refClasses.toArray(new EchoBaseEntityEnum[refClasses.size()]);
+// }
- JdbcConfiguration dbConf = JdbcConfiguration.newEmbeddedConfig(dbDir);
- TopiaContext context = EchobaseTopiaContexts.newWorkingDb(dbConf);
- return context;
- }
-
- /**
- * Used to get all contract of a package
- *
- * @param entitiesPackage package contening desired entities
- * @return contracts contained in entitiesPackage
- */
- public static EchoBaseEntityEnum[] getContractsOf(Package entitiesPackage) {
- EchoBaseEntityEnum[] echoBaseEntityEnums = EchoBaseEntityEnum.values();
- List<EchoBaseEntityEnum> refClasses = new ArrayList<EchoBaseEntityEnum>();
- for (EchoBaseEntityEnum echoBaseEntityEnum : echoBaseEntityEnums) {
-
- // Get all entities in package fr.ifremer.echobase.entities.references
- Class<? extends TopiaEntity> contract = echoBaseEntityEnum.getContract();
- if (entitiesPackage.equals(contract.getPackage())) {
- refClasses.add(echoBaseEntityEnum);
- }
- }
- return refClasses.toArray(new EchoBaseEntityEnum[refClasses.size()]);
- }
-
}
Modified: trunk/echobase-ui/pom.xml
===================================================================
--- trunk/echobase-ui/pom.xml 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-ui/pom.xml 2012-09-04 06:14:33 UTC (rev 609)
@@ -31,11 +31,14 @@
<env>dev</env>
<redmine.releaseFiles>
- ${basedir}/target/${project.build.finalName}.war
+ ${project.build.directory}/${project.build.finalName}.war,
+ ${project.build.directory}/${project.build.finalName}-embedded.war
+ ${project.build.directory}/${project.build.finalName}-embedded.zip
</redmine.releaseFiles>
<deployFiles>
- ${basedir}/target/${project.build.finalName}.war
+ ${project.build.directory}/${project.build.finalName}.war,
+ ${project.build.directory}/${project.build.finalName}-embedded.war
</deployFiles>
</properties>
@@ -62,7 +65,6 @@
<directory>src/main/env/${env}/resources</directory>
<includes>
<include>*.properties</include>
- <include>*.xml</include>
</includes>
</resource>
</resources>
@@ -147,32 +149,6 @@
</configuration>
</plugin>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <mainClass>org.nuiton.web.war.JettyLauncher</mainClass>
- </manifest>
- </archive>
- <overlays>
- <overlay>
- <groupId>org.nuiton.web</groupId>
- <artifactId>nuiton-web</artifactId>
- <type>jar</type>
- <includes>
- <include>**/war/Jetty*</include>
- </includes>
- </overlay>
- <overlay>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-runner</artifactId>
- <type>jar</type>
- </overlay>
- </overlays>
- </configuration>
- </plugin>
-
</plugins>
</pluginManagement>
</build>
@@ -347,6 +323,165 @@
<profiles>
<profile>
+ <id>assembly</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <properties>
+ <embeddedWarDir>
+ ${project.build.directory}/echobase-embedded-${project.version}
+ </embeddedWarDir>
+ </properties>
+ <build>
+ <defaultGoal>verify</defaultGoal>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-temp-workdir</id>
+ <phase>generate-resources</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${embeddedWarDir}/WEB-INF/classes"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Compile jsp for embedded war -->
+
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-jspc-maven-plugin</artifactId>
+ <version>${jettyPluginVersion}</version>
+ <executions>
+ <execution>
+ <id>jspc</id>
+ <goals>
+ <goal>jspc</goal>
+ </goals>
+ <configuration>
+ <generatedClasses>
+ ${embeddedWarDir}/WEB-INF/classes
+ </generatedClasses>
+ <webXmlFragment>
+ ${embeddedWarDir}/WEB-INF/webfrag.xml
+ </webXmlFragment>
+ <packageRoot>org.apache.jsp</packageRoot>
+
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-core</artifactId>
+ <version>${struts2Version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jgeppert.struts2.jquery</groupId>
+ <artifactId>struts2-jquery-plugin</artifactId>
+ <version>${jqueryPluginVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jgeppert.struts2.jquery</groupId>
+ <artifactId>struts2-jquery-grid-plugin</artifactId>
+ <version>${jqueryPluginVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-sitemesh-plugin</artifactId>
+ <version>${struts2Version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <!-- Build embedded war -->
+
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>pack-embedded-war</id>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <primaryArtifact>false</primaryArtifact>
+ <webappDirectory>${embeddedWarDir}</webappDirectory>
+ <archive>
+ <manifest>
+ <mainClass>org.nuiton.web.war.JettyLauncher</mainClass>
+ </manifest>
+ </archive>
+ <warName>echobase-ui-${project.version}-embedded</warName>
+ <webResources>
+ <webResource>
+ <directory>${embeddedWarDir}</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <excludes>
+ <exclude>**/webfrag.xml</exclude>
+ </excludes>
+ </webResource>
+ </webResources>
+ <overlays>
+ <overlay>
+ <groupId>org.nuiton.web</groupId>
+ <artifactId>nuiton-web</artifactId>
+ <type>jar</type>
+ <includes>
+ <include>**/war/Jetty*</include>
+ </includes>
+ </overlay>
+ <overlay>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-runner</artifactId>
+ <type>jar</type>
+ </overlay>
+ </overlays>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Build embedded zip -->
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/bin.xml</descriptor>
+ </descriptors>
+ <attach>false</attach>
+ <finalName>echobase-ui-${project.version}-embedded</finalName>
+ <appendAssemblyId>false</appendAssemblyId>
+ </configuration>
+ <executions>
+ <execution>
+ <id>create-assemblies</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
<id>add-log-to-jetty</id>
<activation>
<file>
Added: trunk/echobase-ui/src/main/assembly/bin.xml
===================================================================
--- trunk/echobase-ui/src/main/assembly/bin.xml (rev 0)
+++ trunk/echobase-ui/src/main/assembly/bin.xml 2012-09-04 06:14:33 UTC (rev 609)
@@ -0,0 +1,69 @@
+<!--
+ #%L
+ EchoBase :: UI
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<assembly>
+ <id>bin</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <fileSets>
+
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory>/</outputDirectory>
+ <fileMode>0755</fileMode>
+ <includes>
+ <include>echobase-ui-${project.version}-embedded.war</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>target/classes</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>THIRD-PARTY.txt</include>
+ <include>LICENSE.txt</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>src/main/assembly/dist</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>**/*.properties</include>
+ <include>**/*.txt</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>src/main/assembly/dist</directory>
+ <outputDirectory>/</outputDirectory>
+ <fileMode>0755</fileMode>
+ <filtered>true</filtered>
+ <includes>
+ <include>**/*.sh</include>
+ <include>**/*.bat</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>
Property changes on: trunk/echobase-ui/src/main/assembly/bin.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-ui/src/main/assembly/dist/README.txt
===================================================================
--- trunk/echobase-ui/src/main/assembly/dist/README.txt (rev 0)
+++ trunk/echobase-ui/src/main/assembly/dist/README.txt 2012-09-04 06:14:33 UTC (rev 609)
@@ -0,0 +1,20 @@
+=============================
+EchoBase - ${project.version}
+=============================
+
+Premier démarrage
+-----------------
+
+Pour démarrer EchoBase :
+
+- Il faut avoir une JDK d'installer sur la machine cible.
+
+- la variable JDK_HOME doit être positionnée dans les variables d'environements.
+
+En suite on lance
+
+./startEchobase.sh (sous linux)
+
+ou
+
+startEchobase.bat (sous windows)
Property changes on: trunk/echobase-ui/src/main/assembly/dist/README.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-ui/src/main/assembly/dist/echobase.properties
===================================================================
--- trunk/echobase-ui/src/main/assembly/dist/echobase.properties (rev 0)
+++ trunk/echobase-ui/src/main/assembly/dist/echobase.properties 2012-09-04 06:14:33 UTC (rev 609)
@@ -0,0 +1,37 @@
+###
+# #%L
+# EchoBase :: UI
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2011 - 2012 Ifremer, Codelutin
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# #L%
+###
+#
+# Pollen - v ${project.version} Configuration
+#
+# See README.txt for more informations about howto custmize Pollen.
+#
+
+# Where to find data
+echobase.data.directory=.
+
+# Where to find war
+echobase.war.location=${echobase.data.directory}/echobase-ui-${echobase.version}-embedded.war
+
+# To create embedded working db
+echobase.embedded=true
+
Property changes on: trunk/echobase-ui/src/main/assembly/dist/echobase.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-ui/src/main/assembly/dist/startEchobase.bat
===================================================================
--- trunk/echobase-ui/src/main/assembly/dist/startEchobase.bat (rev 0)
+++ trunk/echobase-ui/src/main/assembly/dist/startEchobase.bat 2012-09-04 06:14:33 UTC (rev 609)
@@ -0,0 +1,48 @@
+@REM ----------------------------------------------------------------------------
+@REM EchoBase Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM ----------------------------------------------------------------------------
+@echo off
+
+if not "%JDK_HOME%" == "" goto OkJHome
+
+echo.
+echo ERROR: JDK_HOME not found in your environment.
+echo Please set the JDK_HOME variable in your environment to match the
+echo location of your Java installation
+echo.
+goto error
+
+:OkJHome
+echo JDK_HOME defined to %JDK_HOME%
+
+if exist "%JDK_HOME%\bin\java.exe" goto doit
+
+echo.
+echo ERROR: JDK_HOME is set to an invalid directory.
+echo JDK_HOME = "%JDK_HOME%"
+echo Please set the JDK_HOME variable in your environment to match the
+echo location of your Java installation
+echo.
+goto error
+
+:error
+set ERROR_CODE=1
+goto end
+
+:doit
+set JAVA_COMMAND="%JDK_HOME%\bin\java.exe"
+echo java.exe defined to %JAVA_COMMAND%
+
+set ECHOBASE_OPTS="-Xms512m -Xmx1024m -Dechobase.log.dir=./logs"
+echo java options used : %ECHOBASE_OPTS%
+
+%JAVA_COMMAND% "%ECHOBASE_OPTS%" -jar echobase-ui-${project.version}-embedded.war
+goto end
+
+:end
+
+pause
+cmd /C exit /B %ERROR_CODE%
Property changes on: trunk/echobase-ui/src/main/assembly/dist/startEchobase.bat
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-ui/src/main/assembly/dist/startEchobase.sh
===================================================================
--- trunk/echobase-ui/src/main/assembly/dist/startEchobase.sh (rev 0)
+++ trunk/echobase-ui/src/main/assembly/dist/startEchobase.sh 2012-09-04 06:14:33 UTC (rev 609)
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+if [ ! -e $JDK_HOME/bin/java ]; then
+ echo "Do not find $JDK_HOME/bin/java, please add JDK_HOME environnement variable"
+ exit 1
+fi
+
+JAVA_EXEC=$JDK_HOME/bin/java
+
+OLDPWD=`pwd`
+cd `dirname $0`
+CURRENTPWD=`pwd`
+ECHOBASE_OPTS="$JAVA_OPTS -Xms512m -Xmx10242m -Dechobase.log.dir=$CURRENTPWD/logs"
+$JAVA_EXEC $ECHOBASE_OPTS -jar echobase-ui-${project.version}-embedded.war $*
+cd "$OLDPWD"
+
Property changes on: trunk/echobase-ui/src/main/assembly/dist/startEchobase.sh
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -34,6 +34,7 @@
import fr.ifremer.echobase.services.EchoBaseServiceContext;
import fr.ifremer.echobase.services.UserService;
import fr.ifremer.echobase.services.embeddedapplication.EmbeddedApplicationService;
+import fr.ifremer.echobase.services.workingDb.WorkingDbConfigurationService;
import fr.ird.converter.FloatConverter;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.Converter;
@@ -193,7 +194,8 @@
TopiaContext rootContext = context.getInternalRootContext();
Preconditions.checkNotNull(rootContext);
- boolean schemaExist = dbMeta.getPersistenceHelper().isInternalSchemaCreated(rootContext);
+ boolean schemaExist =
+ EchoBaseEntityHelper.isInternalSchemaCreated(rootContext);
if (schemaExist) {
@@ -228,6 +230,17 @@
service.createDefaultUsers();
}
+
+ if (configuration.isEmbedded()) {
+
+ if (log.isInfoEnabled()) {
+ log.info("Will try t create default working db " +
+ "configuration for embedded db.");
+ }
+ // try to create a default embedded working db configuration
+ serviceContext.getService(WorkingDbConfigurationService.class).
+ createEmbeddedWorkingDbConfiguration();
+ }
} finally {
serviceContext.setInternalTransaction(null);
EchoBaseEntityHelper.closeConnection(tx);
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -167,7 +167,8 @@
// creates a new topia root context from configuration
TopiaContext rootContext =
- EchobaseTopiaContexts.newWorkingDb(jdbcConfiguration);
+ EchobaseTopiaContexts.newWorkingDb(
+ jdbcConfiguration);
// keep configuration is session
set(PROPERTY_WORKING_DB_CONFIGURATION, jdbcConfiguration);
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/Connect.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/Connect.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/Connect.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -24,8 +24,10 @@
*/
import com.opensymphony.xwork2.interceptor.annotations.InputConfig;
+import fr.ifremer.echobase.entities.DriverType;
import fr.ifremer.echobase.persistence.EchoBaseEntityHelper;
import fr.ifremer.echobase.persistence.JdbcConfiguration;
+import org.apache.commons.lang.StringUtils;
import java.sql.SQLException;
@@ -61,7 +63,7 @@
EchoBaseEntityHelper.checkJDBCConnection(jdbcConf);
getEchoBaseSession().initWorkingDb(jdbcConf);
addFlashMessage(_("echobase.info.workingDbconfiguration.connected",
- conf.getUrl()));
+ conf.getUrl()));
result = SUCCESS;
} catch (SQLException e) {
@@ -79,11 +81,8 @@
public void validate() {
jdbcConf = JdbcConfiguration.newConfig(
- getConf().getUrl(),
- getConf().getLogin(),
- password,
- getConf().getDriverType()
- );
+ getConf().getDriverType(), getConf().getUrl(),
+ getConf().getLogin(), password);
// check connexion is ok
try {
@@ -95,6 +94,19 @@
_("echobase.error.workingDbConfiguration.couldNotConnect",
e.getMessage()));
}
+ }
+ @Override
+ public void prepare() throws Exception {
+
+ super.prepare();
+
+ if (DriverType.H2.equals(conf.getDriverType()) &&
+ StringUtils.isBlank(getPassword())) {
+
+ // use a default h2 password
+ setPassword("sa");
+ }
+
}
}
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.java 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.java 2012-09-04 06:14:33 UTC (rev 609)
@@ -1,5 +1,28 @@
package fr.ifremer.echobase.ui.actions.workingDb;
+/*
+ * #%L
+ * EchoBase :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.echobase.EchoBaseConfiguration;
import fr.ifremer.echobase.persistence.JdbcConfiguration;
import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties
===================================================================
--- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties 2012-09-04 06:14:33 UTC (rev 609)
@@ -154,6 +154,7 @@
echobase.error.workingDbConfiguration.url.already.exists=
echobase.error.workingDbConfiguration.url.required=
echobase.header.request.result=
+echobase.info.click.to.select=Vous pouvez sélectionner la valeur en un simple click puis la copier (Ctrl-C)
echobase.info.dbeditor.propertyDiffsResult=
echobase.info.downloadEchoBase=Téléchargement de l'application et des fichiers d'import
echobase.info.echoBaseForge=Gestion du projet
Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
===================================================================
--- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-09-04 06:14:33 UTC (rev 609)
@@ -32,8 +32,8 @@
echobase.action.show.import.documentation=Accéder à la documentation de l'import
echobase.action.toEnglish=Utiliser la version anglaise
echobase.action.toFrench=Utiliser la version française
-echobase.action.usingEnglish=Version anglaise utilisé
-echobase.action.usingFrench=Version française utilisé
+echobase.action.usingEnglish=Version anglaise utilisée
+echobase.action.usingFrench=Version française utilisée
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
@@ -42,32 +42,32 @@
echobase.common.acquisitionSoftwareVersionME70=acquisitionSoftwareVersion (ME70 instrument)
echobase.common.addDataAcquisition=Toujours créer des DataAcqusitions
echobase.common.admin=Administrateur
-echobase.common.areaOfOperation=
-echobase.common.author=
-echobase.common.authorEmail=
+echobase.common.areaOfOperation=AreaOfOperation
+echobase.common.author=Auteur
+echobase.common.authorEmail=Courriel de l'auteur
echobase.common.biometrySampleFile=
echobase.common.cellMapsFile=
echobase.common.cellPositionReference=cellPositionReference
echobase.common.cellRegionAssociationFile=
echobase.common.cellRegionResultFile=
echobase.common.cellRegionsFile=
-echobase.common.dataCentre=
-echobase.common.dataCentreEmail=
-echobase.common.dataProcessing=
+echobase.common.dataCentre=Centre de données
+echobase.common.dataCentreEmail=Courriel du centre de données
+echobase.common.dataProcessing=DataProcessing
echobase.common.dataProcessingNotes=dataProcessingNotes
-echobase.common.datum=
+echobase.common.datum=Datum
echobase.common.digitThreshold=digitThreshold
-echobase.common.distributionStatement=
+echobase.common.distributionStatement=distributionStatement
echobase.common.echotypeFile=
-echobase.common.email=Email
-echobase.common.entityId=
-echobase.common.entityType=Type d'entité
+echobase.common.email=Courriel
+echobase.common.entityId=Identifiant de l'entité
+echobase.common.entityType=Type de l'entité
echobase.common.esduByEchotypeAndSpeciesCategoryFile=
echobase.common.esduByEchotypeFile=
echobase.common.esduBySpeciesAndAgeCategoryFile=
echobase.common.esduBySpeciesAndSizeCategoryFile=
echobase.common.gearMetadataFile=
-echobase.common.id=
+echobase.common.id=Identifiant
echobase.common.importDataMode=Type d'import
echobase.common.importDbFile=
echobase.common.importError=Un erreur est survenue pendant l'import \:
@@ -80,44 +80,44 @@
echobase.common.importNotes=Remarques sur l'import
echobase.common.importResult=Résultat de l'import
echobase.common.inProgress=en cours...
-echobase.common.institution=
+echobase.common.institution=Institution
echobase.common.jdbcDriver=Nom du pilote jdbc
echobase.common.jdbcLogin=Login de connexion
echobase.common.jdbcPassword=Mot de passe
echobase.common.jdbcUrl=Url de connexion
-echobase.common.keywords=
-echobase.common.lastModifiedDate=
-echobase.common.lastModifiedUser=
+echobase.common.keywords=Môts clefs
+echobase.common.lastModifiedDate=Date de dernière modification
+echobase.common.lastModifiedUser=Utilisateur de dernière modification
echobase.common.lengthAgeKeyFile=
echobase.common.lengthWeightKeyFile=
-echobase.common.litteratureReferences=
+echobase.common.litteratureReferences=Références
echobase.common.loggedDataDatatype=loggedDataDatatype
echobase.common.loggedDataFormat=loggedDataFormat
-echobase.common.mission=
-echobase.common.missionAbstract=
-echobase.common.modificationDate=
-echobase.common.modificationText=
-echobase.common.modificationUser=
+echobase.common.mission=Mission
+echobase.common.missionAbstract=Résumé de la mission
+echobase.common.modificationDate=Date de modification
+echobase.common.modificationText=Modification
+echobase.common.modificationUser=Utilisateur
echobase.common.moviesFile=
-echobase.common.name=
+echobase.common.name=Nom
echobase.common.operationFile=
echobase.common.operationMetadataFile=
-echobase.common.organisationLevelAcknowledgements=
-echobase.common.organisationReferences=
+echobase.common.organisationLevelAcknowledgements=organisationLevelAcknowledgements
+echobase.common.organisationReferences=Références organisation
echobase.common.password=Mot de passe
echobase.common.pilotVersion=Version du pilote jdbc
echobase.common.pingDutyCycle=pingDutyCycle
-echobase.common.platform=
-echobase.common.principalInvestigator=
-echobase.common.principalInvestigatorEmail=
+echobase.common.platform=Platform
+echobase.common.principalInvestigator=Chercheur
+echobase.common.principalInvestigatorEmail=Courriel du chercheur
echobase.common.processingDescription=processingDescription
echobase.common.processingTemplate=processingTemplate
-echobase.common.project=
+echobase.common.project=Projet
echobase.common.resultLabel=Result label
echobase.common.soundSpeedCalculationsER60=soundSpeedCalculations (ER60 instrument)
echobase.common.soundSpeedCalculationsME70=soundSpeedCalculations (ME70 instrument)
echobase.common.sounderConstant=sounderConstant
-echobase.common.source=
+echobase.common.source=Source
echobase.common.subSampleFile=
echobase.common.tableDatas=
echobase.common.totalSampleFile=
@@ -129,8 +129,8 @@
echobase.common.transitFile=
echobase.common.transitRelatedActivity=RelatedActivity (transit)
echobase.common.user=Utilisateur
-echobase.common.vessel=
-echobase.common.voyage=
+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 suivante
@@ -154,6 +154,7 @@
echobase.error.workingDbConfiguration.url.already.exists=Une connexion existe déjà avec cette url
echobase.error.workingDbConfiguration.url.required=Url obligatoire
echobase.header.request.result=Résultat de la requète sql
+echobase.info.click.to.select=Vous pouvez sélectionner la valeur en un simple click puis la copier (Ctrl-C)
echobase.info.dbeditor.propertyDiffsResult=Résultat d'import de données
echobase.info.downloadEchoBase=Téléchargement de l'application et des fichiers d'import
echobase.info.echoBaseForge=Gestion du projet
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 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/information.jsp 2012-09-04 06:14:33 UTC (rev 609)
@@ -58,15 +58,21 @@
<fieldset>
<legend><s:text name="echobase.legend.connectionToDb.detail"/></legend>
<s:label key="dbConfiguration.url"
- label='%{getText("echobase.common.jdbcUrl")}'/>
+ label='%{getText("echobase.common.jdbcUrl")} (*)'/>
<s:label key="dbConfiguration.login"
- label='%{getText("echobase.common.jdbcLogin")}'/>
+ label='%{getText("echobase.common.jdbcLogin")} (*)'/>
<s:label key="dbConfiguration.password"
- label='%{getText("echobase.common.jdbcPassword")}'/>
+ label='%{getText("echobase.common.jdbcPassword")} (*)'/>
<s:label key="dbConfiguration.driverType.driverClass.name"
- label='%{getText("echobase.common.jdbcDriver")}'/>
- <s:label key="pilotVersion" id='dbConfiguration_pilotVersion'
+ label='%{getText("echobase.common.jdbcDriver")} (*)'/>
+ <s:label key="pilotVersion"
label='%{getText("echobase.common.pilotVersion")}'/>
+ <br/>
+ <div class="cleanBoth help">
+ <label>
+ (*) <s:text name="echobase.info.click.to.select"/>
+ </label>
+ </div>
</fieldset>
<br/>
@@ -84,9 +90,6 @@
</ul>
</s:form>
-<%--<s:a namespace="/workingDb" action="downloadDriver">--%>
-<%--<s:text name="echobase.action.workingDb.downloadDriver"/>--%>
-<%--</s:a>--%>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/manage.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/manage.jsp 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/manage.jsp 2012-09-04 06:14:33 UTC (rev 609)
@@ -86,14 +86,14 @@
readonly="%{confExists}"
label="%{getText('echobase.label.workingDbConfiguration.url')}"/>
+ <s:textarea key="conf.description" required="true" cols="160" rows="4"
+ readonly="%{confExists}"
+ label="%{getText('echobase.label.workingDbConfiguration.description')}"/>
+
<s:textfield key="conf.login" required="true" size="80"
readonly="%{confExists}"
label="%{getText('echobase.label.workingDbConfiguration.login')}"/>
- <s:textarea key="conf.description" required="true" cols="160" rows="4"
- readonly="%{confExists}"
- label="%{getText('echobase.label.workingDbConfiguration.description')}"/>
-
<s:if test="confExists">
<s:password key="password" required="true" size="80"
label="%{getText('echobase.label.workingDbConfiguration.password')}"/>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-09-03 20:17:30 UTC (rev 608)
+++ trunk/pom.xml 2012-09-04 06:14:33 UTC (rev 609)
@@ -65,6 +65,19 @@
</developers>
+ <contributors>
+ <contributor>
+ <name>Mathieu Doray</name>
+ <email>mathieu dot doray at ifremer dot fr</email>
+ <organization>Ifremer</organization>
+ <organizationUrl>http://ifremer.fr</organizationUrl>
+ <roles>
+ <role>document writer</role>
+ </roles>
+ <timezone>Europe/Paris</timezone>
+ </contributor>
+ </contributors>
+
<scm>
<url>http://svn.forge.codelutin.com/svn/echobase/trunk</url>
<connection>
1
0
Author: tchemit
Date: 2012-09-03 22:17:30 +0200 (Mon, 03 Sep 2012)
New Revision: 608
Url: http://forge.codelutin.com/repositories/revision/echobase/608
Log:
>From scmwebeditor -- Fix documentation (still some bad links)
Modified:
trunk/src/site/en/rst/index.rst
Modified: trunk/src/site/en/rst/index.rst
===================================================================
--- trunk/src/site/en/rst/index.rst 2012-09-03 20:16:50 UTC (rev 607)
+++ trunk/src/site/en/rst/index.rst 2012-09-03 20:17:30 UTC (rev 608)
@@ -54,7 +54,7 @@
.. _Ifremer forge: https://forge.ifremer.fr/www/echor
.. _ICES WGFAST: http://www.acoustics.washington.edu/FAST
-.. _installation: ./install.html
+.. _install: ./install.html
.. _model: ./model.html
.. _import data: ./imports.html
.. _local Echobase database: ./embedded.html
1
0
Author: tchemit
Date: 2012-09-03 22:16:50 +0200 (Mon, 03 Sep 2012)
New Revision: 607
Url: http://forge.codelutin.com/repositories/revision/echobase/607
Log:
>From scmwebeditor -- Fix documentation (still some bad links)
Modified:
trunk/src/site/en/rst/index.rst
Modified: trunk/src/site/en/rst/index.rst
===================================================================
--- trunk/src/site/en/rst/index.rst 2012-09-03 19:23:14 UTC (rev 606)
+++ trunk/src/site/en/rst/index.rst 2012-09-03 20:16:50 UTC (rev 607)
@@ -33,30 +33,28 @@
and computing acoustic indicators for survey-based ecosystem monitoring. It comprises a postgreSQL
database designed to store acoustic, navigation and fishing data from ecosystemic surveys (Echobase)
and a suite of R codes (EchoR) for computing fish population indicators based on Echobase data.
-This site describes the Echobase database. If you are interested in geoR, please visit the `Ifremer forge`_..
+This site describes the Echobase database. If you are interested in geoR, please visit the `Ifremer forge`_.
Echobase provide a web-browser interface for importing, editing and querying data,
large storage capacities, and an easy integration into Geographical Information Systems or dynamic websites.
The Echobase acoustic metadata format follows the `ICES WGFAST`_.Topic Group on metadata standards recommendations.
-.. _echoR: <forge.ifremer.fr/www/echor/>
-.. _WGFAST: <http://www.acoustics.washington.edu/FAST/>
-
Documentation
-------------
- How to `install`_. Echobase.
-- The Echobase `model`_..
+- The Echobase `model`_.
-- How to `import data`_. in Echobase.
+- How to `import data`_ in Echobase.
-- How to create a `local Echobase database`_..
+- How to create a `local Echobase database`_.
+.. _Ifremer forge: https://forge.ifremer.fr/www/echor
+.. _ICES WGFAST: http://www.acoustics.washington.edu/FAST
.. _installation: ./install.html
-.. _modèle: ./model.html
-.. _imports: ./imports.html
-.. _application embarquée: ./embedded.html
-
+.. _model: ./model.html
+.. _import data: ./imports.html
+.. _local Echobase database: ./embedded.html
1
0
r606 - in trunk: echobase-domain/src/main/java/fr/ifremer/echobase/entities echobase-services/src/main/java/fr/ifremer/echobase/services/embeddedapplication echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb echobase-ui/src/main/resources/config echobase-ui/src/main/resources/i18n echobase-ui/src/main/webapp/WEB-INF/includes echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb
by tchemit@users.forge.codelutin.com 03 Sep '12
by tchemit@users.forge.codelutin.com 03 Sep '12
03 Sep '12
Author: tchemit
Date: 2012-09-03 21:23:14 +0200 (Mon, 03 Sep 2012)
New Revision: 606
Url: http://forge.codelutin.com/repositories/revision/echobase/606
Log:
improve working db cinematic
Added:
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.java
Modified:
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/entities/DriverType.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/embeddedapplication/EmbeddedApplicationService.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/Information.java
trunk/echobase-ui/src/main/resources/config/struts-workingDb.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/webapp/WEB-INF/includes/header.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/information.jsp
Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/entities/DriverType.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/entities/DriverType.java 2012-09-03 15:32:42 UTC (rev 605)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/entities/DriverType.java 2012-09-03 19:23:14 UTC (rev 606)
@@ -42,18 +42,18 @@
H2Dialect.class,
n_("echobase.common.driverType.h2")) {
@Override
- public String getPilotFileName(EchoBaseConfiguration config) {
+ public String getPilotVersion(EchoBaseConfiguration config) {
String version = config.getH2Version();
- return version == null ? null : "h2-" + version + ".jar";
+ return version;
}
},
POSTGRESQL(org.postgresql.Driver.class,
PostgreSQLDialect.class,
n_("echobase.common.driverType.postgres")) {
@Override
- public String getPilotFileName(EchoBaseConfiguration config) {
- String pgVersion = config.getPostgresqlVersion();
- return pgVersion == null ? null : "postgresql-" + pgVersion + ".jar";
+ public String getPilotVersion(EchoBaseConfiguration config) {
+ String version = config.getPostgresqlVersion();
+ return version;
}
};
@@ -79,8 +79,13 @@
return dialectClass;
}
- public abstract String getPilotFileName(EchoBaseConfiguration config);
+ public abstract String getPilotVersion(EchoBaseConfiguration config);
+ public final String getPilotFileName(EchoBaseConfiguration config) {
+ String version = getPilotVersion(config);
+ return version == null ? null : name().toLowerCase() + "-" + version + ".jar";
+ }
+
@Override
public String getI18nKey() {
return i18nKey;
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/embeddedapplication/EmbeddedApplicationService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/embeddedapplication/EmbeddedApplicationService.java 2012-09-03 15:32:42 UTC (rev 605)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/embeddedapplication/EmbeddedApplicationService.java 2012-09-03 19:23:14 UTC (rev 606)
@@ -60,9 +60,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
-import java.net.URISyntaxException;
import java.util.List;
-import java.util.Properties;
/**
* To create embedded application.
@@ -304,15 +302,21 @@
protected void createStaticArchiveStructure(EmbeddedApplicationConfiguration model, File dir) {
try {
- File warLocation = model.getWarLocation();
// create /
FileUtil.createDirectoryIfNecessary(dir);
// copy embedded files to /
- copyEmbeddedFiles(dir);
+ copyEmbeddedTextFile("echobase.properties", dir);
+ copyEmbeddedTextFile("startEchobase.bat", dir);
+ copyEmbeddedTextFile("startEchobase.sh", dir);
+ copyEmbeddedTextFile("README.txt", dir);
+// Properties config = new Properties();
+// copyEmbeddedTextFile("echobase.properties", dir, config);
+
// copy war to /
+ File warLocation = model.getWarLocation();
FileUtils.copyFile(warLocation,
new File(dir, warLocation.getName()));
} catch (Exception eee) {
@@ -365,38 +369,55 @@
}
}
-// public File getPilotsDirectory(File dataDirectory) {
-// File driverDir = new File(dataDirectory, "drivers");
-// return driverDir;
+// protected void copyEmbeddedFiles(File zipDirectory) throws IOException, URISyntaxException {
+//
+// // config to keep the echobase-embedded values (contains h2 and pg versions)
+// Properties config = new Properties();
+// copyEmbeddedTextFile("echobase.properties", zipDirectory, config);
+//
+// copyEmbeddedTextFile("startEchobase.bat", zipDirectory, null);
+// copyEmbeddedTextFile("startEchobase.sh", zipDirectory, null);
+// copyEmbeddedTextFile("README.txt", zipDirectory, null);
// }
- protected void copyEmbeddedFiles(File zipDirectory) throws IOException, URISyntaxException {
+// public void copyEmbeddedTextFile(String resourceName,
+// File targetDirectory,
+// Properties config) throws IOException {
+// String resourcePath = EMBEDDED_PATH + resourceName;
+// InputStream inputStream = getClass().getResourceAsStream(resourcePath);
+// Preconditions.checkNotNull(inputStream,
+// "could not find resource " + resourcePath);
+// try {
+// if (config != null) {
+// config.load(inputStream);
+// }
+// File outputFile = new File(targetDirectory, resourceName);
+// if (log.isInfoEnabled()) {
+// log.info("Copy configuration to " + resourceName + " to " + outputFile);
+// }
+// OutputStreamWriter outputStream = new OutputStreamWriter(
+// new FileOutputStream(outputFile), Charsets.UTF_8);
+// try {
+// if (config == null) {
+// IOUtils.copy(inputStream, outputStream);
+// } else {
+// config.store(outputStream, null);
+// }
+// } finally {
+// outputStream.close();
+// }
+// } finally {
+// inputStream.close();
+// }
+// }
- // config to keep the echobase-embedded values (contains h2 and pg versions)
- Properties config = new Properties();
- copyEmbeddedFiles("echobase.properties", zipDirectory, config);
-
- copyEmbeddedFiles("startEchobase.bat", zipDirectory, null);
- copyEmbeddedFiles("startEchobase.sh", zipDirectory, null);
- copyEmbeddedFiles("README.txt", zipDirectory, null);
-
-// File driverDir = getPilotsDirectory(zipDirectory);
-// FileUtil.createDirectoryIfNecessary(driverDir);
-// copyEmbeddedFiles(DriverType.H2.getPilotFileName(getConfiguration()), driverDir, null);
-// copyEmbeddedFiles(DriverType.POSTGRESQL.getPilotFileName(getConfiguration()), driverDir, null);
- }
-
- public void copyEmbeddedFiles(String resourceName,
- File targetDirectory,
- Properties config) throws IOException {
+ public void copyEmbeddedTextFile(String resourceName,
+ File targetDirectory) throws IOException {
String resourcePath = EMBEDDED_PATH + resourceName;
InputStream inputStream = getClass().getResourceAsStream(resourcePath);
Preconditions.checkNotNull(inputStream,
"could not find resource " + resourcePath);
try {
- if (config != null) {
- config.load(inputStream);
- }
File outputFile = new File(targetDirectory, resourceName);
if (log.isInfoEnabled()) {
log.info("Copy configuration to " + resourceName + " to " + outputFile);
@@ -404,11 +425,7 @@
OutputStreamWriter outputStream = new OutputStreamWriter(
new FileOutputStream(outputFile), Charsets.UTF_8);
try {
- if (config == null) {
- IOUtils.copy(inputStream, outputStream);
- } else {
- config.store(outputStream, null);
- }
+ IOUtils.copy(inputStream, outputStream);
} finally {
outputStream.close();
}
@@ -441,20 +458,4 @@
IOUtils.closeQuietly(inputStream);
}
}
-
-// protected void importDb(EmbeddedApplicationConfiguration model,
-// EchoBaseServiceContext newServiceContext,
-// File exportZipFile,
-// EchoBaseUser admin) throws IOException, TopiaException {
-// ImportDbConfiguration importConfiguration =
-// new ImportDbConfiguration(model, getLocale());
-// importConfiguration.getInput().setFile(exportZipFile);
-// File importTempDir = new File(model.getWorkingDirectory(), "importDb");
-// importConfiguration.setWorkingDirectory(importTempDir);
-//
-// ImportDbService importDbService =
-// newServiceContext.getService(ImportDbService.class);
-// importDbService.importDb(importConfiguration, admin, false, true);
-// }
-
}
Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.java 2012-09-03 19:23:14 UTC (rev 606)
@@ -0,0 +1,72 @@
+package fr.ifremer.echobase.ui.actions.workingDb;
+
+import fr.ifremer.echobase.EchoBaseConfiguration;
+import fr.ifremer.echobase.persistence.JdbcConfiguration;
+import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+
+/**
+ * Download jdbc driver.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class DownloadDriver extends EchoBaseActionSupport {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Input stream of the file to download. */
+ protected transient InputStream inputStream;
+
+ /** File name of the download. */
+ protected String fileName;
+
+ /** Length of the file to download. */
+ protected long contentLength;
+
+ /** Content type of the file to download. */
+ protected String contentType;
+
+ public void setFileName(String fileName) {
+ this.fileName = fileName;
+ }
+
+ public InputStream getInputStream() {
+ return inputStream;
+ }
+
+ public long getContentLength() {
+ return contentLength;
+ }
+
+ public String getContentType() {
+ return contentType;
+ }
+
+ public String getFileName() {
+ return fileName;
+ }
+
+ @Override
+ public String execute() throws Exception {
+
+ EchoBaseConfiguration configuration =
+ getEchoBaseApplicationContext().getConfiguration();
+
+ JdbcConfiguration dbConfiguration = getEchoBaseSession().getWorkingDbConfiguration();
+
+ fileName =
+ dbConfiguration.getDriverType().getPilotFileName(configuration);
+
+ File file = new File(configuration.getLibDirectory(), fileName);
+
+ contentType = "application/java-archive";
+ contentLength = file.length();
+ inputStream = new BufferedInputStream(new FileInputStream(file));
+ return SUCCESS;
+ }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.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/workingDb/Information.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/Information.java 2012-09-03 15:32:42 UTC (rev 605)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/Information.java 2012-09-03 19:23:14 UTC (rev 606)
@@ -27,8 +27,6 @@
import fr.ifremer.echobase.persistence.JdbcConfiguration;
import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
-import java.io.File;
-
/**
* Display a page to show connection details.
*
@@ -41,14 +39,14 @@
protected JdbcConfiguration dbConfiguration;
- protected File jdbcPilot;
+ protected String pilotVersion;
public JdbcConfiguration getDbConfiguration() {
return dbConfiguration;
}
- public File getJdbcPilot() {
- return jdbcPilot;
+ public String getPilotVersion() {
+ return pilotVersion;
}
@Override
@@ -59,11 +57,9 @@
dbConfiguration = getEchoBaseSession().getWorkingDbConfiguration();
- String pilotName =
- dbConfiguration.getDriverType().getPilotFileName(configuration);
+ pilotVersion =
+ dbConfiguration.getDriverType().getPilotVersion(configuration);
- jdbcPilot = new File(configuration.getLibDirectory(), pilotName);
-
return SUCCESS;
}
}
Modified: trunk/echobase-ui/src/main/resources/config/struts-workingDb.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/config/struts-workingDb.xml 2012-09-03 15:32:42 UTC (rev 605)
+++ trunk/echobase-ui/src/main/resources/config/struts-workingDb.xml 2012-09-03 19:23:14 UTC (rev 606)
@@ -30,10 +30,10 @@
<result-types>
- <result-type name="redirectWorkingDbConfiguration"
+ <result-type name="redirectToShowList"
class="org.apache.struts2.dispatcher.ServletActionRedirectResult">
<param name="actionName">showList</param>
- <param name="namespace">workingDbConfiguration</param>
+ <param name="namespace">/workingDb</param>
<param name="conf.topiaId">${conf.topiaId}</param>
</result-type>
@@ -60,7 +60,7 @@
<action name="create" method="createConf"
class="fr.ifremer.echobase.ui.actions.workingDb.Create">
<result name="input" type="showList"/>
- <result type="redirectWorkingDbConfiguration"/>
+ <result type="redirectToShowList"/>
</action>
<!-- Clone the workingDbConfiguration -->
@@ -68,7 +68,7 @@
class="fr.ifremer.echobase.ui.actions.workingDb.Create">
<interceptor-ref name="prepareParamsStackLoggued"/>
<result name="input" type="showList"/>
- <result type="redirectWorkingDbConfiguration"/>
+ <result type="redirectToShowList"/>
</action>
<!-- Save the workingDbConfiguration -->
@@ -76,7 +76,7 @@
class="fr.ifremer.echobase.ui.actions.workingDb.Create">
<interceptor-ref name="prepareParamsStackLoggued"/>
<result name="input" type="showList"/>
- <result type="redirectWorkingDbConfiguration"/>
+ <result type="redirectToShowList"/>
</action>
<!-- Confirm to delete the workingDbConfiguration -->
@@ -91,7 +91,7 @@
class="fr.ifremer.echobase.ui.actions.workingDb.Delete">
<interceptor-ref name="prepareParamsStackLoggued"/>
<result name="input" type="showList"/>
- <result type="redirectWorkingDbConfiguration"/>
+ <result type="redirectToShowList"/>
</action>
<!-- Connect to selected workingDbConfiguration -->
@@ -99,13 +99,16 @@
class="fr.ifremer.echobase.ui.actions.workingDb.Connect">
<interceptor-ref name="prepareParamsStackLoggued"/>
<result name="input" type="showList"/>
- <result type="redirectToHome"/>
+ <result type="redirectAction">
+ <param name="actionName">information</param>
+ <param name="namespace">/workingDb</param>
+ </result>
</action>
<!-- Disconnect from current workingDbConfiguration -->
<action name="disconnect"
class="fr.ifremer.echobase.ui.actions.workingDb.Disconnect">
- <result type="showList"/>
+ <result type="redirectToShowList"/>
</action>
<!-- Get db modifications -->
@@ -114,6 +117,16 @@
<result>/WEB-INF/jsp/workingDb/modifications.jsp</result>
</action>
+ <!-- Download jdbc pilot driver application archive -->
+ <action name="downloadDriver"
+ class="fr.ifremer.echobase.ui.actions.workingDb.DownloadDriver">
+ <result type="stream">
+ <param name="contentType">${contentType}</param>
+ <param name="contentLength">${contentLength}</param>
+ <param name="contentDisposition">filename="${fileName}"</param>
+ </result>
+ </action>
+
</package>
</struts>
Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties
===================================================================
--- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties 2012-09-03 15:32:42 UTC (rev 605)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties 2012-09-03 19:23:14 UTC (rev 606)
@@ -34,8 +34,9 @@
echobase.action.toFrench=Use the french version
echobase.action.usingEnglish=English version used
echobase.action.usingFrench=French version used
-echobase.action.workingDbconfiguration.connect=
-echobase.action.workingDbconfiguration.disconnect=
+echobase.action.workingDbconfiguration.connect=Connect
+echobase.action.workingDbconfiguration.disconnect=Disconnect
+echobase.action.workingDbconfiguration.downloadDriver=Télécharger le pilote jdbc
echobase.common.acousticDensityUnit=
echobase.common.acquisitionSoftwareVersionER60=
echobase.common.acquisitionSoftwareVersionME70=
@@ -83,7 +84,6 @@
echobase.common.jdbcDriver=Jdbc Driver name
echobase.common.jdbcLogin=
echobase.common.jdbcPassword=
-echobase.common.jdbcPilotPath=Path to jdbc pilot
echobase.common.jdbcUrl=
echobase.common.keywords=
echobase.common.lastModifiedDate=
@@ -105,6 +105,7 @@
echobase.common.organisationLevelAcknowledgements=
echobase.common.organisationReferences=
echobase.common.password=
+echobase.common.pilotVersion=Jdbc pilot version
echobase.common.pingDutyCycle=
echobase.common.platform=
echobase.common.principalInvestigator=
Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
===================================================================
--- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-09-03 15:32:42 UTC (rev 605)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-09-03 19:23:14 UTC (rev 606)
@@ -36,6 +36,7 @@
echobase.action.usingFrench=Version française utilisé
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=acousticDensityUnit
echobase.common.acquisitionSoftwareVersionER60=acquisitionSoftwareVersion (ER60 instrument)
echobase.common.acquisitionSoftwareVersionME70=acquisitionSoftwareVersion (ME70 instrument)
@@ -83,7 +84,6 @@
echobase.common.jdbcDriver=Nom du pilote jdbc
echobase.common.jdbcLogin=Login de connexion
echobase.common.jdbcPassword=Mot de passe
-echobase.common.jdbcPilotPath=Chemin du pilote jdbc
echobase.common.jdbcUrl=Url de connexion
echobase.common.keywords=
echobase.common.lastModifiedDate=
@@ -105,6 +105,7 @@
echobase.common.organisationLevelAcknowledgements=
echobase.common.organisationReferences=
echobase.common.password=Mot de passe
+echobase.common.pilotVersion=Version du pilote jdbc
echobase.common.pingDutyCycle=pingDutyCycle
echobase.common.platform=
echobase.common.principalInvestigator=
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp 2012-09-03 15:32:42 UTC (rev 605)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp 2012-09-03 19:23:14 UTC (rev 606)
@@ -126,20 +126,20 @@
</span>
</s:a>
</li>
+ <li>
+ <s:a action="configure" namespace="/embeddedApplication"
+ method="input" cssClass="appli">
+ <span>
+ <s:text name="echobase.menu.createEmbeddedApplication"/>
+ </span>
+ </s:a>
+ </li>
</s:if>
<li>
<s:a action="userList" namespace="/user" cssClass="user">
<span><s:text name="echobase.menu.users"/></span>
</s:a>
</li>
- <li>
- <s:a action="configure" namespace="/embeddedApplication"
- method="input" cssClass="appli">
- <span>
- <s:text name="echobase.menu.createEmbeddedApplication"/>
- </span>
- </s:a>
- </li>
</s:if>
<s:else>
<s:if test="%{workingDbSelected}">
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 2012-09-03 15:32:42 UTC (rev 605)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/information.jsp 2012-09-03 19:23:14 UTC (rev 606)
@@ -23,8 +23,35 @@
<%@page contentType="text/html" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %>
+<%--<style type="text/css">--%>
+<%--label { background-color: white; color: black; }--%>
+<%--</style>--%>
+<script type="text/javascript">
+
+ $(document).ready(function () {
+
+ $('label[id^="dbConfiguration"]').css({'background-color':'white', 'color':'black', 'padding-right':'2px', 'padding-left':'2px' }).click(function () {
+ var el = $(this)[0];
+ if (/textarea/i.test(el.tagName) || (/input/i.test(el.tagName) && /text/i.test(el.type))) {
+ el.select();
+ } else if (!!window.getSelection) { // FF, Safari, Chrome, Opera
+ var sel = window.getSelection();
+ var range = document.createRange();
+ range.selectNodeContents(el);
+ sel.removeAllRanges();
+ sel.addRange(range);
+ } else if (!!document.selection) { // IE
+ document.selection.empty();
+ var range = document.body.createTextRange();
+ range.moveToElementText(el);
+ range.select();
+ }
+ });
+
+ });
+
+</script>
<title><s:text name="echobase.title.connectToDbInformations"/></title>
<br/>
@@ -38,9 +65,28 @@
label='%{getText("echobase.common.jdbcPassword")}'/>
<s:label key="dbConfiguration.driverType.driverClass.name"
label='%{getText("echobase.common.jdbcDriver")}'/>
- <s:label key="jdbcPilot"
- label='%{getText("echobase.common.jdbcPilotPath")}'/>
+ <s:label key="pilotVersion" id='dbConfiguration_pilotVersion'
+ label='%{getText("echobase.common.pilotVersion")}'/>
</fieldset>
+<br/>
+<s:form id="createForm" namespace="/workingDb">
+ <ul class="toolbar floatLeft">
+ <li>
+ <s:submit theme="simple" action="downloadDriver"
+ key="echobase.action.workingDbconfiguration.downloadDriver"/>
+ </li>
+ <li>
+ <s:submit theme="simple" action="disconnect"
+ key="echobase.action.workingDbconfiguration.disconnect"/>
+ </li>
+ </ul>
+</s:form>
+<%--<s:a namespace="/workingDb" action="downloadDriver">--%>
+<%--<s:text name="echobase.action.workingDb.downloadDriver"/>--%>
+<%--</s:a>--%>
+
+
+
1
0
Author: mdoray
Date: 2012-09-03 17:32:42 +0200 (Mon, 03 Sep 2012)
New Revision: 605
Url: http://forge.codelutin.com/repositories/revision/echobase/605
Log:
>From scmwebeditor --
Modified:
trunk/src/site/en/rst/index.rst
Modified: trunk/src/site/en/rst/index.rst
===================================================================
--- trunk/src/site/en/rst/index.rst 2012-09-03 15:22:38 UTC (rev 604)
+++ trunk/src/site/en/rst/index.rst 2012-09-03 15:32:42 UTC (rev 605)
@@ -33,23 +33,27 @@
and computing acoustic indicators for survey-based ecosystem monitoring. It comprises a postgreSQL
database designed to store acoustic, navigation and fishing data from ecosystemic surveys (Echobase)
and a suite of R codes (EchoR) for computing fish population indicators based on Echobase data.
-This site describes the Echobase database. If you are interested in geoR, see <forge.ifremer.fr/www/echor/>
+This site describes the Echobase database. If you are interested in geoR, please visit the `Ifremer forge`_..
Echobase provide a web-browser interface for importing, editing and querying data,
large storage capacities, and an easy integration into Geographical Information Systems or dynamic websites.
-The Echobase acoustic metadata format follows the ICES WGFAST <http://www.acoustics.washington.edu/FAST/> Topic Group on metadata standards recommendations.
+The Echobase acoustic metadata format follows the `ICES WGFAST`_.Topic Group on metadata standards recommendations.
-Les documents
+
+.. _echoR: <forge.ifremer.fr/www/echor/>
+.. _WGFAST: <http://www.acoustics.washington.edu/FAST/>
+
+Documentation
-------------
-- La documentation d'`installation`_.
+- How to `install`_. Echobase.
-- La description du `modèle`_.
+- The Echobase `model`_..
-- La description des `imports`_.
+- How to `import data`_. in Echobase.
-- Comment créer une `application embarquée`_.
+- How to create a `local Echobase database`_..
.. _installation: ./install.html
.. _modèle: ./model.html
1
0
Author: mdoray
Date: 2012-09-03 17:22:38 +0200 (Mon, 03 Sep 2012)
New Revision: 604
Url: http://forge.codelutin.com/repositories/revision/echobase/604
Log:
>From scmwebeditor --
Modified:
trunk/src/site/en/rst/index.rst
Modified: trunk/src/site/en/rst/index.rst
===================================================================
--- trunk/src/site/en/rst/index.rst 2012-09-03 15:16:40 UTC (rev 603)
+++ trunk/src/site/en/rst/index.rst 2012-09-03 15:22:38 UTC (rev 604)
@@ -26,12 +26,19 @@
Echobase
========
-Présentation
+Presentation
------------
-We have designed an open software suite for storing fisheries acoustic data
-and computing acoustic indicators for survey-based ecosystem monitoring. It comprises a postgreSQL database designed to store acoustic, navigation and fishing data from ecosystemic surveys (Echobase) and a suite of R codes (EchoR) for computing fish population indicators based on Echobase data. Echobase provide a web-browser interface for importing, editing and querying data, large storage capacities, and an easy integration into Geographical Information Systems or dynamic websites. The Echobase acoustic metadata format follows the WGFAST Topic Group on metadata standards recommendations.
+the French Institute for the Exploitation of the Sea (Ifremer) has designed an open software suite for storing fisheries acoustic data
+and computing acoustic indicators for survey-based ecosystem monitoring. It comprises a postgreSQL
+database designed to store acoustic, navigation and fishing data from ecosystemic surveys (Echobase)
+and a suite of R codes (EchoR) for computing fish population indicators based on Echobase data.
+This site describes the Echobase database. If you are interested in geoR, see <forge.ifremer.fr/www/echor/>
+Echobase provide a web-browser interface for importing, editing and querying data,
+large storage capacities, and an easy integration into Geographical Information Systems or dynamic websites.
+The Echobase acoustic metadata format follows the ICES WGFAST <http://www.acoustics.washington.edu/FAST/> Topic Group on metadata standards recommendations.
+
Les documents
-------------
1
0
Author: mdoray
Date: 2012-09-03 17:16:40 +0200 (Mon, 03 Sep 2012)
New Revision: 603
Url: http://forge.codelutin.com/repositories/revision/echobase/603
Log:
>From scmwebeditor --
Modified:
trunk/src/site/en/rst/index.rst
Modified: trunk/src/site/en/rst/index.rst
===================================================================
--- trunk/src/site/en/rst/index.rst 2012-09-03 14:54:12 UTC (rev 602)
+++ trunk/src/site/en/rst/index.rst 2012-09-03 15:16:40 UTC (rev 603)
@@ -29,8 +29,8 @@
Présentation
------------
-A Faire...
-*TODO Translate this in english*
+We have designed an open software suite for storing fisheries acoustic data
+and computing acoustic indicators for survey-based ecosystem monitoring. It comprises a postgreSQL database designed to store acoustic, navigation and fishing data from ecosystemic surveys (Echobase) and a suite of R codes (EchoR) for computing fish population indicators based on Echobase data. Echobase provide a web-browser interface for importing, editing and querying data, large storage capacities, and an easy integration into Geographical Information Systems or dynamic websites. The Echobase acoustic metadata format follows the WGFAST Topic Group on metadata standards recommendations.
Les documents
-------------
1
0
r602 - in trunk: echobase-domain/src/main/java/fr/ifremer/echobase/services echobase-services/src/main/java/fr/ifremer/echobase/services/embeddedapplication echobase-ui/src/main/java/fr/ifremer/echobase/ui
by tchemit@users.forge.codelutin.com 03 Sep '12
by tchemit@users.forge.codelutin.com 03 Sep '12
03 Sep '12
Author: tchemit
Date: 2012-09-03 16:54:12 +0200 (Mon, 03 Sep 2012)
New Revision: 602
Url: http://forge.codelutin.com/repositories/revision/echobase/602
Log:
fixes #1453: Jdbc drivers in embedded applications are corrupted
refs #1438: Choix d'une base de travail (creation application embarquee)
Modified:
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/services/DefaultEchoBaseServiceContext.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/embeddedapplication/EmbeddedApplicationService.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java
Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/services/DefaultEchoBaseServiceContext.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/services/DefaultEchoBaseServiceContext.java 2012-09-03 14:46:19 UTC (rev 601)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/services/DefaultEchoBaseServiceContext.java 2012-09-03 14:54:12 UTC (rev 602)
@@ -56,18 +56,6 @@
protected EchoBaseDbMeta dbMeta;
public static EchoBaseServiceContext newContext(
- EchoBaseServiceContext serviceContext,
- TopiaContext internalTransaction,
- TopiaContext transaction) {
- return newContext(serviceContext.getLocale(),
- internalTransaction,
- transaction,
- serviceContext.getConfiguration(),
- serviceContext.getDbMeta()
- );
- }
-
- public static EchoBaseServiceContext newContext(
Locale locale,
TopiaContext internalTransaction,
TopiaContext transaction,
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/embeddedapplication/EmbeddedApplicationService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/embeddedapplication/EmbeddedApplicationService.java 2012-09-03 14:46:19 UTC (rev 601)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/embeddedapplication/EmbeddedApplicationService.java 2012-09-03 14:54:12 UTC (rev 602)
@@ -58,6 +58,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.URISyntaxException;
import java.util.List;
@@ -107,9 +108,12 @@
// create new service context
EchoBaseServiceContext newServiceContext =
- DefaultEchoBaseServiceContext.newContext(serviceContext,
- null,
- null);
+ DefaultEchoBaseServiceContext.newContext(
+ getLocale(),
+ null,
+ null,
+ getConfiguration(),
+ getDbMeta());
EchoBaseUser admin;
try {
@@ -120,23 +124,13 @@
}
// create working db in /db
- JdbcConfiguration dbConf = JdbcConfiguration.newEmbeddedConfig(dir);
- TopiaContext rootContext = EchobaseTopiaContexts.newWorkingDb(dbConf);
try {
+ importWorkingDb(model, dir, exportZipFile, newServiceContext, admin);
- newServiceContext.setTransaction(rootContext.beginTransaction());
- model.incrementsProgression();
+ } catch (Exception eee) {
- importDb(model, newServiceContext, exportZipFile, admin);
-
- } catch (Exception eee) {
- rollbackTransaction(
- newServiceContext.getTransaction(),
- "Could not rollback h2 embedded database at " + dir);
throw new EchoBaseTechnicalException(
- "Could not create h2 embedded database at " + dir, eee);
- } finally {
- EchoBaseEntityHelper.releaseRootContext(rootContext);
+ "Could not create h2 working database at " + dir, eee);
}
try {
@@ -225,8 +219,43 @@
newServiceContext.setInternalTransaction(null);
EchoBaseEntityHelper.releaseRootContext(internalRootContext);
}
+ }
+ protected void importWorkingDb(EmbeddedApplicationConfiguration model,
+ File dir,
+ File exportZipFile,
+ EchoBaseServiceContext newServiceContext,
+ EchoBaseUser admin) throws IOException, TopiaException {
+ JdbcConfiguration dbConf = JdbcConfiguration.newEmbeddedConfig(dir);
+ TopiaContext rootContext = EchobaseTopiaContexts.newWorkingDb(dbConf);
+ try {
+ // create db schema
+ rootContext.createSchema();
+
+ // inject a new transaction in service context
+ newServiceContext.setTransaction(rootContext.beginTransaction());
+
+ model.incrementsProgression();
+
+ // prepare import configuration
+ ImportDbConfiguration importConfiguration =
+ new ImportDbConfiguration(model, getLocale());
+ importConfiguration.getInput().setFile(exportZipFile);
+ File importTempDir = new File(model.getWorkingDirectory(), "importDb");
+ importConfiguration.setWorkingDirectory(importTempDir);
+
+ // do import to embedded working db
+ newServiceContext.getService(ImportDbService.class).importDb(
+ importConfiguration, admin, false, true);
+
+ } finally {
+ // remove current transaction
+ newServiceContext.setTransaction(null);
+
+ // release any connexion to the working db
+ EchoBaseEntityHelper.releaseRootContext(rootContext);
+ }
}
protected void closeContext(TopiaContext tx, String message) {
@@ -388,19 +417,44 @@
}
}
- protected void importDb(EmbeddedApplicationConfiguration model,
- EchoBaseServiceContext newServiceContext,
- File exportZipFile,
- EchoBaseUser admin) throws IOException, TopiaException {
- ImportDbConfiguration importConfiguration =
- new ImportDbConfiguration(model, getLocale());
- importConfiguration.getInput().setFile(exportZipFile);
- File importTempDir = new File(model.getWorkingDirectory(), "importDb");
- importConfiguration.setWorkingDirectory(importTempDir);
-
- ImportDbService importDbService =
- newServiceContext.getService(ImportDbService.class);
- importDbService.importDb(importConfiguration, admin, false, true);
+ public void copyEmbeddedBinaryFile(String resourceName,
+ File targetDirectory) throws IOException {
+ String resourcePath = EMBEDDED_PATH + resourceName;
+ InputStream inputStream = getClass().getResourceAsStream(resourcePath);
+ Preconditions.checkNotNull(inputStream,
+ "could not find resource " + resourcePath);
+ try {
+ File outputFile = new File(targetDirectory, resourceName);
+ if (log.isInfoEnabled()) {
+ log.info("Copy binary file from " + resourceName + " to " +
+ outputFile);
+ }
+ OutputStream outputStream = new FileOutputStream(outputFile);
+ try {
+ IOUtils.copy(inputStream, outputStream);
+ outputStream.close();
+ } finally {
+ IOUtils.closeQuietly(outputStream);
+ }
+ inputStream.close();
+ } finally {
+ IOUtils.closeQuietly(inputStream);
+ }
}
+// protected void importDb(EmbeddedApplicationConfiguration model,
+// EchoBaseServiceContext newServiceContext,
+// File exportZipFile,
+// EchoBaseUser admin) throws IOException, TopiaException {
+// ImportDbConfiguration importConfiguration =
+// new ImportDbConfiguration(model, getLocale());
+// importConfiguration.getInput().setFile(exportZipFile);
+// File importTempDir = new File(model.getWorkingDirectory(), "importDb");
+// importConfiguration.setWorkingDirectory(importTempDir);
+//
+// ImportDbService importDbService =
+// newServiceContext.getService(ImportDbService.class);
+// importDbService.importDb(importConfiguration, admin, false, true);
+// }
+
}
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java 2012-09-03 14:46:19 UTC (rev 601)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java 2012-09-03 14:54:12 UTC (rev 602)
@@ -249,8 +249,7 @@
log.info("Copy driver " + pilotFileName +
" to directory " + libDirectory);
}
- service.copyEmbeddedFiles(
- pilotFileName, libDirectory, null);
+ service.copyEmbeddedBinaryFile(pilotFileName, libDirectory);
}
}
}
1
0
r601 - in trunk/echobase-domain/src: main/java/fr/ifremer/echobase test/java/fr/ifremer/echobase
by tchemit@users.forge.codelutin.com 03 Sep '12
by tchemit@users.forge.codelutin.com 03 Sep '12
03 Sep '12
Author: tchemit
Date: 2012-09-03 16:46:19 +0200 (Mon, 03 Sep 2012)
New Revision: 601
Url: http://forge.codelutin.com/repositories/revision/echobase/601
Log:
fix not well siolated test
Modified:
trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseDateConverter.java
trunk/echobase-domain/src/test/java/fr/ifremer/echobase/EchoBaseDateConverterTest.java
Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseDateConverter.java
===================================================================
--- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseDateConverter.java 2012-09-03 13:14:15 UTC (rev 600)
+++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseDateConverter.java 2012-09-03 14:46:19 UTC (rev 601)
@@ -40,12 +40,16 @@
*/
public class EchoBaseDateConverter extends DateTimeConverter {
- public static void initDateConverter() {
+ public static Converter initDateConverter() {
Converter converter = ConverterUtil.getConverter(Date.class);
if (converter != null && !(converter instanceof EchoBaseDateConverter)) {
ConvertUtils.deregister(Date.class);
ConvertUtils.register(new EchoBaseDateConverter(), Date.class);
+
+ } else {
+ converter = null;
}
+ return converter;
}
protected final DateFormat format =
Modified: trunk/echobase-domain/src/test/java/fr/ifremer/echobase/EchoBaseDateConverterTest.java
===================================================================
--- trunk/echobase-domain/src/test/java/fr/ifremer/echobase/EchoBaseDateConverterTest.java 2012-09-03 13:14:15 UTC (rev 600)
+++ trunk/echobase-domain/src/test/java/fr/ifremer/echobase/EchoBaseDateConverterTest.java 2012-09-03 14:46:19 UTC (rev 601)
@@ -26,7 +26,8 @@
import fr.ifremer.echobase.entities.EntityModificationLogImpl;
import junit.framework.Assert;
import org.apache.commons.beanutils.BeanUtils;
-import org.apache.commons.beanutils.ConversionException;
+import org.apache.commons.beanutils.ConvertUtils;
+import org.apache.commons.beanutils.Converter;
import org.junit.Test;
import java.util.Calendar;
@@ -49,22 +50,31 @@
assertDate(date);
}
- @Test(expected = ConversionException.class)
- public void testConvertFromDefaultBeanUtilsConverter() throws Exception {
+ // This test is not isolated and can failed... In fact we just need to
+ // make sure next test is ok, not this one...
+// @Test(expected = ConversionException.class)
+// public void testConvertFromDefaultBeanUtilsConverter() throws Exception {
+//
+// BeanUtils.setProperty(
+// new EntityModificationLogImpl(),
+// EntityModificationLog.PROPERTY_MODIFICATION_DATE, DATE);
+// }
- EntityModificationLog bean = new EntityModificationLogImpl();
- BeanUtils.setProperty(bean, EntityModificationLog.PROPERTY_MODIFICATION_DATE, DATE);
-
- }
-
@Test
public void testConvertFromBeanUtilsConverterWithOur() throws Exception {
- EchoBaseDateConverter.initDateConverter();
- EntityModificationLog bean = new EntityModificationLogImpl();
- BeanUtils.setProperty(bean, EntityModificationLog.PROPERTY_MODIFICATION_DATE, DATE);
- Date date = bean.getModificationDate();
- assertDate(date);
+ Converter oldDateConverter = EchoBaseDateConverter.initDateConverter();
+ try {
+ EntityModificationLog bean = new EntityModificationLogImpl();
+ BeanUtils.setProperty(bean, EntityModificationLog.PROPERTY_MODIFICATION_DATE, DATE);
+ Date date = bean.getModificationDate();
+ assertDate(date);
+ } finally {
+ if (oldDateConverter != null) {
+ ConvertUtils.deregister(Date.class);
+ ConvertUtils.register(oldDateConverter, Date.class);
+ }
+ }
}
private void assertDate(Object date) {
1
0
r600 - in trunk/echobase-ui/src/main: resources/config webapp/WEB-INF/includes webapp/WEB-INF/jsp/workingDb
by tchemit@users.forge.codelutin.com 03 Sep '12
by tchemit@users.forge.codelutin.com 03 Sep '12
03 Sep '12
Author: tchemit
Date: 2012-09-03 15:14:15 +0200 (Mon, 03 Sep 2012)
New Revision: 600
Url: http://forge.codelutin.com/repositories/revision/echobase/600
Log:
change modificationLog action to workingDb package
Added:
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/modifications.jsp
Removed:
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/modificationLogs.jsp
Modified:
trunk/echobase-ui/src/main/resources/config/struts-user.xml
trunk/echobase-ui/src/main/resources/config/struts-workingDb.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp
Modified: trunk/echobase-ui/src/main/resources/config/struts-user.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/config/struts-user.xml 2012-09-03 12:58:06 UTC (rev 599)
+++ trunk/echobase-ui/src/main/resources/config/struts-user.xml 2012-09-03 13:14:15 UTC (rev 600)
@@ -65,12 +65,8 @@
<result>/WEB-INF/jsp/user/userList.jsp</result>
</action>
- <!-- Get db modifications -->
- <action name="logs"
- class="fr.ifremer.echobase.ui.actions.EchoBaseActionSupport">
- <result>/WEB-INF/jsp/modificationLogs.jsp</result>
- </action>
+
<!-- Get list of users in database -->
<action name="getUsers"
class="fr.ifremer.echobase.ui.actions.user.GetUsers">
Modified: trunk/echobase-ui/src/main/resources/config/struts-workingDb.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/config/struts-workingDb.xml 2012-09-03 12:58:06 UTC (rev 599)
+++ trunk/echobase-ui/src/main/resources/config/struts-workingDb.xml 2012-09-03 13:14:15 UTC (rev 600)
@@ -108,6 +108,12 @@
<result type="showList"/>
</action>
+ <!-- Get db modifications -->
+ <action name="logs"
+ class="fr.ifremer.echobase.ui.actions.EchoBaseActionSupport">
+ <result>/WEB-INF/jsp/workingDb/modifications.jsp</result>
+ </action>
+
</package>
</struts>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp 2012-09-03 12:58:06 UTC (rev 599)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp 2012-09-03 13:14:15 UTC (rev 600)
@@ -115,7 +115,7 @@
</s:a>
</li>
<li>
- <s:a action="logs" namespace="/user" cssClass="journal">
+ <s:a action="logs" namespace="/workingDb" cssClass="journal">
<span><s:text name="echobase.menu.logs"/></span>
</s:a>
</li>
@@ -155,7 +155,7 @@
</s:a>
</li>
<li>
- <s:a action="logs" namespace="/user" cssClass="journal">
+ <s:a action="logs" namespace="/workingDb" cssClass="journal">
<span><s:text name="echobase.menu.logs"/></span>
</s:a>
</li>
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/modificationLogs.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/modificationLogs.jsp 2012-09-03 12:58:06 UTC (rev 599)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/modificationLogs.jsp 2012-09-03 13:14:15 UTC (rev 600)
@@ -1,93 +0,0 @@
-<%--
-#%L
- EchoBase :: UI
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
---%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %>
-<script type="text/javascript"
- src="<s:url value='/js/gridHelper.js' />"></script>
-<s:set var="emptySelection">
- <s:text name="echobase.message.noEntrySelection"/>
-</s:set>
-<script type="text/javascript">
-
- jQuery(document).ready(function () {
- $.addRowSelectTopic('datas', function (event) {
- $('#extraInfos').show();
- var id = $("tr[aria-selected=true] td[aria-describedby='datas_entityId']").text();
- $('#modificationEntityId').html(id);
-
- var text = $("tr[aria-selected=true] td[aria-describedby='datas_modificationText']").text();
- $('#modificationTextContainter').html(text);
- });
- $.addClearSelectTopic('datas', function (event) {
- $('#extraInfos').hide();
- $('#modificationTextContainter').html("${emptySelection}");
- });
- $.addEvenAndOddClasses('datas');
- });
-</script>
-
-<title><s:text name="echobase.title.entityModificationLogs"/></title>
-<s:url id="loadUrl" action="getEntityModificationLogs" namespace="/user"
- escapeAmp="false"/>
-
-<sjg:grid id="datas" dataType="json" href="%{loadUrl}" gridModel="datas"
- pager="true" pagerButtons="true" pagerInput="true" navigator="true"
- autowidth="true" rownumbers="false" viewrecords="true"
- navigatorEdit="false" navigatorSearch="true"
- navigatorDelete="false" navigatorAdd="false"
- rowList="10,15,20,50,100,250,500" rowNum="10"
- onSelectRowTopics='datas-rowSelect'
- onCompleteTopics="datas-clearSelect,datas-CompleteTopics"
- navigatorSearchOptions="{multipleGroup:false,multipleSearch:false,sopt:['eq','ne','cn','nc','bw','bn','ew','en','lt','le','gt','ge','nu','nn']}">
-
- <sjg:gridColumn name="entityType" sortable="true"
- title="%{getText('echobase.common.entityType')}"/>
- <sjg:gridColumn name="entityId" sortable="true"
- title="%{getText('echobase.common.entityId')}"/>
- <sjg:gridColumn name="modificationDate" sortable="true"
- title="%{getText('echobase.common.modificationDate')}"/>
- <sjg:gridColumn name="modificationText" sortable="true"
- title="%{getText('echobase.common.modificationText')}"/>
- <sjg:gridColumn name="modificationUser" sortable="true"
- title="%{getText('echobase.common.modificationUser')}"/>
-
-</sjg:grid>
-<br/>
-<fieldset>
- <legend><s:text name="echobase.title.modification.detail"/></legend>
- <div id="extraInfos">
- <s:label key='echobase.common.entityId' value=''/>
- <div class="clearBoth"/>
- <pre id='modificationEntityId' style="font-weight: bold;"></pre>
- <br/>
- </div>
- <s:label key='echobase.common.modificationText' value=''/>
- <div class="clearBoth"/>
- <br/>
- <pre id='modificationTextContainter' style="font-weight: bold;"></pre>
-</fieldset>
-
-
-
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/modifications.jsp (from rev 598, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/modificationLogs.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/modifications.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/modifications.jsp 2012-09-03 13:14:15 UTC (rev 600)
@@ -0,0 +1,93 @@
+<%--
+#%L
+ EchoBase :: UI
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+--%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %>
+<script type="text/javascript"
+ src="<s:url value='/js/gridHelper.js' />"></script>
+<s:set var="emptySelection">
+ <s:text name="echobase.message.noEntrySelection"/>
+</s:set>
+<script type="text/javascript">
+
+ jQuery(document).ready(function () {
+ $.addRowSelectTopic('datas', function (event) {
+ $('#extraInfos').show();
+ var id = $("tr[aria-selected=true] td[aria-describedby='datas_entityId']").text();
+ $('#modificationEntityId').html(id);
+
+ var text = $("tr[aria-selected=true] td[aria-describedby='datas_modificationText']").text();
+ $('#modificationTextContainter').html(text);
+ });
+ $.addClearSelectTopic('datas', function (event) {
+ $('#extraInfos').hide();
+ $('#modificationTextContainter').html("${emptySelection}");
+ });
+ $.addEvenAndOddClasses('datas');
+ });
+</script>
+
+<title><s:text name="echobase.title.entityModificationLogs"/></title>
+<s:url id="loadUrl" action="getEntityModificationLogs" namespace="/user"
+ escapeAmp="false"/>
+
+<sjg:grid id="datas" dataType="json" href="%{loadUrl}" gridModel="datas"
+ pager="true" pagerButtons="true" pagerInput="true" navigator="true"
+ autowidth="true" rownumbers="false" viewrecords="true"
+ navigatorEdit="false" navigatorSearch="true"
+ navigatorDelete="false" navigatorAdd="false"
+ rowList="10,15,20,50,100,250,500" rowNum="10"
+ onSelectRowTopics='datas-rowSelect'
+ onCompleteTopics="datas-clearSelect,datas-CompleteTopics"
+ navigatorSearchOptions="{multipleGroup:false,multipleSearch:false,sopt:['eq','ne','cn','nc','bw','bn','ew','en','lt','le','gt','ge','nu','nn']}">
+
+ <sjg:gridColumn name="entityType" sortable="true"
+ title="%{getText('echobase.common.entityType')}"/>
+ <sjg:gridColumn name="entityId" sortable="true"
+ title="%{getText('echobase.common.entityId')}"/>
+ <sjg:gridColumn name="modificationDate" sortable="true"
+ title="%{getText('echobase.common.modificationDate')}"/>
+ <sjg:gridColumn name="modificationText" sortable="true"
+ title="%{getText('echobase.common.modificationText')}"/>
+ <sjg:gridColumn name="modificationUser" sortable="true"
+ title="%{getText('echobase.common.modificationUser')}"/>
+
+</sjg:grid>
+<br/>
+<fieldset>
+ <legend><s:text name="echobase.title.modification.detail"/></legend>
+ <div id="extraInfos">
+ <s:label key='echobase.common.entityId' value=''/>
+ <div class="clearBoth"/>
+ <pre id='modificationEntityId' style="font-weight: bold;"></pre>
+ <br/>
+ </div>
+ <s:label key='echobase.common.modificationText' value=''/>
+ <div class="clearBoth"/>
+ <br/>
+ <pre id='modificationTextContainter' style="font-weight: bold;"></pre>
+</fieldset>
+
+
+
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/workingDb/modifications.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0