com.ptc.windchill.upgrade.modeldiff
Class Output

java.lang.Object
  extended bycom.ptc.windchill.upgrade.modeldiff.Output

public class Output
extends Object

Manages the output to the Report-Spool-Script files


Field Summary
private  CompareSchema compareSchema_
           
private  String dateSQLString_
           
private  String disabled_str1_
           
private  String disabled_str2_
           
private  String disabled_str3_
           
private  int format1ColumnName_
           
private  int format1IndexName_
           
private  int format1TableName_
           
private  int format2ColumnName_
           
private  int format2TableName_
           
private  Vector history_
           
private  Vector initialValues_
           
private  String NOT_NULL_TEMP_COUNT
           
private  String NOT_NULL_TEST_OUTPUT
           
private  String REM_END_STREAM
           
private  String REM_GUI_DISPLAY_As
           
private  String REM_GUI_DISPLAY_Ss
           
private  String REPORT0_XML_LONG
           
private  String reportHtmlName_
           
private  String SCRIPT0_PREFIX
           
private  String SCRIPT0_WORK
           
private  String SCRIPT0_WORK_LONG
           
private  String SCRIPT1_PREFIX
           
private  String SCRIPT1_WORK
           
private  String SCRIPT1_WORK_LONG
           
private  String SCRIPT2_PREFIX
           
private  String SCRIPT2_WORK
           
private  String SCRIPT2_WORK_LONG
           
private  String SPOOL0_WORK_LONG
           
private  String SPOOL1_WORK_LONG
           
private  String SPOOL2_WORK_LONG
           
private  Vector sqlNullTests_
           
private  Vector sqlUniquenessColumns_
           
private  Vector sqlUniquenessIndices_
           
private  Vector sqlUniquenessTables_
           
private  String UNIQUE_TEMP_COLUMN
           
private  String UNIQUE_TEMP_COUNT
           
private  String UNIQUE_TEST_OUTPUT
           
 
Constructor Summary
(package private) Output(CompareSchema compareSchema)
           
 
Method Summary
private  void AddStandardScriptBeginning(PrintWriter script, String path_and_file_name)
           
(package private)  void beginTheReport(CompareSchemaReportXml report_xml, String path_and_file)
          The report HTML file.
(package private)  int beginTheScript0Work(PrintWriter script)
          Adds the StartOf, Spooling, and Dates to the Script0Work file.
(package private)  void beginTheScript1Work(PrintWriter script)
          Adds the StartOf, Spooling, and Dates to the Script1Work file.
private  void beginTheSpool(PrintWriter script, String spool_path_and_file, String creator_name)
          Adds Spooling and Dates to the script file.
private  void closeIfOpen(PrintWriter print_writer)
           
private  File createDisabledSqlDuplicate(boolean errored, File file_with_dot_extension)
          Adds a REM in front of each line and adds a _temp to the file name.
(package private)  PrintWriter createPrintWriter(String path_and_file_name)
          Obtain access to a file in order to write (the user must flush() and close()).
(package private)  int createScript2Work(PrintWriter script)
           
(package private)  void disableContentsOfTheScripts(boolean errored, PrintWriter script0Work, PrintWriter script1Test, PrintWriter script1Debug, PrintWriter script1Work, PrintWriter script2Test, PrintWriter script2Debug, PrintWriter script2Work)
          Called when an error is experienced by CompareSchema.
private  void disableSqlFile(boolean errored, String path_and_old_file_name)
           
(package private)  void endTheScript0Work(PrintWriter script, String path_and_file, String spool_path_and_file)
          Adds the final entries to the Script0Work file.
(package private)  void endTheScript1Work(PrintWriter script, String path_and_file, String spool_path_and_file)
          Adds the final entries to the Script0Work file.
private  void endTheSpool(PrintWriter script, String spool_path_and_file)
          Ends the Spooling to the script file.
(package private)  void setFormat1ColumnName(int x)
           
(package private)  void setFormat1IndexName(int x)
           
(package private)  void setFormat1TableName(int x)
           
private  void setFormat2ColumnName(int x)
           
private  void setFormat2TableName(int x)
           
(package private)  void setInitialValues(Vector initialValues)
           
(package private)  void setSqlUniquenessColumns(Vector sqlUniquenessColumns)
           
(package private)  void setSqlUniquenessIndices(Vector sqlUniquenessIndices)
           
(package private)  void setSqlUniquenessTables(Vector sqlUniquenessTables)
           
(package private)  void setTheHistory(Vector history)
           
private  void spoolCreatedOnCreatedBy(PrintWriter script, String spool_path_and_file, String creator_name)
           
private  void sqlSettingsOff(PrintWriter script)
          The SQL sessions need these settings to not produce extra output.
private  void sqlSettingsOn(PrintWriter script)
          A user that re-uses the command window to open a manual SQL*Plus session needs reasonable settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reportHtmlName_

private String reportHtmlName_

dateSQLString_

private String dateSQLString_

sqlUniquenessTables_

private Vector sqlUniquenessTables_

sqlUniquenessColumns_

private Vector sqlUniquenessColumns_

sqlUniquenessIndices_

private Vector sqlUniquenessIndices_

format1IndexName_

private int format1IndexName_

format1TableName_

private int format1TableName_

format1ColumnName_

private int format1ColumnName_

format2TableName_

private int format2TableName_

format2ColumnName_

private int format2ColumnName_

sqlNullTests_

private Vector sqlNullTests_

initialValues_

private Vector initialValues_

SCRIPT0_PREFIX

private String SCRIPT0_PREFIX

SCRIPT1_PREFIX

private String SCRIPT1_PREFIX

SCRIPT2_PREFIX

private String SCRIPT2_PREFIX

SCRIPT0_WORK

private String SCRIPT0_WORK

SCRIPT1_WORK

private String SCRIPT1_WORK

SCRIPT2_WORK

private String SCRIPT2_WORK

REPORT0_XML_LONG

private String REPORT0_XML_LONG

SCRIPT0_WORK_LONG

private String SCRIPT0_WORK_LONG

SCRIPT1_WORK_LONG

private String SCRIPT1_WORK_LONG

SCRIPT2_WORK_LONG

private String SCRIPT2_WORK_LONG

SPOOL0_WORK_LONG

private String SPOOL0_WORK_LONG

SPOOL1_WORK_LONG

private String SPOOL1_WORK_LONG

SPOOL2_WORK_LONG

private String SPOOL2_WORK_LONG

REM_GUI_DISPLAY_As

private String REM_GUI_DISPLAY_As

REM_GUI_DISPLAY_Ss

private String REM_GUI_DISPLAY_Ss

REM_END_STREAM

private String REM_END_STREAM

UNIQUE_TEMP_COUNT

private String UNIQUE_TEMP_COUNT

UNIQUE_TEMP_COLUMN

private String UNIQUE_TEMP_COLUMN

NOT_NULL_TEMP_COUNT

private String NOT_NULL_TEMP_COUNT

UNIQUE_TEST_OUTPUT

private String UNIQUE_TEST_OUTPUT

NOT_NULL_TEST_OUTPUT

private String NOT_NULL_TEST_OUTPUT

history_

private Vector history_

disabled_str1_

private final String disabled_str1_
See Also:
Constant Field Values

disabled_str2_

private final String disabled_str2_
See Also:
Constant Field Values

disabled_str3_

private final String disabled_str3_
See Also:
Constant Field Values

compareSchema_

private CompareSchema compareSchema_
Constructor Detail

Output

Output(CompareSchema compareSchema)
Method Detail

createPrintWriter

PrintWriter createPrintWriter(String path_and_file_name)
                        throws CompareSchemaException
Obtain access to a file in order to write (the user must flush() and close()).

Parameters:
path_and_file_name - Write to this file.
Returns:
A PrintWriter object that has a println(...) method.
Throws:
CompareSchemaException

setTheHistory

void setTheHistory(Vector history)

beginTheReport

void beginTheReport(CompareSchemaReportXml report_xml,
                    String path_and_file)
              throws CompareSchemaException
The report HTML file.

Throws:
CompareSchemaException

beginTheSpool

private void beginTheSpool(PrintWriter script,
                           String spool_path_and_file,
                           String creator_name)
Adds Spooling and Dates to the script file.

Parameters:
script - The generated SQL script.

spoolCreatedOnCreatedBy

private void spoolCreatedOnCreatedBy(PrintWriter script,
                                     String spool_path_and_file,
                                     String creator_name)

endTheSpool

private void endTheSpool(PrintWriter script,
                         String spool_path_and_file)
Ends the Spooling to the script file.

Parameters:
script - The generated SQL script.

AddStandardScriptBeginning

private void AddStandardScriptBeginning(PrintWriter script,
                                        String path_and_file_name)

beginTheScript0Work

int beginTheScript0Work(PrintWriter script)
Adds the StartOf, Spooling, and Dates to the Script0Work file.


endTheScript0Work

void endTheScript0Work(PrintWriter script,
                       String path_and_file,
                       String spool_path_and_file)
Adds the final entries to the Script0Work file.


beginTheScript1Work

void beginTheScript1Work(PrintWriter script)
Adds the StartOf, Spooling, and Dates to the Script1Work file.


endTheScript1Work

void endTheScript1Work(PrintWriter script,
                       String path_and_file,
                       String spool_path_and_file)
Adds the final entries to the Script0Work file.


setInitialValues

void setInitialValues(Vector initialValues)

createScript2Work

int createScript2Work(PrintWriter script)

setSqlUniquenessIndices

void setSqlUniquenessIndices(Vector sqlUniquenessIndices)

setSqlUniquenessTables

void setSqlUniquenessTables(Vector sqlUniquenessTables)

setSqlUniquenessColumns

void setSqlUniquenessColumns(Vector sqlUniquenessColumns)

setFormat1IndexName

void setFormat1IndexName(int x)

setFormat1TableName

void setFormat1TableName(int x)

setFormat1ColumnName

void setFormat1ColumnName(int x)

setFormat2TableName

private void setFormat2TableName(int x)

setFormat2ColumnName

private void setFormat2ColumnName(int x)

sqlSettingsOff

private void sqlSettingsOff(PrintWriter script)
The SQL sessions need these settings to not produce extra output.

Parameters:
script - Access to an SQL file.

sqlSettingsOn

private void sqlSettingsOn(PrintWriter script)
A user that re-uses the command window to open a manual SQL*Plus session needs reasonable settings.

Parameters:
script - Access to an SQL file.

disableContentsOfTheScripts

void disableContentsOfTheScripts(boolean errored,
                                 PrintWriter script0Work,
                                 PrintWriter script1Test,
                                 PrintWriter script1Debug,
                                 PrintWriter script1Work,
                                 PrintWriter script2Test,
                                 PrintWriter script2Debug,
                                 PrintWriter script2Work)
Called when an error is experienced by CompareSchema. Disable the contents of the script files. MUST NOT throw because it is part of a response to a throw.


closeIfOpen

private void closeIfOpen(PrintWriter print_writer)

disableSqlFile

private void disableSqlFile(boolean errored,
                            String path_and_old_file_name)

createDisabledSqlDuplicate

private File createDisabledSqlDuplicate(boolean errored,
                                        File file_with_dot_extension)
                                 throws CompareSchemaException
Adds a REM in front of each line and adds a _temp to the file name.

Throws:
CompareSchemaException