com.ptc.windchill.upgrade.directives.dataload
Class LoadCsvData

java.lang.Object
  extended bycom.ptc.windchill.upgrade.directives.dataload.LoadCsvData
All Implemented Interfaces:
UpdateDirective

public final class LoadCsvData
extends Object
implements UpdateDirective

Alters a table to redeclare a column as not null if it is not already. The directive will not produce an error for columns that are already declared NOT NULL.

Format

   <LoadCsvData>
       <[CDATA[csv-data]]>
       ...
    </LoadCsvData>

Format

Component Description Required Parameterizable
CDATA data section The CSV data in literal un-encoded form. no no

Example Usage

    <LoadCsvData>
       <[CDATA[WfVariable,Analysis_Instructions,java.lang.String,false,false,true,true,,,]]>
    </LoadCsvData>
 


Supported API: false

Extendable: false


Nested Class Summary
private  class LoadCsvData.DataOutputter
          Encapsulates the conditional writing of the data records to the data file.
 
Field Summary
private static Object creationLock__
           
private  ArrayList csvDataRecords_
           
static String DATA_RECORD_ELEMENT_NAME
           
private static String DEFAULT_DELIMITER_ATTR_VALUE
           
private  String delimiter_
           
static String DELIMITER_ATTR_NAME
           
private static String LOAD_FILE_DIR
           
private  String user_
           
private  WTProperties wtProperties_
           
 
Constructor Summary
LoadCsvData()
          Create an instance with no data.
 
Method Summary
 void addCsvDataRecord(String csv_data_record)
          Sets the class name of the migrator to run.
 void asDomOn(Element element)
           
 void execute(DirectiveServices directive_services)
          Executes the inner class DataOutputter.
private  ArrayList getCsvDataRecords()
           
private  String getDirectiveName()
          The name of the directive.
 String getLoggedInUser()
           
private  File getMigDataFile()
           
static void initializeDirectiveClass(DirectiveServices directive_services)
          Forces migration data file pointer to be based on current source and target versions.
 void initializeFromDom(Element element)
          Reads from DOMs formatted as described in the class documentation above.
 void run()
           
 void userTransaction(String user)
          Stores the login name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATA_RECORD_ELEMENT_NAME

public static final String DATA_RECORD_ELEMENT_NAME
See Also:
Constant Field Values

DELIMITER_ATTR_NAME

public static final String DELIMITER_ATTR_NAME
See Also:
Constant Field Values

DEFAULT_DELIMITER_ATTR_VALUE

private static final String DEFAULT_DELIMITER_ATTR_VALUE
See Also:
Constant Field Values

LOAD_FILE_DIR

private static String LOAD_FILE_DIR

wtProperties_

private WTProperties wtProperties_

delimiter_

private String delimiter_

user_

private String user_

csvDataRecords_

private ArrayList csvDataRecords_

creationLock__

private static Object creationLock__
Constructor Detail

LoadCsvData

public LoadCsvData()
Create an instance with no data.

Method Detail

userTransaction

public void userTransaction(String user)
Stores the login name

Parameters:
user - User supplies the administrator name and password.

getLoggedInUser

public String getLoggedInUser()

getCsvDataRecords

private ArrayList getCsvDataRecords()

initializeDirectiveClass

public static void initializeDirectiveClass(DirectiveServices directive_services)
                                     throws IOException
Forces migration data file pointer to be based on current source and target versions.

Throws:
IOException

getMigDataFile

private File getMigDataFile()

run

public void run()

addCsvDataRecord

public void addCsvDataRecord(String csv_data_record)
Sets the class name of the migrator to run.


asDomOn

public void asDomOn(Element element)
Specified by:
asDomOn in interface UpdateDirective

initializeFromDom

public void initializeFromDom(Element element)
Reads from DOMs formatted as described in the class documentation above.

Specified by:
initializeFromDom in interface UpdateDirective

getDirectiveName

private String getDirectiveName()
The name of the directive.


execute

public void execute(DirectiveServices directive_services)
             throws DirectiveExecutionException
Executes the inner class DataOutputter.

Specified by:
execute in interface UpdateDirective
Throws:
DirectiveExecutionException - if the class cannot be found, is not actually a Migrator, the instance cannot created due to visibility issues or because the class is abstract or an interface, or the migrator fails or returns a false return value