Aikau Pages - Alfresco Content Services - 23.4 - 23.4 - Ready - Alfresco - external

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License

The Share web application is built up of a main menu from which you can navigate to a number of pages. These pages are implemented mostly in the Surf development framework. However, a number of pages, such as search, have been converted and implemented with the new Aikau development framework, see architecture section.

Architecture Information: Software Architecture

Aikau pages are the new type of pages that the Share UI will use in the future. Currently only the following pages are implemented in Aikau:

  • Live Search
  • Filtered Search Page
  • Search Management Page
  • Site Management Page
  • Analytics and Reporting Widgets
  • Document List prototype

Implementing an Aikau page is greatly simplified compared to creating a Surf page. The only thing you need to do is implement a Surf Web Script and zero or more Aikau Widgets. For more information on a Surf Web Script, see Web Scripts

The web scripts controller is where all the fun happens. It is where you define your page layout in JSON, including all the Aikau Widgets that make up the page. It will look something like this for a Hello World page:

model.jsonModel = {
    widgets: [
        {
            id: "SET_PAGE_TITLE",
            name: "alfresco/header/SetTitle",
            config: {
                title: "Hello World"
            }
        }
    ]
};   

The template will be very simple and the only thing it does is this:

<@processJsonModel />   

It basically just processes the JSON model that we set-up in the controller. Here we have used an out of the box Aikau widget called alfresco/header/SetTitle, and the only thing left to do is to create the web scripts descriptor:

<webscript>
    <shortname>Hello World</shortname>
    <description>Hello World page definition</description>
    <family>Share</family>
    <url>/helloworld</url>
</webscript>   

Now this is all there is to it. The page can be accessed via the http://localhost:8080/share/page/hdp/ws/helloworld URL. You should see the following page in Share:

The Web browser's page with the Hello World sign

An Aikau page is processed and generated via the Spring Surf and Spring MVC framework. The following picture gives an overview of how it works:

The diagram of the architecture of Alfresco Share's Aikau Pages, detailing the flow of HTTP requests and response with Alfresco Share and Spring Surf. Within Spring Surf, the Spring MVC Dispatcher Servlet, Spring Application Context, Surf Web Script Container

As we can see in the picture, all dynamic content that should go onto the page is fetched indirectly via Aikau Widgets, which can get the content from either the repository or from some other remote Web Service. Worth noting here is that we are actually using a Surf Page when we are invoking an Aikau page, in the Hello World example we are used the hybrid dynamic page (hdp) to get the Share header and footer included.