<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Add attchments using CSV import in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317454#M4455</link>
    <description>&lt;P&gt;Short answer: after a closer look to the CSV Import bundle, in the &lt;A href="https://github.com/nuxeo/nuxeo-csv/blob/master/src/main/java/org/nuxeo/ecm/csv/CSVImporterWork.java"&gt;CSVImporterWork&lt;/A&gt; class, there doesn't seem to have any way to handle another blob proeprty than the "file:content" one or, at least, one which is not part of a list or complex type property and still named "content".&lt;/P&gt;
&lt;P&gt;Explanation (but I might be wrong):
"files:files" is an array property, so should be handled as such in the CSV file. So, it SHOULD be something like:
Header: files:files
In the CSV line: "[{&amp;amp;quot;filename&amp;amp;quot;:&amp;amp;quot;name for file 1&amp;amp;quot;,&amp;amp;quot;file&amp;amp;quot;:&amp;amp;quot;file1.pdf&amp;amp;quot;},{&amp;amp;quot;filename&amp;amp;quot;:&amp;amp;quot;name for file 2&amp;amp;quot;,&amp;amp;quot;file&amp;amp;quot;:&amp;amp;quot;file2.docx&amp;amp;quot;}]"&lt;/P&gt;
&lt;P&gt;This is how it SHOULD be, from my understanding on how it works. As it is an array property, it would be handled by the "fieldType.isListType()" part, and then handled as a simple array, and not an array which could contain blobs to handle.
I tried the line I give before and I get an exception:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;java.lang.ClassCastException: org.codehaus.jackson.node.TextNode cannot be cast to org.codehaus.jackson.node.ObjectNode
	at org.nuxeo.ecm.automation.core.util.ComplexTypeJSONDecoder.decode(ComplexTypeJSONDecoder.java:121)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It means that the program tries to use a string as an object. So it does evaluate the &amp;amp;quot;file&amp;amp;quot;:&amp;amp;quot;file1.pdf&amp;amp;quot; as if it would be for a string property, not a blob.&lt;/P&gt;
&lt;P&gt;As it is right now, I'm not sure the CSV importer can handle your case, except by modifying it.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Nov 2015 14:28:11 GMT</pubDate>
    <dc:creator>Greg_Drayon</dc:creator>
    <dc:date>2015-11-17T14:28:11Z</dc:date>
    <item>
      <title>Add attchments using CSV import</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317451#M4452</link>
      <description>&lt;P&gt;Attachments can be added when creating documents from "Files tab", i want to do the same thing using a CSV file so i wonder what should I add as a property that refers to attachments in the CSV file.
I'm able to add the Main File using "file:content" property , I've tried to add "files:file:content" but it's not working. Any idea about this ?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2015 12:02:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317451#M4452</guid>
      <dc:creator>ITShine_</dc:creator>
      <dc:date>2015-10-05T12:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Add attchments using CSV import</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317452#M4453</link>
      <description>&lt;P&gt;I'm not sure to understand your question, but the "files" schema does not work like the "file" schema. "file" does have two attributes named filename and content, but files does not. It contains a list of items names files, with each item having two attributes&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 10:31:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317452#M4453</guid>
      <dc:creator>Greg_Drayon</dc:creator>
      <dc:date>2015-11-17T10:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Add attchments using CSV import</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317453#M4454</link>
      <description>&lt;P&gt;Thank you [Greg Drayon](https&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 13:37:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317453#M4454</guid>
      <dc:creator>ITShine_</dc:creator>
      <dc:date>2015-11-17T13:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Add attchments using CSV import</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317454#M4455</link>
      <description>&lt;P&gt;Short answer: after a closer look to the CSV Import bundle, in the &lt;A href="https://github.com/nuxeo/nuxeo-csv/blob/master/src/main/java/org/nuxeo/ecm/csv/CSVImporterWork.java"&gt;CSVImporterWork&lt;/A&gt; class, there doesn't seem to have any way to handle another blob proeprty than the "file:content" one or, at least, one which is not part of a list or complex type property and still named "content".&lt;/P&gt;
&lt;P&gt;Explanation (but I might be wrong):
"files:files" is an array property, so should be handled as such in the CSV file. So, it SHOULD be something like:
Header: files:files
In the CSV line: "[{&amp;amp;quot;filename&amp;amp;quot;:&amp;amp;quot;name for file 1&amp;amp;quot;,&amp;amp;quot;file&amp;amp;quot;:&amp;amp;quot;file1.pdf&amp;amp;quot;},{&amp;amp;quot;filename&amp;amp;quot;:&amp;amp;quot;name for file 2&amp;amp;quot;,&amp;amp;quot;file&amp;amp;quot;:&amp;amp;quot;file2.docx&amp;amp;quot;}]"&lt;/P&gt;
&lt;P&gt;This is how it SHOULD be, from my understanding on how it works. As it is an array property, it would be handled by the "fieldType.isListType()" part, and then handled as a simple array, and not an array which could contain blobs to handle.
I tried the line I give before and I get an exception:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;java.lang.ClassCastException: org.codehaus.jackson.node.TextNode cannot be cast to org.codehaus.jackson.node.ObjectNode
	at org.nuxeo.ecm.automation.core.util.ComplexTypeJSONDecoder.decode(ComplexTypeJSONDecoder.java:121)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It means that the program tries to use a string as an object. So it does evaluate the &amp;amp;quot;file&amp;amp;quot;:&amp;amp;quot;file1.pdf&amp;amp;quot; as if it would be for a string property, not a blob.&lt;/P&gt;
&lt;P&gt;As it is right now, I'm not sure the CSV importer can handle your case, except by modifying it.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 14:28:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317454#M4455</guid>
      <dc:creator>Greg_Drayon</dc:creator>
      <dc:date>2015-11-17T14:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Add attchments using CSV import</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317455#M4456</link>
      <description>&lt;P&gt;Okay, thank you so much [Greg Drayon](https&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 15:45:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317455#M4456</guid>
      <dc:creator>ITShine_</dc:creator>
      <dc:date>2015-11-17T15:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Add attchments using CSV import</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317456#M4457</link>
      <description>&lt;P&gt;Note that file&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 15:57:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317456#M4457</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2015-11-17T15:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Add attchments using CSV import</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317457#M4458</link>
      <description>&lt;P&gt;Thank you for the update. My knowledge might be a little bit outdated.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 16:00:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/add-attchments-using-csv-import/m-p/317457#M4458</guid>
      <dc:creator>Greg_Drayon</dc:creator>
      <dc:date>2015-11-17T16:00:21Z</dc:date>
    </item>
  </channel>
</rss>

