cancel
Showing results for 
Search instead for 
Did you mean: 

webscript for free marker template

raghu462
Champ in-the-making
Champ in-the-making
how can i develop web script for following ftl?

<#macro recurse_macro node depth>
  <#if node.isContainer>
    <tr>
   <td>
      ${node.properties.name}
   </td>
<td></td>
  </tr>

   <#list node.children as child>
   <#if child.isContainer>

       <@recurse_macro node=child depth=depth+1/>

<#list child.children as child2>
    <#if child2.isDocument>
    <tr><td></td><td>${child2.properties.name}</td></tr>
       </#if>
</#list>

   </#if>
   </#list>
  </#if>
</#macro>

<b>Recursive Listing of Spaces & Documents:</b>
<table border="1" celpadding="1" cellspacing="1">
<tr><th> Space </th><th> Document </th></tr>
<@recurse_macro node=companyhome depth=0/>
</table>
5 REPLIES 5

invictus9
Champ in-the-making
Champ in-the-making
Your question is phrased awkwardly. Are you asking what the rest of the web script components would look like if you had a .ftl that looked like what you provided?

http://wiki.alfresco.com/wiki/Category:Web_Scripts is a list of pages that describe what goes into making web scripts.

You will still need to provide a description file, so that Alfresco can identify how the web script is invoked. Since your FTL page is self-contained, you won't need a Javascript file.

raghu462
Champ in-the-making
Champ in-the-making
Yes i know i don't need js file for this free marker template.
but i don't know how to write web script for the above ftl file?

Thanks,
Raghu.

invictus9
Champ in-the-making
Champ in-the-making
Yes i know i don't need js file for this free marker template.
but i don't know how to write web script for the above ftl file?

Thanks,
Raghu.

A "web script" requires a description document, a display document, and, optionally, a controller document and properties document. The FTL file you have is the display document. You need to construct the description document. The format of the description document can be found in one of the pages that the link above leads to.

Do you need a step by step guide?

raghu462
Champ in-the-making
Champ in-the-making
Yes invictus please send me step by step

ssaravanan
Champ in-the-making
Champ in-the-making
In Alfresco web client, if you go to the following folder level
Company Home > Data Dictionary > Web Scripts > org > alfresco > sample
You will find plenty of simple sample web scripts to start with….
and you can create your sample webscripts there as wel….