wt.load
Class BasicLoader

java.lang.Object
  extended bywt.load.BasicLoader
Direct Known Subclasses:
DemoLoader, DeveloperLoader, MigrationDataLoader

public class BasicLoader
extends Object

Information on how to localize the titles of your csv files. The DTD in this package describes the fields. You can specify the title in one of three ways. 1. the name of the file. Omitting the title, rbInfo and key fields will make the loader use the csv file name as the load name e.g. entry in xml file : the loader replies: Do you want to load dataformats.csv (y/n)? 2. the title (will not be localized) e.g. entry in xml file : the loader replies: Do you want to load data formats (y/n)? 3. an rbInfo e.g. entry in xml file : entry in rbinfo : dataformats_csv_title.value=data formats the loader replies: Do you want to load data formats (y/n)? If the entry is not in the rbInfo, then it will try to get the title. If the title is omitted, then it will use the filename. By using an rbInfo, the text will be localized.


Field Summary
private  boolean customLoad
           
protected static boolean DEBUG
           
(package private) static String DEFAULT_LOADSET_DIR
           
private  String[] FILENAME_DESC
           
private  String[] FILENAMES
           
(package private) static Hashtable g_commandLine
           
(package private) static String g_userAdminName
           
 Installer installService
           
private  String loadSetContainerPath
           
protected static WTProperties localProps
           
private  String OPENING_MESSAGE
           
 
Constructor Summary
BasicLoader()
          Empty Constructor.
BasicLoader(String[] args, String opening, String[] files, String[] file_desc)
          This is the constructor for the Install Loader which setups the appropriate files to install and the mode in which it is to install.
 
Method Summary
private  void calculateLoadSetContainerPath(Document doc)
           
protected  void doInstall()
          This method is a general install method which may be overridden by solutions, but in general should be used as is defined in this file.
protected  void doPostInstall()
          This method handles any post installation steps that maybe required by a solution.
protected  void installFiles(ArrayList load_files)
          This install will perform the current install for Windchill.
private  ArrayList loadXMLProperties(String fileResource)
          This method will load a given XML file, parse the file and return an array list of its contents.
private  ArrayList parseSubNodes(XPathFactory factory_, Document doc, String path)
          This will parse the loadfilelist node for all of the loadFile nodes and return the all of the node's attributes in a vector which is contained in an arraylist to preserve order.
private static void PP(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

installService

public Installer installService

g_userAdminName

static String g_userAdminName

g_commandLine

static Hashtable g_commandLine

FILENAMES

private String[] FILENAMES

FILENAME_DESC

private String[] FILENAME_DESC

customLoad

private boolean customLoad

DEFAULT_LOADSET_DIR

static String DEFAULT_LOADSET_DIR

DEBUG

protected static boolean DEBUG

localProps

protected static WTProperties localProps

OPENING_MESSAGE

private String OPENING_MESSAGE

loadSetContainerPath

private String loadSetContainerPath
Constructor Detail

BasicLoader

public BasicLoader()
            throws Exception
Empty Constructor.


BasicLoader

public BasicLoader(String[] args,
                   String opening,
                   String[] files,
                   String[] file_desc)
            throws Exception
This is the constructor for the Install Loader which setups the appropriate files to install and the mode in which it is to install. Subclasses of BasicInstaller should call this installer.

If -UAOps or -Unattended is passed as an argument to the installer, then the install will be performed in an unattended fastion.

If -NoServerStop is passed as an argument the method servers will not be shutdown before loading.

The important arguments below are the file definitions and the file descriptions. The file definitions is an array of String in which each value represents the resource of the XML configuration file.

Parameters:
args - The command line arguments.
opening - The opening Message to display for the loader
files - The list of XML file resources to load in the loader
file_desc - The description for each XML file
Method Detail

doPostInstall

protected void doPostInstall()
                      throws Exception
This method handles any post installation steps that maybe required by a solution. The default method will prompt to restart the servers and then exit the loader.

Throws:
Exception

doInstall

protected void doInstall()
                  throws Exception
This method is a general install method which may be overridden by solutions, but in general should be used as is defined in this file. It will determine whether the install is to be done unattended, and will install the administrative user if they do not exist already in the Windchill system. If Windchill is running, the Method Servers and Server Managers will be shutdown for the loading. Then each of the files which were defined in the constructor are loaded into the system in the order in which they were defined.

Throws:
Exception

loadXMLProperties

private ArrayList loadXMLProperties(String fileResource)
                             throws Exception
This method will load a given XML file, parse the file and return an array list of its contents.

Throws:
Exception - The exception thrown if there is an error initializing

calculateLoadSetContainerPath

private void calculateLoadSetContainerPath(Document doc)
                                    throws XPathException,
                                           WTException
Throws:
XPathException
WTException

parseSubNodes

private ArrayList parseSubNodes(XPathFactory factory_,
                                Document doc,
                                String path)
                         throws Exception
This will parse the loadfilelist node for all of the loadFile nodes and return the all of the node's attributes in a vector which is contained in an arraylist to preserve order.

Throws:
Exception

installFiles

protected void installFiles(ArrayList load_files)
                     throws Exception
This install will perform the current install for Windchill. In the case of a solution the solution might override this method with their own, however this should suffice for most installs.

Throws:
Exception

PP

private static void PP(String s)