10-05-2015 08:02 AM
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 ?
11-17-2015 05:31 AM
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
11-17-2015 08:37 AM
Thank you [Greg Drayon](https
11-17-2015 09:28 AM
Short answer: after a closer look to the CSV Import bundle, in the CSVImporterWork 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".
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: "[{"filename":"name for file 1","file":"file1.pdf"},{"filename":"name for file 2","file":"file2.docx"}]"
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:
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)
It means that the program tries to use a string as an object. So it does evaluate the "file":"file1.pdf" as if it would be for a string property, not a blob.
As it is right now, I'm not sure the CSV importer can handle your case, except by modifying it.
11-17-2015 10:45 AM
Okay, thank you so much [Greg Drayon](https
11-17-2015 10:57 AM
Note that file
11-17-2015 11:00 AM
Thank you for the update. My knowledge might be a little bit outdated.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.