wt.folder
Class CabinetMigrator

java.lang.Object
  extended bywt.folder.CabinetMigrator
All Implemented Interfaces:
Migrator

public class CabinetMigrator
extends Object
implements Migrator

With R6, a new column has been introduced into Cabinet: PERSONALCABINET. This needs to be set to true (1) if object resides in User domain. Otherwise, it needs to be set to false (0). With R6, a new column has been introduced in many tables: INHERITEDDOMAIN. This needs to be set to true (1) for any concrete class that impletments either wt.folder.Foldered or wt.enterprise.CabinetManaged and is DomainAdministered. In pre-R6, the domain of the parent folder or cabinet is the same as the domain of the foldered or cabinet managed object. With R6, this is now based on the column, INHERITEDDOMAIN.


Field Summary
private  PrintWriter debugLog
           
private  Hashtable DomainAdministeredTable
           
private  String USER_DOMAIN
           
 
Constructor Summary
CabinetMigrator()
           
 
Method Summary
private  void findTables(Connection connection, Class aClass)
          Find necessary tables and call updateInheritedDomain to update INHERITEDDOMAIN.
 boolean runMigration(Connection connection, PersistentObjectManager pom, PrintWriter logWriter)
          Run the migration.
private  void setDomainAdministeredTable()
          Set DomainAdministeredTable to have all objects that are DomainAdministered.
private  void setPersonalCabinet(Connection connection)
          Set PersonalCabinet to true (1) if object resides in User domain.
private  void updateInheritedDomain(Connection connection, ClassInfo descendant_info)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugLog

private PrintWriter debugLog

USER_DOMAIN

private String USER_DOMAIN

DomainAdministeredTable

private Hashtable DomainAdministeredTable
Constructor Detail

CabinetMigrator

public CabinetMigrator()
Method Detail

runMigration

public boolean runMigration(Connection connection,
                            PersistentObjectManager pom,
                            PrintWriter logWriter)
                     throws SQLException,
                            WTIntrospectionException,
                            DatastoreException,
                            IOException,
                            ClassNotFoundException,
                            WTException
Description copied from interface: Migrator
Run the migration.

Migrators should log all output to the given PrintWriter. This is the log that is created by RunMigrators. It is an autoflush writer.

Migrators should return true if they successfully completed migration and false otherwise. It is the migrator's responsibility to log failure reasons to the log.

Migrators should not concern themselves with committing the work on the connection. The MigratorRunner will commit the connection work after running each Migrator.

Specified by:
runMigration in interface Migrator
Parameters:
connection - an open connection to the Windchill database
pom - a persistent object manager against the Windchill database
logWriter - an autoflush printwriter for logging any and all output
Throws:
SQLException
WTIntrospectionException
DatastoreException
IOException
ClassNotFoundException
WTException

setPersonalCabinet

private void setPersonalCabinet(Connection connection)
                         throws SQLException,
                                IOException,
                                PersistenceException,
                                DatastoreException
Set PersonalCabinet to true (1) if object resides in User domain. False (0) otherwise.

Throws:
SQLException
IOException
PersistenceException
DatastoreException

setDomainAdministeredTable

private void setDomainAdministeredTable()
                                 throws PersistenceException,
                                        WTIntrospectionException
Set DomainAdministeredTable to have all objects that are DomainAdministered.

Throws:
PersistenceException
WTIntrospectionException

findTables

private void findTables(Connection connection,
                        Class aClass)
                 throws SQLException,
                        WTIntrospectionException
Find necessary tables and call updateInheritedDomain to update INHERITEDDOMAIN.

Throws:
SQLException
WTIntrospectionException

updateInheritedDomain

private void updateInheritedDomain(Connection connection,
                                   ClassInfo descendant_info)
                            throws SQLException,
                                   WTIntrospectionException
Throws:
SQLException
WTIntrospectionException