wt.workflow.forum
Class MigrateDiscussionPosting_R6ToR62

java.lang.Object
  extended bywt.workflow.forum.MigrateDiscussionPosting_R6ToR62
All Implemented Interfaces:
JavaMigrator

public class MigrateDiscussionPosting_R6ToR62
extends Object
implements JavaMigrator

The IDA3A5 field on a DiscussionPosting contains the value of the parent DiscussionTopic of a DiscussionPosting object. In R6.0, this field was left blank if the DiscussionPosting was not a direct child of a DiscussionTopic object but was the child of a DiscussionPosting down the discussion thread of that Topic. Now, for performance reasons, this field must be populated with the ID of the DiscussionTopic. This migrator needs to do the following: - Traverse through all existing DiscussionPosting objects - If not already set, set the value of this field to the ID of the parent DiscussionTopic.


Field Summary
private static String CLASSNAME
           
private  PrintWriter debugLog
           
private static String DISCUSSIONTOPIC_CLASSNAME
           
private static int MAX_BATCH_COUNT
           
 
Constructor Summary
MigrateDiscussionPosting_R6ToR62()
           
 
Method Summary
 void executeBatch(PreparedStatement ps)
           
 ResultSet executeQuery(Connection connection, String sql)
           
 ResultSet getTopicIDs(Connection connection)
          Retrieve IDA2A2 values for all DiscussionTopic objects under the given forum ID.
 boolean runMigration(DirectiveServices directive_services)
          Run the migration.
 void upgradeAllPostings(Connection connection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSNAME

private static final String CLASSNAME

debugLog

private PrintWriter debugLog

MAX_BATCH_COUNT

private static final int MAX_BATCH_COUNT
See Also:
Constant Field Values

DISCUSSIONTOPIC_CLASSNAME

private static final String DISCUSSIONTOPIC_CLASSNAME
See Also:
Constant Field Values
Constructor Detail

MigrateDiscussionPosting_R6ToR62

public MigrateDiscussionPosting_R6ToR62()
Method Detail

runMigration

public boolean runMigration(DirectiveServices directive_services)
                     throws SQLException,
                            DirectiveExecutionException,
                            WTException
Description copied from interface: JavaMigrator
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 JavaMigrator
Parameters:
directive_services - provide access to database, logging, and versioning information
Throws:
SQLException
DirectiveExecutionException
WTException

upgradeAllPostings

public void upgradeAllPostings(Connection connection)
                        throws SQLException,
                               WTException
Throws:
SQLException
WTException

getTopicIDs

public ResultSet getTopicIDs(Connection connection)
                      throws WTException
Retrieve IDA2A2 values for all DiscussionTopic objects under the given forum ID. This is usually a very small number not more than 10 topics.

Throws:
WTException

executeQuery

public ResultSet executeQuery(Connection connection,
                              String sql)
                       throws SQLException
Throws:
SQLException

executeBatch

public void executeBatch(PreparedStatement ps)
                  throws WTException
Throws:
WTException