wt.team
Class MigrateTeamAndTemplate_R62To70

java.lang.Object
  extended bywt.team.MigrateTeamAndTemplate_R62To70
All Implemented Interfaces:
Migrator

public class MigrateTeamAndTemplate_R62To70
extends Object
implements Migrator

In 6.2 TeamTemplate is unique by name and domain. In 6.2 TeamTemplates are possibly created in different domains inside a container (project, etc.). In 7.0 TeamTemplate is unique by name and container. Need to handle templates that have the same name in a container. I assume Team object is always assigned to System Private domain.


Field Summary
(package private)  Connection connection
           
(package private) static PrintWriter debugLog
           
 
Constructor Summary
MigrateTeamAndTemplate_R62To70()
           
 
Method Summary
private  String getContainersOfDuplicateObjects(String objectTableName)
           
private  boolean isUniqueByContainer(String objectTableName)
           
 void renameTeamTemplate()
           
 boolean runMigration(Connection conn, PersistentObjectManager pom, PrintWriter logWriter)
          Run the migration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection

Connection connection

debugLog

static PrintWriter debugLog
Constructor Detail

MigrateTeamAndTemplate_R62To70

public MigrateTeamAndTemplate_R62To70()
Method Detail

runMigration

public boolean runMigration(Connection conn,
                            PersistentObjectManager pom,
                            PrintWriter logWriter)
                     throws SQLException,
                            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:
conn - 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
WTException

renameTeamTemplate

public void renameTeamTemplate()
                        throws SQLException,
                               WTException
Throws:
SQLException
WTException

getContainersOfDuplicateObjects

private String getContainersOfDuplicateObjects(String objectTableName)
                                        throws SQLException,
                                               WTException
Throws:
SQLException
WTException

isUniqueByContainer

private boolean isUniqueByContainer(String objectTableName)
                             throws SQLException,
                                    WTException
Throws:
SQLException
WTException