Author: sdumitriu
Date: 2007-12-18 16:50:43 +0100 (Tue, 18 Dec 2007)
New Revision: 6408

Added:
   
xwiki-platform/core/branches/xwiki-core-1.2/xwiki-core/src/main/java/com/xpn/xwiki/store/migration/hibernate/R6405XWIKI1933Migrator.java
Modified:
   
xwiki-platform/core/branches/xwiki-core-1.2/xwiki-core/src/main/java/com/xpn/xwiki/store/migration/hibernate/XWikiHibernateMigrationManager.java
Log:
XWIKI-1933: Editing users fails
Added migrator
Merged from [EMAIL PROTECTED]


Added: 
xwiki-platform/core/branches/xwiki-core-1.2/xwiki-core/src/main/java/com/xpn/xwiki/store/migration/hibernate/R6405XWIKI1933Migrator.java
===================================================================
--- 
xwiki-platform/core/branches/xwiki-core-1.2/xwiki-core/src/main/java/com/xpn/xwiki/store/migration/hibernate/R6405XWIKI1933Migrator.java
                            (rev 0)
+++ 
xwiki-platform/core/branches/xwiki-core-1.2/xwiki-core/src/main/java/com/xpn/xwiki/store/migration/hibernate/R6405XWIKI1933Migrator.java
    2007-12-18 15:50:43 UTC (rev 6408)
@@ -0,0 +1,79 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package com.xpn.xwiki.store.migration.hibernate;
+
+import com.xpn.xwiki.XWikiContext;
+import com.xpn.xwiki.XWikiException;
+import com.xpn.xwiki.store.migration.XWikiDBVersion;
+
+/**
+ * Migration for XWIKI1933: Editing users fails.
+ * 
+ * Note: This migrator should only be executed if the R4340XWIKI833 one has 
already been executed
+ * during a previous migration (i.e. if the database is in version >= 4340). 
This is because this
+ * current migrator is because the old migrator was only executed in the main 
wiki, and there was
+ * some code that inserted wrong data after the migration.
+ * 
+ * @version $Id: $
+ */
+public class R6405XWIKI1933Migrator extends R4340XWIKI883Migrator
+{
+    private int startupVersion;
+
+    public R6405XWIKI1933Migrator(int currentVersionBeforeMigratorsExecute)
+    {
+        this.startupVersion = currentVersionBeforeMigratorsExecute;
+    }
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see 
com.xpn.xwiki.store.migration.hibernate.AbstractXWikiHibernateMigrator#getName()
+     */
+    public String getName()
+    {
+        return "R6405XWIKI1933";
+    }
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see AbstractXWikiHibernateMigrator#getDescription()
+     */
+    public String getDescription()
+    {
+        return "See http://jira.xwiki.org/jira/browse/XWIKI-1933";;
+    }
+
+    /** [EMAIL PROTECTED] */
+    public XWikiDBVersion getVersion()
+    {
+        return new XWikiDBVersion(6405);
+    }
+
+    /** [EMAIL PROTECTED] */
+    public void migrate(XWikiHibernateMigrationManager manager, final 
XWikiContext context)
+        throws XWikiException
+    {
+        if (this.startupVersion >= 4340) {
+            super.migrate(manager, context);
+        }
+    }
+}

Modified: 
xwiki-platform/core/branches/xwiki-core-1.2/xwiki-core/src/main/java/com/xpn/xwiki/store/migration/hibernate/XWikiHibernateMigrationManager.java
===================================================================
--- 
xwiki-platform/core/branches/xwiki-core-1.2/xwiki-core/src/main/java/com/xpn/xwiki/store/migration/hibernate/XWikiHibernateMigrationManager.java
    2007-12-18 15:48:47 UTC (rev 6407)
+++ 
xwiki-platform/core/branches/xwiki-core-1.2/xwiki-core/src/main/java/com/xpn/xwiki/store/migration/hibernate/XWikiHibernateMigrationManager.java
    2007-12-18 15:50:43 UTC (rev 6408)
@@ -87,6 +87,7 @@
         result.add(new R4340XWIKI883Migrator());
         result.add(new R4359XWIKI1459Migrator());
         result.add(new 
R6079XWIKI1878Migrator(getDBVersion(context).getVersion()));
+        result.add(new 
R6405XWIKI1933Migrator(getDBVersion(context).getVersion()));
         // 2nd way - via classloader
         
         return result;

_______________________________________________
notifications mailing list
notifications@xwiki.org
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to