Alfresco Share Architecture Changes

Alfresco was using JSF based web client for User-Interface in its earlier versions. Since around version 3.2 they have introduced a new Spring surf based Interface called Alfresco Share. The main goals were to provide collaboration platform on top of Alfresco repository with rich user interface and make development much faster and more flexible and make it competent with other proprietary competitors.

In its primitive versions Alfresco share under goes lots of criticism among developers because of its complex architecture and ambiguous extension methods. The extension method provided earlier was not foolproof as it was likely to create issues during upgrade as the only methods available was copy and paste the supporting code to the “web-extension” under similar path and then make the necessary changes to that copy. This approach was creating lots of issue regarding maintained and upgrade.

There was also one more issue of related to double pass where every Component and Sub-Component was processed twice first time only the .head.ftl file is processed; the second time the rest of the WebScript is processed. This was done originally to allow WebScripts to register JavaScript and CSS dependency files to be imported in the head element of the page

Moving of major logic from ftl to js

New Approach taken is to move all the logic and metadata about widget instantiation out of the FreeMarker template and to move it into the JavaScript controller as it is inherently easier to customize and maintain. The metadata will be stored as a standardized object structure in the model which will then be processed by a new custom directive in the FreeMarker template to output the JavaScript code necessary to instantiate the specified widgets.

Deprecation of header FTL files

Other change is deprecation of *.head.ftl file by removing all dependency from that file and directly injecting them within main ftl file though new annotation based tags like @script and @markup though which all necessary dependency can be loaded. Alfresco has given “Boiler-Plate” name to this new arrangement. Structure of new ftl files will be as follow.

<#include "include/documentlist.lib.ftl" />

<#include "../form/">

<@markup id="css">

  <#-- CSS Dependencies -->

  <@link rel="stylesheet" href="${url.context}/res/components/documentlibrary/documentlist.css" group="documentlibrary"/>


<@markup id="js">

  <#-- JavaScript Dependencies -->

  <@script type="text/javascript" src="${url.context}/res/components/documentlibrary/documentlist.js" group="documentlibrary"/>


<@markup id="widgets">

  <@createWidgets group="documentlibrary"/>



  <@markup id="html">




Dependencies will be added via the “*.html.ftl” files by virtue of the extensibility model. Earlier which was processed though “*.head.ftl” WebScript files to gather all the required CSS and JavaScript dependencies before generating the page output, but now the <@script> and <@link> directives are able to add content into previously processed directives. This will facility will ultimate allow us to disable this double-pass processing to improve page rendering performance.

Divided page in to components and further into subcomponents

This was the major change in the structure where each part of page will be associated with one webscript and will be treated as subcomponents which can be easily overridden through configuration. It will require more detailed description to explain this change so, I will be posting new article to explain this in detail or you can refer links provided.

These two are the major changes in Alfresco Share architecture which has reduced the development effort greatly and will make it more convenient to customize Alfresco Share and manage extensions. Hope this helps other developers in their developments.

Further Reading and References:

Looking for quality Alfresco Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , | Posted under Alfresco | RSS 2.0

Author Spotlight


I love opensource technologies working with those technologies from the time I have stepped in to the Software Industry. Alfresco CMS is my area of expertise. I have worked on various complex implementations which involved integration of Alfresco with other technologies, extensively worked with JBPM workflows and Webscripts.

Leave a Reply

Your email address will not be published. Required fields are marked *