Skip to main content
1-Visitor
February 2, 2013
Question

Loader :Manage multiple attachment with csv format

  • February 2, 2013
  • 1 reply
  • 2842 views

Hi,

My customer want to use a csv format to load softype document with primary content and multiple files attachment. My goal consist to obtain an xml file with a primary section for create document, a secondary section for iba and standard attributes, a third section for attachmenst and the end section for primary content. Question : how to specify multiple attachments files in the input csv file format? Can i use CSV2XML utility to generate such xml file?

Thank's.

Nicolas

1 reply

12-Amethyst
February 4, 2013

Hi Nicolas,

using CSV2XML utility you an create this kind of xml 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.SubOfRef</csvtypedef>

<csvversion></csvversion>

<csviteration></csviteration>

</csvBeginWTDocument>

<csvIBAValue handler="wt.iba.value.service.LoadValue.createIBAValue" >

<csvdefinition>MyAttrs</csvdefinition>

<csvvalue1>false</csvvalue1>

<csvvalue2></csvvalue2>

<csvdependency_id></csvdependency_id>

</csvIBAValue>

<csvIBAValue handler="wt.iba.value.service.LoadValue.createIBAValue" >

<csvdefinition>MyAttrs</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>

1-Visitor
March 8, 2013

Hi kaushik,

following the format of your XML-file I receive the error:

"Update Document failed: LoadDoc - Failed to save content for file_path = test2.xls

Loader method wt.doc.LoadDoc.endCreateWTDocument reported a failure

..."

I tried to insert the complete path, to put the file in different directories etc, always receiving the same error.

Where do you typically store the files which need to be imported?

Thanks

Anusch

12-Amethyst
March 11, 2013

Sorry for late reply You should keep your primary content inside <Windchill Home>\Windchill\loadFiles\content