<?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: FTL, JSON best practice question in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/ftl-json-best-practice-question/m-p/223909#M177039</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It depends what "complex routines" you're talking about. Freemarker is heavily optimised for string manipulation, so it that's what you need you might be better off doing that in the template. However, mathematical operations, lots of nested IFs, etc. are better off in Java or JavaScript where they can be compiled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Take a look through the webscripts for Share (in the Share war and in the slingshot namespace on the Repo) for examples.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Jul 2010 07:44:36 GMT</pubDate>
    <dc:creator>mikeh</dc:creator>
    <dc:date>2010-07-12T07:44:36Z</dc:date>
    <item>
      <title>FTL, JSON best practice question</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/ftl-json-best-practice-question/m-p/223907#M177037</link>
      <description>I am curious. how many of you find the need to create complex FTL templates? Specifically, do you find the need to use advance features of the FTL language?Or do you simply grab the data in XML or JSON format and then do whatever you need?Or do you do simple FTL and perform more complex routines in</description>
      <pubDate>Sun, 11 Jul 2010 17:09:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/ftl-json-best-practice-question/m-p/223907#M177037</guid>
      <dc:creator>southpointtech</dc:creator>
      <dc:date>2010-07-11T17:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: FTL, JSON best practice question</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/ftl-json-best-practice-question/m-p/223908#M177038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Personally I prefer the pattern where we do all the "heavy" lifting in Java (or occasionaly Java Script) and then only use freemarker for the presentation of the data.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Jul 2010 19:41:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/ftl-json-best-practice-question/m-p/223908#M177038</guid>
      <dc:creator>mrogers</dc:creator>
      <dc:date>2010-07-11T19:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: FTL, JSON best practice question</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/ftl-json-best-practice-question/m-p/223909#M177039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It depends what "complex routines" you're talking about. Freemarker is heavily optimised for string manipulation, so it that's what you need you might be better off doing that in the template. However, mathematical operations, lots of nested IFs, etc. are better off in Java or JavaScript where they can be compiled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Take a look through the webscripts for Share (in the Share war and in the slingshot namespace on the Repo) for examples.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jul 2010 07:44:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/ftl-json-best-practice-question/m-p/223909#M177039</guid>
      <dc:creator>mikeh</dc:creator>
      <dc:date>2010-07-12T07:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: FTL, JSON best practice question</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/ftl-json-best-practice-question/m-p/223910#M177040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Although i think that Alfrescos webscripting framework is rather elegant, there are some cases where i prefer to bypass that DeclarativeWebScript/Freemarker combo:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;When my primary and only output target is some complex JSON, i prefer to directly create JSON objects (using AbstractWebScript instead of DeclarativeWebScript). Otherwise, i had to double create the build-up of my data both in the webscript and in some Freemarker template&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Similar if output target is some complex XML: It is just too easy to create bad XML using a template. It is much safer to construct your XML using say dom4j or some other XML library. (so you can be sure your XML is syntactically valid; you may even validate it against some XML schema if you like&lt;/LI&gt;&lt;/UL&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Gyro&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jul 2010 12:18:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/ftl-json-best-practice-question/m-p/223910#M177040</guid>
      <dc:creator>gyro_gearless</dc:creator>
      <dc:date>2010-07-15T12:18:25Z</dc:date>
    </item>
  </channel>
</rss>

