wt.workflow.notebook
Class MigrateNotebookContentR6_R7

java.lang.Object
  extended bywt.workflow.notebook.MigrateNotebookContentR6_R7
All Implemented Interfaces:
Migrator

public class MigrateNotebookContentR6_R7
extends Object
implements Migrator

This Migrator will move all content previously stored on Notebook to the ImportedBookmark object. ImportedBookmark is a new class in 7.0. I represents all uploaded data in a Notebook. Once data is migrated to ImportedBookmark, the previous WfBookmark that pointed to that data will be deleted as teh ImportedBookmark will both hold and point to the data now.


Field Summary
(package private) static Connection connection
           
(package private) static PrintWriter debugLog
           
(package private)  Hashtable holderToContents
           
(package private) static PersistentObjectManager pom
           
(package private) static boolean VERBOSE
           
 
Constructor Summary
MigrateNotebookContentR6_R7()
           
 
Method Summary
private static String escape(String s)
           
private  void migrateNotebookContent(PrintWriter log)
           
 boolean runMigration(Connection conn, PersistentObjectManager pom_, PrintWriter logWriter)
          Run the migration.
private  int update(String sql)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

static boolean VERBOSE

debugLog

static PrintWriter debugLog

connection

static Connection connection

pom

static PersistentObjectManager pom

holderToContents

Hashtable holderToContents
Constructor Detail

MigrateNotebookContentR6_R7

public MigrateNotebookContentR6_R7()
Method Detail

runMigration

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

migrateNotebookContent

private void migrateNotebookContent(PrintWriter log)
                             throws WTException,
                                    SQLException
Throws:
WTException
SQLException

update

private int update(String sql)
            throws WTException,
                   SQLException
Throws:
WTException
SQLException

escape

private static String escape(String s)