Skip to main content
1-Visitor
Feb 2, 2013 9:54 AM UTC
Question

Loader :Manage multiple attachment with csv format

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

5 replies

12-Amethyst
Feb 4, 2013 8:34 AM UTC

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>

Translate
1-Visitor
Mar 8, 2013 3:19 PM UTC

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

Translate
12-Amethyst
Mar 11, 2013 12:30 PM UTC

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

Translate