<?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: How to foreach an array returned from a Java class in a html webscript? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285650#M238780</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;where would you like to run your javascript in ?&lt;/P&gt;&lt;P&gt;If it is in server side ,you already use java backed webscript,you don't need javascript.&lt;/P&gt;&lt;P&gt;If it is running in share you can do it like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = remote.call("/you webscript url");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var items = JSON.parse(result),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i = 0, ii = items.length; i &amp;lt; ii; i++)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var item = items[i];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Nov 2016 12:31:50 GMT</pubDate>
    <dc:creator>kaynezhang</dc:creator>
    <dc:date>2016-11-09T12:31:50Z</dc:date>
    <item>
      <title>How to foreach an array returned from a Java class in a html webscript?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285645#M238775</link>
      <description>Hello,I have created a webscript and Java class which return some data.The data is a JSONObject {"data": [{.....}]) which present an array. So, I want somehow to foreach the data in the html.1st how I can use this JSONObject which comes from Java in a javascript file and after that to foreach it in</description>
      <pubDate>Wed, 09 Nov 2016 08:50:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285645#M238775</guid>
      <dc:creator>mbel</dc:creator>
      <dc:date>2016-11-09T08:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to foreach an array returned from a Java class in a html webscript?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285646#M238776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The syntax should be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14786870358896037 jive_text_macro" data-hasrefreshed="true" data-renderedposition="85.85000610351562_8_1153_144" jivemacro_uid="_14786870358896037"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;lt;#if items??&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;lt;ul&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;#list items as item&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;${item.name}&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/#list&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/ul&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; &amp;lt;#else&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt;Empty&amp;lt;/p&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; &amp;lt;#if&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One additional thing you have to keep in mind is that a JSONObject or arbitrary Java object may not be iterable in FreeMarker. The best types for handling sequences in FTL are Collection or array types.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 10:24:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285646#M238776</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2016-11-09T10:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to foreach an array returned from a Java class in a html webscript?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285647#M238777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I changed to your syntax and now I have the below error.&lt;/P&gt;&lt;P&gt;Caused by: freemarker.core.ParseException: &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Unknown directive: #if. Help (latest version): &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://freemarker.org/docs/ref_directive_alphaidx.html;" rel="nofollow noopener noreferrer" target="_blank"&gt;http://freemarker.org/docs/ref_directive_alphaidx.html;&lt;/A&gt;&lt;SPAN&gt; you're using FreeMarker 2.3.20.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to mention that I have generated maven alfresco amp archetype, so I havent made any custom changes concerning FreeMarker.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please tell me also how I can use the returned object from java in webscript js file?&lt;/P&gt;&lt;P&gt;Because if I am not able to use the FreeMarker, I can foreach the data in the js.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 11:53:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285647#M238777</guid>
      <dc:creator>mbel</dc:creator>
      <dc:date>2016-11-09T11:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to foreach an array returned from a Java class in a html webscript?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285648#M238778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The above exception was because in your syntax the last &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&amp;lt;#if&amp;gt;&lt;/SPAN&gt; should be a closing tag.&lt;/P&gt;&lt;P&gt;However, Could you please answer me to the above question regarding the js file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 12:11:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285648#M238778</guid>
      <dc:creator>mbel</dc:creator>
      <dc:date>2016-11-09T12:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to foreach an array returned from a Java class in a html webscript?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285649#M238779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;B&gt;Axel Faust&lt;/B&gt;​ Missed character / in the end&amp;nbsp; &amp;lt;/#if&amp;gt; tag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;#if items??&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;ul&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;#list items as item&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;${item.name}&amp;lt;/li&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/#list&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/ul&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;#else&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt;Empty&amp;lt;/p&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &amp;lt;/#if&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 12:12:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285649#M238779</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2016-11-09T12:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to foreach an array returned from a Java class in a html webscript?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285650#M238780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;where would you like to run your javascript in ?&lt;/P&gt;&lt;P&gt;If it is in server side ,you already use java backed webscript,you don't need javascript.&lt;/P&gt;&lt;P&gt;If it is running in share you can do it like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = remote.call("/you webscript url");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var items = JSON.parse(result),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i = 0, ii = items.length; i &amp;lt; ii; i++)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var item = items[i];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 12:31:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285650#M238780</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2016-11-09T12:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to foreach an array returned from a Java class in a html webscript?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285651#M238781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please provide documentation about remote api?&lt;/P&gt;&lt;P&gt;I receive error message that remote is not defined:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Segoe UI', Tahoma, sans-serif; font-size: 12px;"&gt;Uncaught ReferenceError: remote is not defined&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 13:41:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285651#M238781</guid>
      <dc:creator>mbel</dc:creator>
      <dc:date>2016-11-09T13:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to foreach an array returned from a Java class in a html webscript?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285652#M238782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Documentation can be found in docs.alfresco.com for &lt;A href="http://docs.alfresco.com/5.1/references/APISurf-rootscoped.html" rel="nofollow noopener noreferrer"&gt;Surf&lt;/A&gt; and &lt;A href="http://docs.alfresco.com/5.1/references/API-JS-rootscoped.html" rel="nofollow noopener noreferrer"&gt;Repository&lt;/A&gt;-tier. The fact that "remote" is not defined means that your web script is run on Repository-tier (not in Share) which does not provide this object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 14:07:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285652#M238782</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2016-11-09T14:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to foreach an array returned from a Java class in a html webscript?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285653#M238783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, its not in Share.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 15:16:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285653#M238783</guid>
      <dc:creator>mbel</dc:creator>
      <dc:date>2016-11-09T15:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to foreach an array returned from a Java class in a html webscript?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285654#M238784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;instead of remote.call method, can I use ${JsonObjectFromJava} somehow.&lt;/P&gt;&lt;P&gt;Something like that -&amp;gt; &lt;SPAN style="color: #727174; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;var items = JSON.parse(${JsonObjectFromJava})?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 21:35:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285654#M238784</guid>
      <dc:creator>mbel</dc:creator>
      <dc:date>2016-11-09T21:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to foreach an array returned from a Java class in a html webscript?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285655#M238785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try &lt;STRONG&gt;jsonUtils.toJSONObject(&lt;SPAN style="color: #727174; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;JsonObjectFromJava)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2016 03:10:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-foreach-an-array-returned-from-a-java-class-in-a-html/m-p/285655#M238785</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2016-11-10T03:10:45Z</dc:date>
    </item>
  </channel>
</rss>

