Enterprise Administration > Windchill Data Loading > Loading Product Objects and Parts: Windchill PDMLink Example > Creating Library Containers
  
Creating Library Containers
* 
Do not use the default administrator account to create a library container. Instead, use an account that is a library creator for the organization where you are creating the container. Additionally, do not add the default administrator account as a team member of the container. For details, see Loading Product Objects and Parts: Before You Begin.
Assuming the XML data below resides in a file called DataFile, it can be used to load a library with the following command:
windchill wt.load.LoadFromFile -d DataFile.xml -u librarycreator -p librarycreator
-CONT_PATH /wt.inf.container.OrgContainer=MyOrg
Example
The following is an example data file:
<?xml version="1.0"?>
<!DOCTYPE NmLoader SYSTEM "standardX20.dtd">
<NmLoader>
<csvContainer handler="wt.inf.container.LoadContainer.createContainer">
<csvcontainClass>wt.inf.library.WTLibrary</csvcontainerClass>
<csvcontainerName>Loaded Library</csvcontainerName>
<csvsharedTeamName>Shared Team 2</csvsharedTeamName>
<csvcontainerExtendable>true</csvcontainerExtendable>
<csvparentContainerPath></csvparentContainerPath>
<csvcontainerTemplateRef>General Library</csvcontainerTemplateRef>
<csvbusinessNamespace>false</csvbusinessNamespace>
<csvsharingEnabled>true</csvsharingEnabled>
<csvcreator>librarycreator</csvcreator>
<csvowner>librarycreator</csvowner>
<csvsubscriber>true</csvsubscriber>
<csvconferencingURL></csvconferencingURL>
<csvdescription>Loaded library</csvdescription>
<csvorganization></csvorganization>
<csvcreatorSelector></csvcreatorSelector>
</csvContainer>
</NmLoader>
<csvsharedTeamName>Shared Team 2</csvsharedTeamName> and <csvcontainerExtendable>true</csvcontainerExtendable> are optional. Include these only when you want to include a shared team in your load data.
Example
The following is an example batch file:
echo *************************************************
echo ** Variable Setup
echo *************************************************
set tmp_org=/wt.inf.container.OrgContainer=My Organization
echo *************************************************
echo ** Load Libraries
echo *************************************************
windchill wt.load.LoadFromFile -d libraries.xml -u librarycreator -p librarycreator
-CONT_PATH \"%tmp_org%\"
* 
Use the -u and -p parameters in batch files to eliminate the logon window.
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\"
* 
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.