<?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 Nuxeo 5.6 to 5.8 =&amp;gt; RUN SCRIPT - REGRESSION on set list of blob - is it still an Array of Blob ??? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-6-to-5-8-gt-run-script-regression-on-set-list-of-blob-is/m-p/317702#M4703</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I got a multi-value blob document property that was perfectly set by a run script such as :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;if (WorkflowVariables["newFile"] != null){
java.util.Collections.addAll(Context["listBlob"], Document.getProperty("xpathofme:listBlobsOfMe"));
Context["listBlob"].add( WorkflowVariables["newFile"]  );
//THIS CODE FAILED IN 5.8
Document.doc.setPropertyValue("xpathofme:listBlobsOfMe", Context["listBlob"].toArray());
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;New exception in 5.8 :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Caused by: org.nuxeo.ecm.core.api.model.PropertyConversionException: Property Conversion failed from class java.util.ArrayList to interface org.nuxeo.ecm.core.api.Blob
    at org.nuxeo.ecm.core.api.model.impl.primitives.BlobProperty.normalize(BlobProperty.java:75)
    at org.nuxeo.ecm.core.api.model.impl.AbstractProperty.setValue(AbstractProperty.java:329)
    at org.nuxeo.ecm.core.api.model.impl.ComplexProperty.setValue(ComplexProperty.java:206)
    at org.nuxeo.ecm.core.api.model.impl.osm.ComplexMemberProperty.setValue(ComplexMemberProperty.java:69)
    at org.nuxeo.ecm.core.api.model.impl.ListProperty.setValue(ListProperty.java:253)
    at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.setPropertyValue(DocumentModelImpl.java:1498) 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;NOTHING changed in Nuxeo Studio... we just increase version from 5.6 to 5.8 and this list is STILL a blob-list. Do you know why the code doesn't works anymore ?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2013 10:34:13 GMT</pubDate>
    <dc:creator>milonette_</dc:creator>
    <dc:date>2013-12-03T10:34:13Z</dc:date>
    <item>
      <title>Nuxeo 5.6 to 5.8 =&gt; RUN SCRIPT - REGRESSION on set list of blob - is it still an Array of Blob ???</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-6-to-5-8-gt-run-script-regression-on-set-list-of-blob-is/m-p/317702#M4703</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I got a multi-value blob document property that was perfectly set by a run script such as :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;if (WorkflowVariables["newFile"] != null){
java.util.Collections.addAll(Context["listBlob"], Document.getProperty("xpathofme:listBlobsOfMe"));
Context["listBlob"].add( WorkflowVariables["newFile"]  );
//THIS CODE FAILED IN 5.8
Document.doc.setPropertyValue("xpathofme:listBlobsOfMe", Context["listBlob"].toArray());
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;New exception in 5.8 :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Caused by: org.nuxeo.ecm.core.api.model.PropertyConversionException: Property Conversion failed from class java.util.ArrayList to interface org.nuxeo.ecm.core.api.Blob
    at org.nuxeo.ecm.core.api.model.impl.primitives.BlobProperty.normalize(BlobProperty.java:75)
    at org.nuxeo.ecm.core.api.model.impl.AbstractProperty.setValue(AbstractProperty.java:329)
    at org.nuxeo.ecm.core.api.model.impl.ComplexProperty.setValue(ComplexProperty.java:206)
    at org.nuxeo.ecm.core.api.model.impl.osm.ComplexMemberProperty.setValue(ComplexMemberProperty.java:69)
    at org.nuxeo.ecm.core.api.model.impl.ListProperty.setValue(ListProperty.java:253)
    at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.setPropertyValue(DocumentModelImpl.java:1498) 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;NOTHING changed in Nuxeo Studio... we just increase version from 5.6 to 5.8 and this list is STILL a blob-list. Do you know why the code doesn't works anymore ?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 10:34:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-6-to-5-8-gt-run-script-regression-on-set-list-of-blob-is/m-p/317702#M4703</guid>
      <dc:creator>milonette_</dc:creator>
      <dc:date>2013-12-03T10:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Nuxeo 5.6 to 5.8 =&gt; RUN SCRIPT - REGRESSION on set list of blob - is it still an Array of Blob ???</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-6-to-5-8-gt-run-script-regression-on-set-list-of-blob-is/m-p/317703#M4704</link>
      <description>&lt;P&gt;&lt;CODE&gt;Document.getProperty("xpathofme:listBlobsOfMe")&lt;/CODE&gt; now consistently returns an array for array-like values, whereas in Nuxeo 5.6 it may have returned a list.&lt;/P&gt;
&lt;P&gt;So your first &lt;CODE&gt;addAll&lt;/CODE&gt; adds to &lt;CODE&gt;Context["listBlob"]&lt;/CODE&gt; a single element which is an array, instead of adding all the elements of the array. You should rework that part.&lt;/P&gt;
&lt;P&gt;BTW you don't need the &lt;CODE&gt;.toArray()&lt;/CODE&gt; in the last statement, Nuxeo will work fine if you pass either an array or a list to &lt;CODE&gt;setPropertyValue&lt;/CODE&gt; and will normalize the value passed.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2013 16:42:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-6-to-5-8-gt-run-script-regression-on-set-list-of-blob-is/m-p/317703#M4704</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2013-12-10T16:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Nuxeo 5.6 to 5.8 =&gt; RUN SCRIPT - REGRESSION on set list of blob - is it still an Array of Blob ???</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-6-to-5-8-gt-run-script-regression-on-set-list-of-blob-is/m-p/317704#M4705</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 16:32:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-6-to-5-8-gt-run-script-regression-on-set-list-of-blob-is/m-p/317704#M4705</guid>
      <dc:creator>milonette_</dc:creator>
      <dc:date>2014-02-14T16:32:28Z</dc:date>
    </item>
  </channel>
</rss>

