Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hi,
If you are trying to add as an attachment, then form the xml like below to load your document:
<csvdocument handler="wt.doc.LoadDoc.createGeneral">
<csvuser>User Name</csvuser>
<csvname>Name</csvname>
<csvtitle>Title</csvtitle>
<csvnumber>Document Number</csvnumber>
<csvtype>Document</csvtype>
<csvdescription>Document Description</csvdescription>
<csvdepartment>Department</csvdepartment>
<csvsavein>Directory or Folder name where you want to save your document</csvsavein> <csvteamtemplate></csvteamtemplate> <csvdomain></csvdomain>
<csvlifecycletemplate>Lifecycle template name</csvlifecycletemplate>
<csvlifecyclestate>Document state in the Lifecycle</csvlifecyclestate>
<csvtypedef>com.ge.appl.Document Type</csvtypedef>
<csvprimarycontenttype>Your Promary content if any</csvprimarycontenttype>
<csvpath></csvpath>
<csvformat></csvformat>
<csvcontdesc></csvcontdesc>
<csvversion>Revision</csvversion>
<csviteration>iteration of the document</csviteration>
<csvsecuritylabels></csvsecuritylabels>
</csvdocument>
<csvloadvalue handler="com.ptc.core.lwc.server.LoadAttValues.loadValue">
<csvname>Type Name</csvname>
<csvreftype></csvreftype>
<csvrefatt></csvrefatt>
<csvvalue>DATA|java.lang.String|Attribute value</csvvalue></csvloadvalue>
<csvendwtdocument handler="wt.doc.LoadDoc.endCreateWTDocument">
<csvprimarycontenttype>ApplicationData</csvprimarycontenttype>
<csvpath>/opt/ptc/Your document which you want to attache with the documnet type</csvpath>
<csvformat></csvformat>
<csvcontdesc></csvcontdesc>
<csvparentcontainerpath></csvparentcontainerpath>
</csvendwtdocument>
I know this is old but the answers didn't really explain it to me. I found out by experiment that you can load secondary content with the <csvContentFile> node. I actually use the CSVtoXML facility so my CSV looks like (an example)
#BeginWTDocument,name,title,number,type,description,department,saveIn,teamTemplate,domain,lifecycletemplate,lifecyclestate,typedef,version,iteration,securityLabels
BeginWTDocument,Process Requirements - Coarse Grinding at Point Henry,Process Requirements - Coarse Grinding at Point Henry,229TA001,Document,Process Requirements - Coarse Grinding at Point Henry,DESIGN,/Default/126 Process Plant - Point Henry/229 Coarse Grinding Plant/229 Technical Documents Coarse Grinding Plant/229TA - Technical Requirements Documents Coarse Grinding Plant,,,Regain Life Cycle,RELEASED,local.rs.vsrs05.Regain.TA,B,1,
#EndWTDocument,primarycontenttype,path,format,contdesc,parentContainerPath,,,,,,,,,,
EndWTDocument,ApplicationData,c:\temp\WTDocContent\229TA001-Process-Requirements-Coarse-Grinding-Plant-PH-vB 1.docx,,Finalized Document
#ContentFile,user,path
ContentFile,,c:\temp\WTDocContent\229TA001-Process-Requirements-Coarse-Grinding-Plant-PH-vB 1.pdf
Which generates XML
<NmLoader>
<csvBeginWTDocument handler="wt.doc.LoadDoc.beginCreateWTDocument" >
<csvname>Process Requirements - Coarse Grinding at Point Henry</csvname>
<csvtitle>Process Requirements - Coarse Grinding at Point Henry</csvtitle>
<csvnumber>229TA001</csvnumber>
<csvtype>Document</csvtype>
<csvdescription>Process Requirements - Coarse Grinding at Point Henry</csvdescription>
<csvdepartment>DESIGN</csvdepartment>
<csvsaveIn>/Default/126 Process Plant - Point Henry/229 Coarse Grinding Plant/229 Technical Documents Coarse Grinding Plant/229TA - Technical Requirements Documents Coarse Grinding Plant</csvsaveIn>
<csvteamTemplate></csvteamTemplate>
<csvdomain></csvdomain>
<csvlifecycletemplate>Regain Life Cycle</csvlifecycletemplate>
<csvlifecyclestate>RELEASED</csvlifecyclestate>
<csvtypedef>local.rs.vsrs05.Regain.TA</csvtypedef>
<csvversion>B</csvversion>
<csviteration>1</csviteration>
<csvsecurityLabels></csvsecurityLabels>
</csvBeginWTDocument>
<csvEndWTDocument handler="wt.doc.LoadDoc.endCreateWTDocument" >
<csvprimarycontenttype>ApplicationData</csvprimarycontenttype>
<csvpath>c:\temp\WTDocContent\229TA001-Process-Requirements-Coarse-Grinding-Plant-PH-vB 1.docx</csvpath>
<csvformat></csvformat>
<csvcontdesc>Finalized Document</csvcontdesc>
<csvparentContainerPath></csvparentContainerPath>
</csvEndWTDocument>
<csvContentFile handler="wt.load.LoadContent.createContentFile" >
<csvuser></csvuser>
<csvpath>c:\temp\WTDocContent\229TA001-Process-Requirements-Coarse-Grinding-Plant-PH-vB 1.pdf</csvpath>
</csvContentFile>
</NmLoader>
The first node creates the WTDocument of subtype local.rs.vsrs05.Regain.TA in our case. The next node attaches the primary content, which is a docx document in our case and the final node creates the secondary content the pdf in our case
The bulk load examples provided by PTC do not really point out that the node <csvEndWTDocument handler="wt.doc.LoadDoc.endCreateWTDocument" > creates the primary and the node <csvContentFile handler="wt.load.LoadContent.createContentFile" > the secondary. I interpreted that you required both nodes for a single primary content (which I now realise was a mistake). It certainly was not clear to me from this article Bulk Loading Documents in Windchill but now that I know it does actually contain all that you require.
Attached little PowerPoint which I made quite a while back may be helpful (specific to a certain lifecycle template - have to adjust for your states).