AnsweredAssumed Answered

Scripts Tag in FTL File

Question asked by nirvanvjain on Oct 17, 2011
Latest reply on Oct 18, 2011 by jordiv
Dear Folks,

I am working on Alfresco Share since last short time.

I observed that in each and every component's FTl file there is Javascript is added (except very few) which is some thing like this ::

   var mratings = new Metaversant.Ratings('${fieldHtmlId}').setOptions({
      targetUrl: "${url.context}/proxy/alfresco/api/node/workspace/SpacesStore/{id}/mratings",
      metadataRefresh: true

<script type="text/javascript">//<![CDATA[
   new Alfresco.Search("${el}").setOptions(
      siteId: "${siteId}",
      siteTitle: "${siteTitle?js_string}",
      initialSearchTerm: "${searchTerm?js_string}",
      initialSearchTag: "${searchTag?js_string}",
      initialSearchAllSites: ${searchAllSites?string},
      initialSearchRepository: ${searchRepo?string},
      initialSort: "${searchSort?js_string}",
      searchQuery: "${searchQuery?js_string}",
      minSearchTermLength: ${args.minSearchTermLength!searchconfig.getChildValue('min-search-term-length')},
      maxSearchResults: ${args.maxSearchResults!searchconfig.getChildValue('max-search-results')}

What is the significant of this script ?

In some of the wiki link I found <![CDATA[ ] ..> why it is there ? But still not clear to me.

What is this setOption() function significant ?

Is it some thing like calling,it is  webscript ? (In some of the cases I felt {don't know how much true} it is calling webscript to pass or fill values)

Please teach me.