cancel
Showing results for 
Search instead for 
Did you mean: 

Print-Function with Freemarker-Content-Template?

schneika
Champ in-the-making
Champ in-the-making
I search for the right Solution/Approach:
a Print-Functionality, which prints the Content of a Workspace with all off the Childcontent and all Childspaces.
I need Corporate Identity with Header (Corp-Logo, Workspace-Titel,Document-Titel) and a Footer with some ContentAspects like Creator, Modification-Date, Version, Category).
is a freemarker-Template the right way?
1 REPLY 1

kevinr
Star Contributor
Star Contributor
Yes a FreeMarker template that generates a nicely formated HTML for print is the ideal approach.

You can write macros etc. in FreeMarker that recursively list the contents of a directory, so what you suggest is quite feasible.

Here is an example macro that recursively outputs the contents of a folder space:

<#macro dir node depth>
   <#list node.children as c>
      <tr>
         <td width=16>
            <#if c.isDocument>
               <a href="${url.context}${c.url}" target="new"><img src="${url.context}${c.icon16}" alt="${c.name}" title="${c.name}" border=0></a>
            <#else>
               <img src="${url.context}${c.icon16}" alt="${c.name}" title="${c.name}" border=0>
            </#if>
         </td>
         <td>
            <font size='${4 - depth}'>${c.name}</div>
         </td>
         <td>
            ${c.properties.modified?datetime}
         </td>
      </tr>
      <#if c.isContainer && c.children?size != 0>
         <@dir node=c depth=depth+1/>
      </#if>
   </#list>
</#macro>

and you could call it something like:

<table>
<tr><th></th><th>Name</th><th>Modified</th></tr>
      <@dir node=userhome depth=0/>
</table>

Hope this helps,

Kevin
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.