Topia-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
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
September 2009
- 3 participants
- 13 discussions
r1637 - in trunk/topia-service-migration/src/main: java/org/nuiton/topia/migration resources/i18n
by tchemit@users.nuiton.org 03 Sep '09
by tchemit@users.nuiton.org 03 Sep '09
03 Sep '09
Author: tchemit
Date: 2009-09-03 22:14:19 +0200 (Thu, 03 Sep 2009)
New Revision: 1637
Modified:
trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/ManualMigrationCallback.java
trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/ManualMigrationEngine.java
trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-en_GB.properties
trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-fr_FR.properties
Log:
update i18n
Modified: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/ManualMigrationCallback.java
===================================================================
--- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/ManualMigrationCallback.java 2009-09-03 19:37:29 UTC (rev 1636)
+++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/ManualMigrationCallback.java 2009-09-03 20:14:19 UTC (rev 1637)
@@ -31,6 +31,7 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaContextImplementor;
import org.nuiton.util.Version;
+import static org.nuiton.i18n.I18n._;
/**
* ManualMigrationCallback
@@ -80,8 +81,6 @@
*/
public MigrationChoice doMigration(TopiaContext ctxt, Version dbVersion, Version applicationVersion, List<Version> versions) {
- log.info(versions);
-
MigrationChoice result = MigrationChoice.NO_MIGRATION;
boolean doMigrate = askUser(dbVersion, applicationVersion, versions);
@@ -102,7 +101,7 @@
Method m = getClass().getMethod(methodName, TopiaContextImplementor.class);
m.setAccessible(true);
- log.info("start migration of version " + v);
+ log.info(_("topia.migration.start.migrate" ,v));
if (log.isDebugEnabled()) {
log.debug("launch method " + methodName);
@@ -145,7 +144,9 @@
log.info(sql);
PreparedStatement sta = connection.prepareStatement(sql);
sta.executeUpdate();
- log.debug("done " + sql);
+ if(log.isDebugEnabled()) {
+ log.debug("done " + sql);
+ }
sta.close();
}
}
Modified: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/ManualMigrationEngine.java
===================================================================
--- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/ManualMigrationEngine.java 2009-09-03 19:37:29 UTC (rev 1636)
+++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/ManualMigrationEngine.java 2009-09-03 20:14:19 UTC (rev 1637)
@@ -379,7 +379,7 @@
public void saveVersion(Version version) {
checkInit();
- if (!migrateOnInit || dbVersion == null) {
+ if (dbVersion == null) {
detectDbVersion();
}
Modified: trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-en_GB.properties
===================================================================
--- trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-en_GB.properties 2009-09-03 19:37:29 UTC (rev 1636)
+++ trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-en_GB.properties 2009-09-03 20:14:19 UTC (rev 1637)
@@ -6,4 +6,5 @@
topia.migration.saving.db.version=Saving new database version \: %1$s
topia.migration.skip.migration.db.is.up.to.date=Database is up to date, no migration needed.
topia.migration.skip.migration.no.version.to.apply=No version to apply, no migration needed.
+topia.migration.start.migrate=Start migration to version %1$s
topia.migration.start.migration=Starting Topia Migration Service - Application version \: %1$s, Database version \: %2$s
Modified: trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-fr_FR.properties
===================================================================
--- trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-fr_FR.properties 2009-09-03 19:37:29 UTC (rev 1636)
+++ trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-fr_FR.properties 2009-09-03 20:14:19 UTC (rev 1637)
@@ -6,4 +6,5 @@
topia.migration.saving.db.version=Sauvegarde de la nouvelle version de la base \: %1$s
topia.migration.skip.migration.db.is.up.to.date=La base est \u00E0 jour, aucune migration n\u00E9cessaire.
topia.migration.skip.migration.no.version.to.apply=Aucune version \u00E0 appliquer, aucune migration n\u00E9cessaire.
+topia.migration.start.migrate=D\u00E9marrage de la mise \u00E0 jour vers la version %1$s
topia.migration.start.migration=D\u00E9marrage du service de mise \u00E0 jour - version de l'application \: %1$s, version de la base \: %2$s
1
0
Author: tchemit
Date: 2009-09-03 21:37:29 +0200 (Thu, 03 Sep 2009)
New Revision: 1636
Modified:
trunk/topia-service-migration/pom.xml
Log:
[FEATURE #42] add i18n in migration service
Modified: trunk/topia-service-migration/pom.xml
===================================================================
--- trunk/topia-service-migration/pom.xml 2009-09-03 19:03:29 UTC (rev 1635)
+++ trunk/topia-service-migration/pom.xml 2009-09-03 19:37:29 UTC (rev 1636)
@@ -86,6 +86,7 @@
<directory>${maven.src.dir}/main/resources</directory>
<includes>
<include>**/*.hbm.xml</include>
+ <include>**/*.properties</include>
</includes>
</resource>
1
0
r1635 - in trunk: . topia-service-migration topia-service-migration/src/main/java/org/nuiton/topia/migration topia-service-migration/src/main/resources topia-service-migration/src/main/resources/i18n topia-service-migration/src/main/resources/org/nuiton/topia/migration/mappings
by tchemit@users.nuiton.org 03 Sep '09
by tchemit@users.nuiton.org 03 Sep '09
03 Sep '09
Author: tchemit
Date: 2009-09-03 21:03:29 +0200 (Thu, 03 Sep 2009)
New Revision: 1635
Added:
trunk/topia-service-migration/src/main/resources/i18n/
trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-en_GB.properties
trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-fr_FR.properties
Modified:
trunk/pom.xml
trunk/topia-service-migration/changelog.txt
trunk/topia-service-migration/pom.xml
trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/ManualMigrationEngine.java
trunk/topia-service-migration/src/main/resources/org/nuiton/topia/migration/mappings/TMSVersion.hbm.xml
Log:
[FIX #38] manual migration service does not work on windows OS
[FEATURE #40] clean manual migration service
[FEATURE #42] add i18n in migration service
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-08-28 14:56:14 UTC (rev 1634)
+++ trunk/pom.xml 2009-09-03 19:03:29 UTC (rev 1635)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom</artifactId>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>topia</artifactId>
@@ -194,9 +194,9 @@
<!-- libs version -->
<eugene.version>1.0.0</eugene.version>
- <lutinutil.version>1.1.0</lutinutil.version>
+ <lutinutil.version>1.1.1</lutinutil.version>
<processor.version>1.0.0</processor.version>
- <i18n.version>1.0.1-SNAPSHOT</i18n.version>
+ <i18n.version>1.0.1</i18n.version>
<xmlrpc.version>3.1.2</xmlrpc.version>
<hibernate.version>3.3.1.GA</hibernate.version>
Modified: trunk/topia-service-migration/changelog.txt
===================================================================
--- trunk/topia-service-migration/changelog.txt 2009-08-28 14:56:14 UTC (rev 1634)
+++ trunk/topia-service-migration/changelog.txt 2009-09-03 19:03:29 UTC (rev 1635)
@@ -1,3 +1,11 @@
+2.2.1 chemit 20090903
+
+ * [FIX #38] manual migration service does not work on windows OS
+ * [FEATURE #40] clean manual migration service
+ * [FEATURE #42] add i18n in migration service
+
+-- chemit -- Thu, 03 Sep 2009 18:51:54 +0200
+
2.2.0
* integrate in ToPIA project as org.nuiton.topia:topia-service-migration
* introduce a simpler migration service ManualMigrationEngine
Modified: trunk/topia-service-migration/pom.xml
===================================================================
--- trunk/topia-service-migration/pom.xml 2009-08-28 14:56:14 UTC (rev 1634)
+++ trunk/topia-service-migration/pom.xml 2009-09-03 19:03:29 UTC (rev 1635)
@@ -124,6 +124,19 @@
</dependencies>
</plugin>
+ <plugin>
+ <groupId>org.nuiton.i18n</groupId>
+ <artifactId>maven-i18n-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>parserJava</goal>
+ <goal>gen</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
</build>
</project>
Modified: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/ManualMigrationEngine.java
===================================================================
--- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/ManualMigrationEngine.java 2009-08-28 14:56:14 UTC (rev 1634)
+++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/ManualMigrationEngine.java 2009-09-03 19:03:29 UTC (rev 1635)
@@ -27,7 +27,6 @@
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
-import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.SortedSet;
@@ -41,10 +40,12 @@
import org.nuiton.util.Resource;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
+import static org.nuiton.i18n.I18n._;
import org.nuiton.topia.framework.TopiaContextImpl;
import org.nuiton.topia.framework.TopiaUtil;
import org.nuiton.topia.migration.ManualMigrationCallback.MigrationChoice;
import org.nuiton.util.VersionUtil;
+import org.nuiton.util.VersionUtil.VersionComparator;
/**
* TopiaMigrationServiceImpl.java
@@ -78,9 +79,9 @@
*/
static public final String MIGRATION_CALLBACK = "topia.service.migration.callback";
/**
- * Un drapeau pour indiquer si on ne doit pas lancer le service au demarrage
+ * Un drapeau pour indiquer si on doit lancer le service au demarrage
*/
- static public final String MIGRATION_NO_MIGRATE_ON_INIT = "topia.service.migration.no.migrate.on.init";
+ static public final String MIGRATION_MIGRATE_ON_INIT = "topia.service.migration.no.migrate.on.init";
/**
* Configuration hibernate ne mappant que l'entite version (initialise en pre-init)
*/
@@ -106,9 +107,9 @@
*/
protected Version dbVersion;
/**
- * Un drapeau pour ne pas effectuer de migration au demarrage (initialise en pre-init)
+ * Un drapeau pour effectuer la migration au demarrage (initialise en pre-init)
*/
- protected boolean noMigrateOnInit;
+ protected boolean migrateOnInit;
/**
* CallbackHandler list (initialise en pre-init)
*/
@@ -144,7 +145,7 @@
String callbackStr = config.getProperty(MIGRATION_CALLBACK, "");
String[] dirs = config.getProperty(TopiaContextImpl.TOPIA_PERSISTENCE_DIRECTORIES, "").split(",");
- this.noMigrateOnInit = Boolean.valueOf(config.getProperty(MIGRATION_NO_MIGRATE_ON_INIT, "true"));
+ this.migrateOnInit = Boolean.valueOf(config.getProperty(MIGRATION_MIGRATE_ON_INIT, "true"));
String modelName = config.getProperty(MIGRATION_MODEL_NAME, null);
if (version == null || version.trim().isEmpty()) {
@@ -186,13 +187,17 @@
for (String dir : dirs) {
dir = dir.trim();
if (!dir.isEmpty()) {
- log.debug("addDirectory " + dir);
+ if (log.isDebugEnabled()) {
+ log.debug("addDirectory " + dir);
+ }
versionConfiguration.addDirectory(new File(dir));
}
}
for (Class<?> clazz : getPersistenceClasses()) {
- log.debug("addClass " + clazz);
+ if (log.isDebugEnabled()) {
+ log.debug("addClass " + clazz);
+ }
versionConfiguration.addClass(clazz);
}
@@ -202,26 +207,13 @@
versionConfiguration.setProperties(prop);
- this.versionTableExist = TopiaUtil.isSchemaExist(versionConfiguration, TMSVersionImpl.class.getName());
-
- // recuperation de la version de la base
- try {
-
- dbVersion = detectDbVersion();
- } catch (MigrationServiceException e) {
- throw new TopiaRuntimeException("Can't obtain dbVersion for reason " + e.getMessage(), e);
- }
-
init = true;
// add topia context listener
context.addTopiaContextListener(this);
context.addTopiaTransactionVetoable(this);
- if (!noMigrateOnInit) {
-
- // lancement de la migration
-
+ if (migrateOnInit) {
try {
doMigrateSchema();
@@ -229,6 +221,10 @@
} catch (MigrationServiceException e) {
throw new TopiaRuntimeException("Can't migrate schema for reason " + e.getMessage(), e);
}
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("migration service, skip migration on init");
+ }
}
return true;
@@ -254,8 +250,8 @@
@Override
public void postCreateSchema(TopiaContextEvent event) {
- if (log.isInfoEnabled()) {
- log.info("postCreateSchema event called : put version in database");
+ if (log.isDebugEnabled()) {
+ log.debug("postCreateSchema event called : put version in database");
}
saveVersion(applicationVersion);
@@ -263,8 +259,8 @@
@Override
public void postUpdateSchema(TopiaContextEvent event) {
- if (log.isInfoEnabled()) {
- log.info("postUpdateSchema event called : put version in database");
+ if (log.isDebugEnabled()) {
+ log.debug("postUpdateSchema event called : put version in database");
}
saveVersion(applicationVersion);
@@ -273,8 +269,8 @@
@Override
public void postRestoreSchema(TopiaContextEvent event) {
- if (log.isInfoEnabled()) {
- log.info("postRestoreSchema event detected, redo, schema migration");
+ if (log.isDebugEnabled()) {
+ log.debug("postRestoreSchema event detected, redo, schema migration");
}
try {
@@ -301,9 +297,9 @@
boolean complete = migrateSchema();
if (!complete) {
if (log.isErrorEnabled()) {
- log.error("Database migration not complete");
+ log.error(_("topia.migration.migration.incomplete"));
}
- throw new TopiaRuntimeException("Database migration not succesfully ended !");
+ throw new TopiaRuntimeException(_("topia.migration.migration.incomplete"));
}
}
@@ -312,38 +308,44 @@
checkInit();
- log.info("Starting Topia Migration Service - Application version : " + applicationVersion.getVersion() + ", database version : " + dbVersion.getVersion());
+ if (dbVersion == null || !migrateOnInit) {
+ detectDbVersion();
+ }
- // tel if migration is needed
+ log.info(_("topia.migration.start.migration", applicationVersion.getVersion(), dbVersion.getVersion()));
+
+ // tell if migration is needed
boolean bMigrationNeeded = false;
if (versionTableExist && dbVersion.equals(applicationVersion)) {
- log.info("Database is up to date, no migration needed.");
+ log.info(_("topia.migration.skip.migration.db.is.up.to.date"));
// la base est a jour
return true;
}
+ SortedSet<Version> allVersions = getVersions();
+ log.info(_("topia.migration.available.versions", allVersions));
+
if (dbVersion.before(applicationVersion)) {
- SortedSet<Version> allVersions = getVersions();
-
- log.info("Database need update, available versions : " + allVersions);
-
// on filtre les versions a appliquer
- List<Version> versionsToApply = detectVersions(allVersions, dbVersion, applicationVersion);
+ List<Version> versionsToApply = VersionUtil.filterVersions(versions, dbVersion, applicationVersion, false, true);
+ //List<Version> versionsToApply = detectVersions(allVersions, dbVersion, applicationVersion);
if (versionsToApply.isEmpty()) {
- log.info("no version to apply, no migration needed.");
+ log.info(_("topia.migration.skip.migration.no.version.to.apply"));
} else {
bMigrationNeeded = true;
- log.info("will migrate versions " + versionsToApply);
+ log.info(_("topia.migration.migrate.versions", versionsToApply));
// ask handler for migration
MigrationChoice bMigrationWanted = callback.doMigration(rootContext,
dbVersion,
applicationVersion,
versionsToApply);
- log.info("Handler choose : " + bMigrationWanted);
+ if (log.isDebugEnabled()) {
+ log.debug("Handler choose : " + bMigrationWanted);
+ }
if (bMigrationWanted == MigrationChoice.NO_MIGRATION) {
// l'utilisateur a annule la migration
return false;
@@ -354,7 +356,9 @@
// on sauvegarde la version si necessaire (base non versionnee ou migration realisee)
if (!versionTableExist || bMigrationNeeded) {
- log.info("Set application version in database to " + applicationVersion);
+ if (log.isDebugEnabled()) {
+ log.debug("Set application version in database to " + applicationVersion);
+ }
// put version in database and create table if required
saveVersion(applicationVersion);
@@ -374,6 +378,11 @@
*/
public void saveVersion(Version version) {
checkInit();
+
+ if (!migrateOnInit || dbVersion == null) {
+ detectDbVersion();
+ }
+
try {
boolean createTable = !versionTableExist;
@@ -382,14 +391,18 @@
if (createTable) {
// si la base n'etait pas versionnee, la table version n'existe pas
// creation
- log.debug("Adding table to put version");
+ if (log.isDebugEnabled()) {
+ log.debug("Adding table to put version");
+ }
// creer le schema en base
// dans la configuration versionConfiguration, il n'y a que la table version
SchemaExport schemaExport = new SchemaExport(versionConfiguration);
schemaExport.create(log.isDebugEnabled(), true);
- log.debug("Table for " + TMSVersion.class.getSimpleName() + " created");
+ if (log.isDebugEnabled()) {
+ log.debug("Table for " + TMSVersion.class.getSimpleName() + " created");
+ }
}
// Changement de la version en base
@@ -408,7 +421,7 @@
v.delete();
}
- log.info("Database version : " + version);
+ log.info(_("topia.migration.saving.db.version", version));
dao.create(TMSVersion.VERSION, version.getVersion());
tx.commitTransaction();
@@ -445,13 +458,18 @@
checkInit();
// schema des noms de dossier de version
- final Pattern MAPPING_PATTERN = Pattern.compile(mappingsDirectory + File.separator + "([0-9]+(\\.[0-9]+)*)");
+ // FIX #38 : never use a File.separator for a class-path resource searching
+ final Pattern MAPPING_PATTERN = Pattern.compile(mappingsDirectory + "/([0-9]+(\\.[0-9]+)*)");
+
+ if (log.isDebugEnabled()) {
+ log.debug("MAPPING_PATTERN : " + MAPPING_PATTERN);
+ }
ClassLoader classLoader = getClass().getClassLoader();
List<URL> urls = Resource.getURLs(".*" + mappingsDirectory + "/.*", classLoader instanceof URLClassLoader ? (URLClassLoader) classLoader : null);
// ensemble ordonnee des version a charger apres
- versions = new TreeSet<Version>();
+ versions = new TreeSet<Version>(new VersionComparator());
if (urls != null && !urls.isEmpty()) {
@@ -473,43 +491,20 @@
}
/**
- * Filtre l'ensemble des versions, pour obtenir toutes les versions a migrer.
- *
- * @param versions les versions a filtrer
- * @param dbVersion la version actuel
- * @param applicationVersion la version a atteindre
- * @return la liste des versions a migrer
- */
- protected List<Version> detectVersions(SortedSet<Version> versions, Version dbVersion, Version applicationVersion) {
- List<Version> toApply = new ArrayList<Version>();
- for (Version v : versions) {
- log.debug("detected version " + v);
- if (v.compareTo(dbVersion) <= 0) {
- // version trop ancienne
- continue;
- }
- if (v.compareTo(applicationVersion) > 0) {
- // version trop recente
- continue;
- }
- // la version est a appliquer
- log.info("version to migrate : " + v);
- toApply.add(v);
- }
- return toApply;
- }
-
- /**
- * Detecte la version de la base.
+ * Recupere depuis la base les états internes du service :
*
- * Note : si la base n'est pas versionnee, on considere alors qu'elle est en
- * en version 0.
- *
- * @return la version de la base
- * @throws MigrationServiceException
+ * <ul>
+ * <li>versionTableExist</li>
+ * <li>dbVersion</li>
+ * </ul>
+ *
*/
- protected Version detectDbVersion() throws MigrationServiceException {
+ protected synchronized void detectDbVersion() {
+ // on detecte si la table de versionning existe
+ versionTableExist = TopiaUtil.isSchemaExist(versionConfiguration, TMSVersionImpl.class.getName());
+
+ // recuperation de la version de la base
Version v = null;
try {
if (versionTableExist) {
@@ -528,7 +523,7 @@
}
}
} catch (TopiaException e) {
- throw new MigrationServiceException(e);
+ throw new TopiaRuntimeException("Can't obtain dbVersion for reason " + e.getMessage(), e);
}
if (v == null) {
@@ -537,12 +532,11 @@
// et les schema de cette version 0 doivent
// etre detenu en local
v = Version.VZERO;
- log.info("Database version not found, so database schema is considered as V0");
+ log.info(_("topia.migration.db.not.versionned"));
} else {
- log.info("Database version : " + v);
+ log.info(_("topia.migration.detected.db.version", v));
}
-
- return v;
+ dbVersion = v;
}
protected void checkInit() {
Added: trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-en_GB.properties
===================================================================
--- trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-en_GB.properties (rev 0)
+++ trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-en_GB.properties 2009-09-03 19:03:29 UTC (rev 1635)
@@ -0,0 +1,9 @@
+topia.migration.available.versions=Available versions \: %1$s
+topia.migration.db.not.versionned=Database version not found, so database schema is considered as V0
+topia.migration.detected.db.version=detected database version \: %1$s
+topia.migration.migrate.versions=Versions to apply \: %1$s
+topia.migration.migration.incomplete=Database migration not succesfully ended \!
+topia.migration.saving.db.version=Saving new database version \: %1$s
+topia.migration.skip.migration.db.is.up.to.date=Database is up to date, no migration needed.
+topia.migration.skip.migration.no.version.to.apply=No version to apply, no migration needed.
+topia.migration.start.migration=Starting Topia Migration Service - Application version \: %1$s, Database version \: %2$s
Added: trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-fr_FR.properties
===================================================================
--- trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-fr_FR.properties (rev 0)
+++ trunk/topia-service-migration/src/main/resources/i18n/topia-service-migration-fr_FR.properties 2009-09-03 19:03:29 UTC (rev 1635)
@@ -0,0 +1,9 @@
+topia.migration.available.versions=Mises \u00E0 jour disponibles \: %1$s
+topia.migration.db.not.versionned=La base de donn\u00E9es n'est pas versionn\u00E9e, elle sera consid\u00E9r\u00E9e en version 0.
+topia.migration.detected.db.version=Version de base d\u00E9tect\u00E9e \: %1$s
+topia.migration.migrate.versions=Mises \u00E0 jour \u00E0 installer \: %1$s
+topia.migration.migration.incomplete=La migration de la base s'est mal d\u00E9roul\u00E9 ou a \u00E9t\u00E9 annul\u00E9e\!
+topia.migration.saving.db.version=Sauvegarde de la nouvelle version de la base \: %1$s
+topia.migration.skip.migration.db.is.up.to.date=La base est \u00E0 jour, aucune migration n\u00E9cessaire.
+topia.migration.skip.migration.no.version.to.apply=Aucune version \u00E0 appliquer, aucune migration n\u00E9cessaire.
+topia.migration.start.migration=D\u00E9marrage du service de mise \u00E0 jour - version de l'application \: %1$s, version de la base \: %2$s
Modified: trunk/topia-service-migration/src/main/resources/org/nuiton/topia/migration/mappings/TMSVersion.hbm.xml
===================================================================
--- trunk/topia-service-migration/src/main/resources/org/nuiton/topia/migration/mappings/TMSVersion.hbm.xml 2009-08-28 14:56:14 UTC (rev 1634)
+++ trunk/topia-service-migration/src/main/resources/org/nuiton/topia/migration/mappings/TMSVersion.hbm.xml 2009-09-03 19:03:29 UTC (rev 1635)
@@ -1,10 +1,7 @@
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
- <class name="org.nuiton.topia.migration.mappings.TMSVersion" table="tms_version">
- <id name="version" column="version"/>
- </class>
-</hibernate-mapping>
\ No newline at end of file
+ <class name="org.nuiton.topia.migration.mappings.TMSVersion" table="tms_version">
+ <id column="version" name="version"/>
+ </class>
+</hibernate-mapping>
1
0