Enterprise Administration > Windchill Data Loading > Introduction to Data Loading and the LoadFromFile Framework > Overview of Load Utilities > About the LoadFromFile Framework
  
About the LoadFromFile Framework
The Windchill LoadFromFile framework performs the work of reading data from files and converting it to name-value pairs (represented as Hashtable), which are processed by the object loaders. In addition, the load framework provides some helper methods, which can be used by the loaders. Object loaders perform the actual work of creating the object, setting attributes on it, and persisting it to the database.
The framework uses some classes from the import/export framework. However, in most cases, the worker classes (that is, object loaders for load and object handlers for import and export) are separate and expect data in different XML format. In other words, the XML schema is different.
LoadFromFile is a framework that can be used to load data into your own site classes. The wt.doc.LoadDoc.java source file is included as an example of how to use the load package.
LoadFromFile in the main or command line call, or the doFileLoad method call, use the following parameters to load data into the system:
Data File (required)—Contains data to be loaded and resides on the method server host. The data file is a required parameter. If the string is null or not on the command line, the load fails. It is recommended that you include the full path name of the file. If the full path is not provided, the method attempts to read the file in the directory in which the load was started.
User (optional)—Specifies the user to execute the method if no user is given in the line from the data file.
The command line does not use the -u user option so no user is preset. The main in LoadFromFile calls SessionHelper.manager.getPrincipal() to prompt for a user and perform the authentication. The doFileLoad still has the user passed in, but it can be null. Demo and Developer authenticate before they call doFileLoad. It is recommended that you authenticate a user before calling doFileLoad, because it does not authenticate the user. The user would eventually be authenticated when the server side attempts to setPrincipal using the user passed in from doFileLoad, but the error messaging is best handled on the client side before calling doFileLoad.
User Password (optional)—Specifies the password for the authenticating user.
CONT_PATH—Specifies the target container for the data. The default target container is Exchange.
To run LoadFromFile from the command line, be sure that the server manager and method server are running and then call:
windchill wt.load.LoadFromFile -d c:\ptc\Windchill\loadfiles\ReqDocs.xml
-CONT_PATH \
"/wt.inf.container.OrgContainer=TST/wt.pdmlink.PDMLinkProduct=part 4\"