za.org.coefficient.modules.mailforum.util
Class DBUpdateUtil

java.lang.Object
  extended by za.org.coefficient.modules.mailforum.util.DBUpdateUtil

public class DBUpdateUtil
extends java.lang.Object

Author:
pieter20 Jun 13, 2005 This class is used to convert the old db structure of Dithaka/MailForum to the new structure. This new structure contains 3 new classes: MailForumSettings, ForumChampion and AliasUser.

Constructor Summary
DBUpdateUtil()
           
 
Method Summary
private static void addAliasEmailAddresses()
          Jun 14, 2005 pieter20 Add the new alias email address to the user, and creates a new AliasUser object in the system.
private static void addChampionsAndSettings()
          Jun 14, 2005 pieter20 This method updates the forums in Dithaka.
private static void addForumSettings(Forum forum, Project currentProject)
           
private static java.util.Set addNotificationLists(java.util.List projectChampionUserList, Forum forum)
           
private static void changeUserResourceURI(CoefficientUser user)
           
private static void convertMessageDates()
           
private static java.util.Collection getAllForums()
           
private static java.util.Collection getAllMessages()
           
private static java.util.Collection getAllProjects()
           
private static java.util.Collection getAllUsers()
           
private static java.util.Collection getForumList(Project project)
           
static void updateToNewVersion()
          Jun 15, 2005 pieter20 This method controls what updates needs to be made to move over from an old version of the MailForum and Dithaka to a new version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBUpdateUtil

public DBUpdateUtil()
Method Detail

addForumSettings

private static void addForumSettings(Forum forum,
                                     Project currentProject)
Parameters:
forum -
currentProject - Jun 14, 2005 pieter20

addChampionsAndSettings

private static void addChampionsAndSettings()
Jun 14, 2005 pieter20 This method updates the forums in Dithaka. It associates the forum with a notification list of ForumChampions. It also associates the forum with settings that is stored in the MailForumSettings class.


getForumList

private static java.util.Collection getForumList(Project project)
                                          throws java.lang.Exception
Parameters:
project -
Returns:
Throws:
java.lang.Exception - Apr 25, 2005 pieter20 Returns a collection of forums that are linked to this project

addNotificationLists

private static java.util.Set addNotificationLists(java.util.List projectChampionUserList,
                                                  Forum forum)
Parameters:
projectChampionUserList -
forum -
Returns:
Apr 25, 2005 pieter20 we need to set the ForumChampion's parent ForumId and for this we need the forum. If this is not set we will have forumChamp's that do not have any reference back to the forum. But are saved in the db. Please consult the Hibernate Reference Manual Ch 16: Parent/Child and one-to-many relationships

getAllProjects

private static java.util.Collection getAllProjects()
                                            throws PersistenceException
Returns:
Throws:
PersistenceException - Jun 14, 2005 pieter20 This method returns all the Project's

getAllUsers

private static java.util.Collection getAllUsers()
                                         throws PersistenceException
Returns:
Throws:
PersistenceException - Jun 14, 2005 pieter20 This method returns all the CoefficientUser's

getAllMessages

private static java.util.Collection getAllMessages()
                                            throws PersistenceException
Returns:
Throws:
PersistenceException - Jun 14, 2005 pieter20 This method returns all the Message's

getAllForums

private static java.util.Collection getAllForums()
                                          throws PersistenceException
Returns:
Throws:
PersistenceException - Jun 15, 2005 pieter20 This method returns all the Forum's

convertMessageDates

private static void convertMessageDates()

addAliasEmailAddresses

private static void addAliasEmailAddresses()
Jun 14, 2005 pieter20 Add the new alias email address to the user, and creates a new AliasUser object in the system. The user resource entry is also updated to use the alias email address.


changeUserResourceURI

private static void changeUserResourceURI(CoefficientUser user)
Parameters:
user - Jun 15, 2005 pieter20 This method converts the old user resource uri to a new one that uses the alias email address instead of the real email address.

updateToNewVersion

public static void updateToNewVersion()
Jun 15, 2005 pieter20 This method controls what updates needs to be made to move over from an old version of the MailForum and Dithaka to a new version. If there are other changes in the future they can be added here.



Copyright CSIR. All Rights Reserved.