<?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  string to a list String property in pure Studio/automation in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/add-string-to-a-list-string-property-in-pure-studio-automation/m-p/320203#M7204</link>
    <description>&lt;P&gt;The following solution is not the most maintainable one (it uses prefixed java classes, even if it is quite stable packages)but works and is 100% Studio&lt;/P&gt;
&lt;P&gt;Here is how I did it:&lt;/P&gt;
&lt;HR /&gt;
&lt;UL&gt;
&lt;LI&gt;Fetch &amp;gt; something&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I get the document that stores the list&lt;/P&gt;
&lt;HR /&gt;
&lt;UL&gt;
&lt;LI&gt;Execution Context &amp;gt; Set Context Variable&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;parameters:&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;name: listOfSringTmp
Value: @{new java.util.ArrayList()}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Temporary variable where the list of all elements will be stored.&lt;/P&gt;
&lt;HR /&gt;
&lt;UL&gt;
&lt;LI&gt;Scripting &amp;gt; Run Script&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;parameters:&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;script: java.util.Collections.addAll(Context["listOfSringTmp"], Document.getProperty("mySchema:myField"))
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;We add values stored into your document&lt;/P&gt;
&lt;HR /&gt;
&lt;UL&gt;
&lt;LI&gt;Scripting &amp;gt; Run Script&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;parameters:&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;script: Context["listOfSringTmp"].add("MyNewValue")
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And we add the new value&lt;/P&gt;
&lt;HR /&gt;
&lt;UL&gt;
&lt;LI&gt;Scripting &amp;gt; Run Script&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;parameters:&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;script: Document.doc.setPropertyValue("mySchema:myField", Context["listOfSringTmp"].toArray())
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And we set back the list into the document&lt;/P&gt;
&lt;HR /&gt;
&lt;UL&gt;
&lt;LI&gt;Document &amp;gt; Save&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I save my modification.&lt;/P&gt;
&lt;HR /&gt;</description>
    <pubDate>Mon, 12 Nov 2012 17:59:41 GMT</pubDate>
    <dc:creator>Benjamin_Jalon1</dc:creator>
    <dc:date>2012-11-12T17:59:41Z</dc:date>
    <item>
      <title>Add  string to a list String property in pure Studio/automation</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/add-string-to-a-list-string-property-in-pure-studio-automation/m-p/320202#M7203</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I would like to add string into a property defined into a document type without new operation definition.&lt;/P&gt;
&lt;P&gt;We can't easily add the item as:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the object returned by Document.getProperty("mySchema:myField") is a String[]&lt;/LI&gt;
&lt;LI&gt;the set property operation manage only scalar values&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2012 17:47:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/add-string-to-a-list-string-property-in-pure-studio-automation/m-p/320202#M7203</guid>
      <dc:creator>Benjamin_Jalon1</dc:creator>
      <dc:date>2012-11-12T17:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Add  string to a list String property in pure Studio/automation</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/add-string-to-a-list-string-property-in-pure-studio-automation/m-p/320203#M7204</link>
      <description>&lt;P&gt;The following solution is not the most maintainable one (it uses prefixed java classes, even if it is quite stable packages)but works and is 100% Studio&lt;/P&gt;
&lt;P&gt;Here is how I did it:&lt;/P&gt;
&lt;HR /&gt;
&lt;UL&gt;
&lt;LI&gt;Fetch &amp;gt; something&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I get the document that stores the list&lt;/P&gt;
&lt;HR /&gt;
&lt;UL&gt;
&lt;LI&gt;Execution Context &amp;gt; Set Context Variable&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;parameters:&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;name: listOfSringTmp
Value: @{new java.util.ArrayList()}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Temporary variable where the list of all elements will be stored.&lt;/P&gt;
&lt;HR /&gt;
&lt;UL&gt;
&lt;LI&gt;Scripting &amp;gt; Run Script&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;parameters:&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;script: java.util.Collections.addAll(Context["listOfSringTmp"], Document.getProperty("mySchema:myField"))
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;We add values stored into your document&lt;/P&gt;
&lt;HR /&gt;
&lt;UL&gt;
&lt;LI&gt;Scripting &amp;gt; Run Script&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;parameters:&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;script: Context["listOfSringTmp"].add("MyNewValue")
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And we add the new value&lt;/P&gt;
&lt;HR /&gt;
&lt;UL&gt;
&lt;LI&gt;Scripting &amp;gt; Run Script&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;parameters:&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;script: Document.doc.setPropertyValue("mySchema:myField", Context["listOfSringTmp"].toArray())
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And we set back the list into the document&lt;/P&gt;
&lt;HR /&gt;
&lt;UL&gt;
&lt;LI&gt;Document &amp;gt; Save&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I save my modification.&lt;/P&gt;
&lt;HR /&gt;</description>
      <pubDate>Mon, 12 Nov 2012 17:59:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/add-string-to-a-list-string-property-in-pure-studio-automation/m-p/320203#M7204</guid>
      <dc:creator>Benjamin_Jalon1</dc:creator>
      <dc:date>2012-11-12T17:59:41Z</dc:date>
    </item>
  </channel>
</rss>

