Enterprise Administration > Windchill Data Loading > Loading Product Objects and Parts: Windchill PDMLink Example > Loading Documents
  
Loading Documents
Loading Documents in a Library
The following is an example of how to load documents in to a library. In this example, there is a library named TestIssues in an organization called MyOrg.
Example
<?xml version="1.0" ?><!DOCTYPE NmLoader SYSTEM "standardX20.dtd">
<NmLoader>
<csvBeginWTDocument handler="wt.doc.LoadDoc.beginCreateWTDocument" >
<csvname>Test Doc 11</csvname>
<csvtitle>Test Doc 11</csvtitle>
<csvnumber>TD11</csvnumber>
<csvtype>Document</csvtype>
<csvdescription>description text</csvdescription>
<csvdepartment>DESIGN</csvdepartment>
<csvsaveIn>/Default</csvsaveIn>
<csvteamTemplate></csvteamTemplate>
<csvdomain></csvdomain>
<csvlifecycletemplate></csvlifecycletemplate>
<csvlifecyclestate></csvlifecyclestate>
<csvtypedef></csvtypedef>
<csvversion>A</csvversion>
<csviteration>1</csviteration>
</csvBeginWTDocument>

<csvEndWTDocument handler="wt.doc.LoadDoc.endCreateWTDocument" >
<csvprimarycontenttype>ApplicationData</csvprimarycontenttype>
<csvpath>DGadReq.doc</csvpath>
<csvformat></csvformat>
<csvcontdesc></csvcontdesc>
<csvparentContainerPath></csvparentContainerPath>
</csvEndWTDocument>

</NmLoader>
The following command can then be used to load a document with name Test Doc 11 and number TD11 into the root folder of the library called TestIssues:
D:\10.0\Windchill>windchill wt.load.LoadFromFile -d d:\10.0\
Windchill\loadFiles\TestDoc.xml -CONT_PATH \ "/wt.inf.container.
OrgContainer=MyOrg/wt.inf.library.WTLibrary=TestIssues\"
The following command can be used to load a document into a product:
D:\10.0\Windchill>windchill wt.load.LoadFromFile -d d:\10.0\
Windchill\loadFiles\TestDoc.xml -CONT_PATH \ "/wt.inf.container.
OrgContainer=MyOrg/wt.pdmlink.PDMLinkProduct=TestProduct\"
* 
If you want to load the document in a subfolder called Folder1 in the library, you would use the following for the csvSaveIn field of the XML file: /Default/Folder1
Given this, the XML file would appear as the following example:
Example
<?xml version="1.0" ?><!DOCTYPE NmLoader SYSTEM "standardX20.dtd">
<NmLoader>
<csvBeginWTDocument handler="wt.doc.LoadDoc.beginCreateWTDocument" >
<csvname>Test Doc 11</csvname>
<csvtitle>Test Doc 11</csvtitle>
<csvnumber>TD11</csvnumber>
<csvtype>Document</csvtype>
<csvdescription>description text</csvdescription>
<csvdepartment>DESIGN</csvdepartment>
<csvsaveIn>/Default/Folder1</csvsaveIn>
<csvteamTemplate></csvteamTemplate>
<csvdomain></csvdomain>
<csvlifecycletemplate></csvlifecycletemplate>
<csvlifecyclestate></csvlifecyclestate>
<csvtypedef></csvtypedef>
<csvversion>A</csvversion>
<csviteration>1</csviteration>
</csvBeginWTDocument>

<csvEndWTDocument handler="wt.doc.LoadDoc.endCreateWTDocument" >
<csvprimarycontenttype>ApplicationData</csvprimarycontenttype>
<csvpath>DGadReq.doc</csvpath>
<csvformat></csvformat>
<csvcontdesc></csvcontdesc>
<csvparentContainerPath></csvparentContainerPath>
</csvEndWTDocument>

</NmLoader>
Loading Documents that Are Subtypes of an Out-of-the-box Type
Following is an example of how to load documents that are subtypes of an out-of-the-box type.
This example assumes the following:
A library called MyLib exists and contain a folder called Folder1.
A subtype of the out-of-the-box reference document called SubOfRef was created with two attributes:
MBool, a boolean value
MString, a string
An organization called MyOrg exists.
Given these assumptions, the load can be performed using the following command:
windchill wt.load.LoadFromFile -d C:\Path\To\MyFile.xml -u wcadmin
-p wcadmin -CONT_PATH \"/wt.inf.container.OrgContainer=MyOrg/wt.inf.
library.WTLibrary=MyLib\"
Example
The following is an example data file:
<?xml version="1.0" ?><!DOCTYPE NmLoader SYSTEM "standardX20.dtd">
<NmLoader>
<csvBeginWTDocument handler="wt.doc.LoadDoc.beginCreateWTDocument" >
<csvname>Name of SoftType Load - 01</csvname>
<csvtitle>Title of SoftType Load - 01</csvtitle>
<csvnumber>NUM:SoftType-01</csvnumber>
<csvtype>Document</csvtype>
<csvdescription>description 1112-002</csvdescription>
<csvdepartment>DESIGN</csvdepartment>
<csvsaveIn>/Default/Folder1</csvsaveIn>
<csvteamTemplate></csvteamTemplate>
<csvdomain></csvdomain>
<csvlifecycletemplate></csvlifecycletemplate>
<csvlifecyclestate></csvlifecyclestate>
<csvtypedef>com.ptc.ReferenceDocument|com.ptc.SubOfRef</csvtypedef>
<csvversion></csvversion>
<csviteration></csviteration>
</csvBeginWTDocument>

<csvIBAValue handler="wt.iba.value.service.LoadValue.createIBAValue" >
<csvdefinition>MyAttrs/MBool</csvdefinition>
<csvvalue1>false</csvvalue1>
<csvvalue2></csvvalue2>
<csvdependency_id></csvdependency_id>
</csvIBAValue>

<csvIBAValue handler="wt.iba.value.service.LoadValue.createIBAValue" >
<csvdefinition>MyAttrs/MString</csvdefinition>
<csvvalue1>Eleven</csvvalue1>
<csvvalue2></csvvalue2>
<csvdependency_id></csvdependency_id>
</csvIBAValue>

<csvEndWTDocument handler="wt.doc.LoadDoc.endCreateWTDocument" >
<csvprimarycontenttype>ApplicationData</csvprimarycontenttype>
<csvpath>EGadWork.xls</csvpath>
<csvformat></csvformat>
<csvcontdesc></csvcontdesc>
<csvparentContainerPath></csvparentContainerPath>
</csvEndWTDocument>

</NmLoader>
In this example, the type definition for the Sub0Ref subtype includes both the complete subtype name (including the prefix of com.ptc., which helps define the type; in this case, com.ptc.Sub0Ref) and the parent subtype com.ptc.ReferenceDocument (which has the same prefix).
For information about the prefix that is required when creating subtypes, see Context Data Types and Attributes.