There are a number of updated UI framework features that were introduced in Alfresco One 4.2 and further expanded in later versions of Content Services. The updated UI framework goes by the name of Aikau.
The main purpose of Aikau is to provide a library of widgets that can be easily assembled into a web application foraccessing a repository. The aim is not to replace Share but it was necessary to migrate away from its originalimplementation, which was based around the Surf paradigms of pages, templates, components and web scripts, towards asolution that provided for rapid development and customization.
While Share continues to be based primarily on theYUI library, Aikau is based aroundtheDojo library.
The main goals of Aikau are:
Between versions 4.0 to 4.2 there were significant enhancements to the Surf framework and deliberate refactoring of logicfrom the FreeMarker template into the JavaScript controller of the Share web scripts. Improvements to page loadperformance were achieved by reducing HTTP requests through the following methods:
All of these features are leveraged in the improvements and this makes it easier to produce faster, more reliable pages,in less time for Alfresco Share web applications.
An important enhancement is a zero build approach. Surf is able to dynamically analyze the JSON model that defines thepage being rendered and resolve all JavaScript dependencies that are then compressed and written into a single JavaScriptresource that simulates a built Dojo layer. Surf caches all the dependency relationships as it finds them so it nevertraverses a dependency path a second time. It also caches the individual layers it generates so although the very firstpage rendered after server start up can take a few seconds to render, subsequent page rendering is much faster.
When you render a web you are normally expected to take care of the styling by using separately referenced CSS files.For example, you might import a theme style sheet for the framework that you are using.
In the updated UI framework, each widget can optionally define its own CSS resources, including the ability to specifydifferent resources for different media types. If that widget is used on a page then Surf will automatically includethose CSS resources within a single aggregated CSS resource loaded on the page. The same principle is applied tolocalization files so the use of a widget ensures that its National Language Support (NLS) properties automaticallybuilt into a JavaScript resource loaded on the page. Widgets can scope their message bundles to ensure that there areno collisions and the core message handling function is smart enough to work through all of the message scopes in awidgets ancestry to ensure that the most specific message is displayed.
Although Share was originally built using YUI2, JQuery plugins have also been introduced and it can not be restrictedto using Dojo. The UI framework is designed to easily support widgets provided by other libraries and by design it ispossible to swap out Dojo widgets for those provided by other libraries. A mechanism exists for wrapping our existingYUI2-centric widgets to that they can be referenced in the JSON model for the page. The Calendar of any Share site usesa combination of the YUI2, JQuery and Dojo libraries.
One of Share’s greatest strengths is its ability to be easily customized. This is something that has been enhanced overthe last few releases. A significant improvement was to make it easier tocustomize the client-side widgets that are instantiatedon each page by customizing the JavaScript controller of a Component’s web script. It is also possible to customizethe numerous fine-grained widgets that comprise a page or Component. Widgets can be reconfigured, added or removedeasily and because the widgets are decoupled (such that they do not rely on the existence of other widgets) makingchanges will not cause any errors.
The library of Aikau widgets continues to grow. The following components are already implemented using Aikau:
Aikau is available as an open-sourceproject on GitHub.
A comprehensive Aikau tutorial isavailable on GitHub.
The documentation for the Aikau widget library can be foundon the Developer web site.