Technical overview of DX

November 11, 2022

1 Introduction

This document contains a technical introduction to Digital Experience Manager. It is designed to help readers with technical skills such as integrators, developers, testers or others as a starting point into the platform. It is not meant to be a user's guide or an administration's guide. Please refer to the corresponding documents if that is what you are looking for.

This document has five sections:

  • An overview of Digital Experience Manager: what it is, the different types of actors involved, technical requirements, integrated technologies and frameworks.
  • The web layer, which is a description of the layer exposed to the browser, and how it relates to the various components in Digital Experience Manager; how they may be composed to build powerful web applications.
  • The back-end layer, which contains a description of all the different services and technologies available in Digital Experience Manager. This back-end is used by the web layer but may also be in some cases used directly by integrators, such as in the case of integrating custom workflows.
  • A section about performances, and how Digital Experience Manager addresses the very demanding high-load scenarios.
  • Finally, a section that describes the additional resources available to developers and integrators, from online resources to commercial support contracts.

2 Overview

This section presents a global overview of the elements of a Digital Experience Manager system.

2.1 What is Digital Experience Manager?

Digital Experience Manager can be many things to many people. Most projects will use it as a Web Content Management (WCM) solution, or whatever the moniker is at the time of reading, while others will use it as a portal server, a web integration platform, or even a full-fledged content integration solution.

What Digital Experience Manager really is, is software listening to HTTP requests with the ability to produce responses using HTML, any markup or even binary data that users might need. In its core, it uses a content repository to store and retrieve content, as well as multiple ways of deploying custom logic to operate on the content or to interface with third party systems. That's the million-mile view of Digital Experience Manager, and should give you a good idea of the flexibility of the system.

2.2 The closer view

If the previous description of Digital Experience Manager was a bit too abstract, the following description should be more helpful. Digital Experience Manager is basically composed of the following layers:

  • A servlet container (Apache Tomcat, Oracle WebLogic, IBM WebSphere or others)
  • A set of filters and servlets that form the "outer layer" of Digital Experience Manager
  • A set of Spring beans that make up the main architecture of Digital Experience Manager
  • A set of modules that extend the basic functionality
  • A JCR implementation for storage of content (Apache Jackrabbit 2.x)
  • A portal container (Apache Pluto 2.x)
  • A scheduler (Quartz)
  • A workflow engine (jBPM)
  • A rules engine (Drools)

Of course, this is a much-simplified view of the elements that Digital Experience Manager is made of, but it should help identify the type of technologies involved.

2.3 Technical requirements

Digital Experience Manager has the following minimum requirements:

  • Oracle JDK 1.7 or more recent 100% compatible
  • A servlet API 3.0 / JSP 2.1 container
  • 4GB RAM
  • Windows, Linux (RedHat, Ubuntu), Mac OS X operating systems

Recommended requirements:

  • Oracle JDK 6 or above
  • Apache Tomcat 8.0.x
  • 8GB RAM
  • Ubuntu or RedHat Linux 64-bit kernel

2.4 "Everything is content"

Another way of presenting Digital Experience Manager is what we call the "everything is content" concept. Since the very beginning, Digital Experience Manager has been aggregating all kinds of content on pages, including dynamic content such as portlets. Digital Experience Manager has always been able to mix applications and content on the same web pages. Digital Experience Manager takes this notion even further by easily allow the building of "content-based applications", also known as "composite applications" that make it easy to build powerful applications that share a content store as a back-end.

In other words, working with Digital Experience Manager means manipulating content and defining views as well as rules to be executed when an event is triggered on the content (manually or programmatically). Any content element stored in the repository (texts, images, PDF documents, portlets, OpenSocial or Google gadgets) is considered content and therefore shares:

  • Common properties (name, UUID, metadata, etc.)
  • Common services (editing UI, permissions, versions, etc.)
  • Common rendering and handling systems

Content is stored in a hierarchical structure (using Java Content Repository aka JCR standard), but as you will see it is possible to query or operate on it in other ways.

2.4.1 Developer and integrator customization

End users may see Digital Experience Manager as a product, but for developers and integrators it is before all a powerful integration platform that may be configured and extended to fit a wide variety of needs.

Here is a sample of the different type of customization tasks:

  • Integration and personalization
    • Of templates
    • Of default Digital Experience Manager modules and components
  • Development
    • New modules usable in pages
    • New logic parts (rules, filters, actions, classes)
    • New functionalities that add features to Digital Experience Manager
  • Configuration
    • Of workflows
    • Of roles and permissions
    • Of the user interface

2.5 Integrated technologies

Digital Experience Manager integrates a lot of different technologies and frameworks, and this section will give you an overview of what's included and how it is used.

  • Digital Experience Manager stores all of its data in a Java Content Repository (JCR) (Apache Jackrabbit 2.x):
    • Two workspaces are used in the JCR, one for the staging content (called "default") and one for the live content (called "live")
    • JCR content is stored in an SQL database (MySQL, PostgreSQL, Oracle, MSSQL, and more). Node data is stored in serialized form for performance reasons
  • Digital Experience Manager integrates the following services and frameworks (most important ones)
    • Apache Lucene as the indexing/search engine
    • Apache Solr for advanced search features (only some classes)
    • Apache Camel as an enterprise integration engine
    • Spring Framework as the dependency injection and bean configuration technology (as well as much more)
    • Google Web Toolkit with Sencha GXT extensions for the UI in Edit mode, Contribute mode, User dashboard and Studio mode
    • JQuery and extensions for the contribute and live modes
    • JBoss Drools as a rule engine
    • JBoss BPM as a workflow engine
    • OSGi
    • Karaf and Felix
    • Spring MVC for building complex interactions and form processing
    • TWO REST API
  • Digital Experience Manager is extended by frameworks included in modules like
    • XWiki as the wiki engine
    • Apache Shindig (OpenSocial implementation)
    • LDAP connectors
    • Search Engine Optimization (SEO)
    • Tags and tag clouds

2.6 Architecture overview

As you can see, the top layers are basic rendering and communication layers, while the underlying services are more modular. The boxes with blue outlines covered what is offered in the core services, either as core modules or framework, while the blue-filled boxes represent additional modules that may provide custom content definitions as well as custom logic or much more (rules, Spring descriptors, etc…)

Digital Experience Manager introduced modules to the architecture. Prior to this version, extensions to Digital Experience Manager would be integrated through Spring beans being deployed, but no specific packaging was possible. Since Digital Experience Manager 70 modules must be packaged as OSGi jar bundles that can then be deployed to extend or complement platform scope of functionalities. A lot of functionalities available by default in Digital Experience Manager are in fact built and deployed using modules, including, for example, the contribute mode or template sets.

2.7 Modules

Modules are a very important part of Digital Experience Manager, and may be thought of as Digital Experience Manager's plug-in infrastructure. Basically, they are composed of directory and files that are packaged as an OSGi bundle JAR file and then copied into Digital Experience Manager's digital-factory-data/modules directory for deployment. Upon detection of the new file, Digital Experience Manager will start the module and make it available to the whole system. Modules may range from very simple ones, such as only defining new views for existing content types, to very complex implementation of new communication layers such as a REST API, or implementing back-end LDAP user and group providers.

Template sets (see the Studio section below) are also packaged as modules, which make them easy to deploy and update.

Advantages of modules include:

  • Re-usability: as they are autonomous, it is easy to move them from development to staging or to production environments. It is also easy to re-use them across projects or share them with others. Also, as it is possible to inherit from existing modules, it makes it nice and easy to extend a default module.
  • Maintenance: as they are autonomous blocks, they can focus on a specific use case (like in the case of a forum module), which makes maintenance and evolution easy.
  • Reliability: if a module fails, only that part of the system will be unavailable, the rest of the platform will continue to serve requests.
  • Separation of concern: as the modules may be integrated at a later time, this makes it easier to split work among members of a team.
  • Hot-deployment: as modules are basically OSGi bundles, it is possible to hot deploy them or even remove them without shutting down the whole system, even if they include Java code or even workflow definitions
  • Isolation: with the introduction of OSGi as a module framework in Digital Experience Manager 7, modules are now executed each in their own class loader which makes it possible for them to embed their own dependencies, even if they differ in version from the ones used by Digital Experience Manager or another module.

A developer will therefore mostly work on modules, either creating new ones or extending the out-of-the-box ones. He may also share his work (or re-use others' contributions) on Digital Experience Manager's App Store (http://www.jahia.com/store), therefore making the module available at large, gathering feedback and maybe even community contributions.

A module may contain: 

  • Content definitions
  • View scripts (JSP, JSR-286 compatible languages such as Velocity or Freemarker, or even PHP*)
  • Static resources (text file, images, CSS files, JavaScript files)
  • Resource bundles or other property files
  • Java classes or JAR libraries
  • Filters
  • Permission and role definitions
  • Rules
  • jBPM workflow definitions
  • Tag libraries
  • Spring Framework configuration files
  • Content import files (in XML format)
Note:
None of these files are required and you may create an empty module, although it won't be very useful.

* Through the integration of Caucho's Quercus PHP engine, which may require a commercial license depending on deployment needs. The Jahia-Quercus module is provided in the context of a community effort and is not supported by JSG.

2.8 Digital Experience Manager actors

In this section, we will present the different types of actors that may interact with a Digital Experience Manager system, and how they relate to different activities.

Developers, integrators and webmasters will mostly interact with the studio as well as modules to create templates, modules so that the other users may use a system that has been customized to their needs. In this role, this will enable them to "lock" the look and feel of the web site, as well as the content definitions, rules or any other custom logic needed. Webmasters and/or editors will then use the output of the previous work to populate the site with content, using the edit mode and/or the contribute mode. The Edit Mode is a very powerful content editing interface, mostly targeted at advanced users, while the Contribute Mode is an easy-to-use content editing interface aimed at basic content editors. It should also be noted that integrators are free to customize the Contribute Mode to their requirements, to tailor the experience for the editors. Once the editors are happy with the content, they may use the workflow to publish the modifications to the live workspace (or if they are not directly allowed to do so, they may start the review process), at which point it will be available to site visitors. Site visitors may then browse the site, and if allowed, also input user-generated content in modules such as the forum, wiki or other components deployed in the site.

3 Web layer

This section details the web layer of a Digital Experience Manager system. This layer is both flexible and powerful; so we will first go over the flow of content, then present how a page is rendered.

3.1 Content flow

To understand how Digital Experience Manager works with content, we have illustrated this with the following diagram:

Starting from the bottom up, the developer can create different types of objects, ranging from content definitions to macros that will be used by Digital Experience Manager to customize the experience for other users. We will now briefly detail the different types of objects:

  • Definitions: content definitions define the type of objects that will be edited in the system as well as their structure. These may range from simple properties to complex sub-tree structures
  • Rules: rules define "consequences" (similar to actions) that must be performed when a certain condition is met. They make it possible, for example, to listen to modifications on content objects (such as page creation), to trigger any type of consequence.
  • Actions: actions are similar to method calls, except that they are usually called from an AJAX request or an HTTP POST request. Developer may either use existing actions (such as "createUser" or "startWorkflow") or define their own custom ones to fit their needs. This simple yet powerful extension mechanism makes it possible to perform almost any task in the Digital Experience Manager back-end from a remote request.
  • Templates: templates are defined in the Digital Experience Manager Template Studio, and they make it easy to define page and content layouts that may be used when creating pages or displaying content elements (such as a news entry). Templates may be packaged in Template Sets, and then be deployed to any web site, or moved from staging to production environments. Template Sets may even contain default content, which is useful to create powerful site factory scenarios.
  • Scripts: used to render a specific content object type. The default script type is JSP, but Digital Experience Manager supports any Java Scripting API (http://www.jcp.org/en/jsr/detail?id=223) compatible script language (for example Velocity, Freemarker, or even PHP). Multiple scripts may be provided for a single node type: these are called "views" in Digital Experience Manager.
  • Macros: macros may also be defined to provide quick substitutions on the final output of a Digital Experience Manager page. Macros are executed even if a page is retrieved from the HTML cache, so macros can be very useful to quickly customize page output. There are some performance caveats as macros are constantly executed; they must always be very fast to execute.

Editors will then log into the system and start creating sites, pages and other content types that were specified by the developers. They use Digital Experience Manager's powerful Edit Mode or the simpler Contribute Mode to submit content and build the site bit by bit. As they enter content, rules, actions are used to perform logic actions upon submission; and then templates, scripts and finally macros are used to output the resulting HTML. Visitors will either surf anonymously or log into the system, browse the site and interact with any dynamic object types that the editors and developers have made available to them. An example of such a dynamic object could be a forum, or a comment list. The content they contribute is called "User Generated Content" (or UGC). Again, Digital Experience Manager will use the templates, scripts and macros to render the pages for the visitors, and if they are allowed to enter content, rules, actions and content definitions will again come into play (but not illustrated above to keep the diagram simple).

3.2 Templates and views

As presented in the previous section, Digital Experience Manager introduced a new editable template system that makes it easy to customize basic or even complex layouts without advanced scripting skills. To better understand how a page is composed, we will now illustrate this in the following schema:

In the example presented above, we are requesting a content object from the Java Content Repository that is located on the home page called "bellini". Digital Experience Manager will therefore first use the URL to find the corresponding content object, and then starts looking for different objects that will help render the final page. In this specific example, we are not requesting a "page" object, but a content object directly, which is a little more complex. If we had wanted to render the page, we would have used the following URL: http://www.dogsandcats.com/home.html . Digital Experience Manager would have then looked for a page template, scanned it to find all the different sub-items present on the page, and then used views to render each specific object type. In the case of the above example, we have illustrated a more advanced use case, where we directly request a content object directly. If all we had for this content object was a view script, when requesting the object directly, we would probably only get an HTML fragment rendered instead of a complete page (as object views are designed to be re-used within pages). In order to avoid this, Digital Experience Manager has a mechanism called the "content template" that allows integrators to design a template specific to one or several content object types that will be used to "decorate" around the object itself, allowing, for example, to render navigation, headers and footers around the object. The rendering of a full HTML page for a single content object then becomes quite similar to the case of rendering an actual content page. This mechanism if, in fact, very similar to how most CMS work, with a DB holding content records and a PHP, ASP or JSP script that is called to display that record, inheriting from headers, footers and other blocks of features; through includes most of the time. If you're familiar with Drupal or Joomla for instance, this should be pretty clear for you. The main difference here is that the content template is defined directly inside the Studio and stored in the JCR, and not as a script on disk.

3.3 The Digital Experience Manager Studio

As templates are not scripts, but defined inside the content repository, Digital Experience Manager introduced a new tool called the Studio to edit them. A template is a set of nodes that will define the layout of a page, allowing users with low scripting or HTML experience to edit or update existing templates. Note that the Studio remains a development tool and has been improved a lot with version 7.0 with advanced features and code editing capabilities. For that reason, it is not recommended to give access to non-technical users to it, at least without a proper training and explanations on what that can / should not do within it. For advanced users with strong JCR skills, you could even export the template as XML, edit it and re-import it back into Digital Experience Manager, should you wish to do so. Templates are grouped in Template Sets, which can then be deployed to a site on the same Digital Experience Manager installation or packaged as a module and exported as a JAR file to either be deployed on another development instance, or to another Digital Experience Manager installation for staging or production.

3.3.1 Page templates

Page templates are the default template type, and are made available to editors when they create a new page. At that point the editor may specify the template he wishes to use that will define the layout of the page. Building structured templates targeted to the specific site vertical makes it a lot easier for site administrators to make sure that the sites have a coherent structure and look, and will also help make changes later on.

Page templates (and content templates) may also inherit from a parent template, so you may, for example, have a "base" template that has a very free structure, and then inherit from it to build templates that have more rigid structures.

3.3.2 Content templates

As explained in the content flow diagram, content templates are used when an URL is requesting a content object that is not a page type, but any other. It is therefore possible to "decorate" a content type by adding navigation, headers, footers, or any other desired page elements around a rendered content object by defining a template and associating it with a list of types (through the Digital Experience Manager Studio UI) for which it should be used. This is very useful for master/detail views, where the master list of objects would be displayed on a page, and the detail view could be a single content object rendered using a content template.

For example, let's say you have news articles in your definitions, and you would like to display a single news article in a full HTML page. You could have a home page that would list the abstract of the last ten news articles, and each of them would have a link to a single news article detail view, with all the details and sub objects attached to it. The home page would be rendered using the page template and the news article detail would be rendered using a content template associated with the news article type.

3.4 New REST API

Digital Experience Manager provides a new, modern, REST and HATEOS-compliant API that makes it possible to integrate and discover REST resources easily. This new API was introduced in version 7 and was based on the feedback from the work with the legacy REST API. The legacy REST API is now deprecated but still available, but developers should now use the new API as the old one will be removed in a future version of Digital Experience Manager.

Digital Experience Manager provides a new, modern, RESTful API over JCR content. Based on feedback from users of the legacy REST API, this new API was introduced in version 7 to make it easier to integrate with and discover resources by leveraging the Hypermedia As The Engine Of Application State (HATEOAS) concepts.

We trust that you will find this new API easier to work with and are thus deprecating the legacy REST API, which, while still available, will be removed in a future version of Digital Experience Manager.

3.4.1 Goals

The goals of this new API are as follows:

  • Decouple the API from the rendering pipeline to make it easier to maintain and upgrade
  • Respect REST and HATEOAS principles
  • Provide a simple Create-Read-Update-Delete (CRUD) interface to JCR content, mapped to HTTP methods (PUT/POST, GET, PUT and DELETE, respectively)
  • Focus on JSON representation of resources
  • Optimize for JavaScript client applications
  • Provide full JCR content access

3.4.2 Resources and representations

The REST concepts states that you don't manipulate resources directly, rather you manipulate their state by exchanging representation. In our case, resources are JCR nodes and properties.

We use the following representation for nodes:

{
  "name" : "<the node's unescaped name>",
  "type" : "<the node's node type name>",
  "properties" : <properties representation>,
  "mixins" : <mixins representation>,
  "children" : <children representation>,
  "versions" : <versions representation>,
  "_links" : {
    "self" : { "href" : "<URI for the resource associated with this node>" },
    "type" : { "href" : "<URI for this node's type resource>" },
    "properties" : { "href" : "<URI for this node's properties resource>" },
    "mixins" : { "href" : "<URI for this node's mixins resource>" },
    "children" : { "href" : "<URI for this node's children resource>" },
    "versions" : { "href" : "<URI for this node's versions resource>" }
  }
}

The representation for properties is as follows:

{
  "name" : "<unescaped name>",
  "multiValued" : <boolean indicating whether the property is multi-valued or not>
  "reference": <boolean indicating whether the property value(s) point(s) to a node>
  "value" : "<value>",
  "type" : "<type>",
  "_links" : {
    "self" : { "href" : "<URI this propertys resource>" },
    "type" : { "href" : "<URI for this propertys definition>" }
  }
}

The _links section is currently a simplified version of what is described in the JSON Hypertext Application Language (HAL, http://tools.ietf.org/html/draft-kelly-json-hal-06) and provides links that a client application can, in conformance with HATEOAS principles and along with using the proper HTTP methods, use to navigate and operate on JCR content.
For more details on representations (and the RESTful API in general), please refer to the online documentation: https://www.jahia.com/get-started/for-developers/developers-techwiki/content-manipulation/legacy-rest-api

3.4.3 Entry points

Before being able to retrieve a representation of some JCR content, we need to know which content needs to be accessed. For this reason, each API operation is scoped by both the target workspace (live or default) and the language in which the content is to be manipulated. Therefore, all URIs targeting JCR data will be prefixed as follows: <basecontext>/<workspacename>/<languagecode>/<restof the URI> Once this information is known, we can use one of the API three entry points. Each entry point corresponds to different ways to access the initial representation with which to work and are each assigned to a different URI:

Type of access URI template HTTP methods
By identifier /{workspace}/{language}/nodes/{id}(/(children|mixins|properties|versions)/{subElement})? GET, PUT, DELETE
By path /{workspace}/{language}/paths/{path} GET, POST

By type

/{workspace}/{language}/types/{type}

GET

3.4.4 Security

Access to the REST API is restricted by default, and cannot be used directly by a non authenticated user in live. The exception here are the nodes of types jnt:folder, jnt:page, jnt:portlet, jnt:navMenuText (i.e. pages, folders, portlets and menu labels), located under sites (/sites/.*). If you need to open the API on some nodes, you'll have to provide a configuration file for the security filter module. The configuration should define precisely what you want to open - you can specify the node types and path patterns to what will be allowed :

permission.myApiAccess.api=jcrestapi
permission.myApiAccess.nodeType=nt:myNodeType1,nt:myNodeType2
permission.myApiAccess.pathPattern=/sites/mysites/nodes/.*

Nodes that won't match will not be returned by the API.

The security filter module can add restriction based on user permissions, or the presence of token. In the following example, the user will have access to the API if and only if it has the permission jcr:write :

permission.myApiAccess.api=jcrestapi
permission.myApiAccess.nodeType=nt:myNodeType1,nt:myNodeType2
permission.myApiAccess.pathPattern=/sites/mysites/nodes/.*
permission.myApiAccess.requiredPermission=jcr:write

Here the API will be granted if the user provides a token bearing the "myApp" scope : 

permission.myApiAccess.api=jcrestapi
permission.myApiAccess.nodeType=nt:myNodeType1,nt:myNodeType2
permission.myApiAccess.pathPattern=/sites/mysites/nodes/.*
permission.myApiAccess.scope=myApp

For more details on security filter configuration, check documentation .

3.4.5 Example

Given the following mixin definition:

[jmix:robots] mixin
extends=jnt:virtualsite
 - robots (string, textarea) = 'User-agent: *'

To attach this mixin to an existing `/sites/mySite` node, whose identifier is `foo` , a client would perform the following, creating a new `jmix__robots` resource in the `mixins` collection resource, using a `PUT` request:

PUT /default/en/nodes/foo/mixins/jmix__robots HTTP/1.1
Host: api.example.org
"properties" : {
    "robots" : {
        "value" : "User-agent: Mozilla"
    }
}

3.5 Legacy REST API

Digital Experience Manager provides a simple yet powerful REST API that allows CRUD (Create, Retrieve, Update and Delete) operations on content. It also offers more advanced operations such as searches, triggering actions (built-in or custom), as well as authentication. This implementation is now referred to as the "legacy" implementation, and the new REST API should be used for any new projects. Digital Experience Manager also uses this API in various modules to implement their functionality, using AJAX technologies such as JQuery. Access to a content element in the REST API is done through a URL convention that we detail below: o http://(servername:serverport)/(context)/(servlet)/(workspace)/(lang)/(path).(view).(templateType) o Example: http://www.domaine.com/jahia/cms/render/defaut/en/sites/ACME/home.html Where: - servername: is the hostname that is associated with a site, or simply the server's hostname or IP address if no site is associated with a hostname.

  • serverport: is an optional port number if Tomcat is not configured to listen to port 80, or if no Apache server has been setup in front of Tomcat.
  • context: is the context in which Digital Experience Manager is deployed (empty if Digital Experience Manager is deployed as the ROOT application).
  • servlet: the servlet you want to use. Most of the time it will be the "/cms/render" servlet that is the main page render servlet, but you might also need to use /cms/login, /cms/logout or /cms/find 
  • workspace: live or default (=staging).
  • lang: is the language code for the language you wish to render or modify.
  • path: the path to a node (such as /sites/ACME/home.html in the above example).
  • view: an optional view.
  • templateType: the type of render desired. Most of the time it will be .html, but you can just as easily request .csv, .xml or .rss. Of course, this requires the corresponding views to have been defined in the system.

We also provide an URL rewriting system as well as a vanity URL system for SEO compatibility. The above explanation is really targeted towards integrators and developers that want to use the REST API.

Now that we have detailed the URL format, let's look at the possible methods that may be called on an URL. The REST API offers basic CRUD (Create, Retrieve, Update and Delete) methods that are mapped to the HTTP standard methods:

  • GET will render the node.
  • POST will create a new node (or call action).
  • PUT will update the node.
  • DELETE will remove the node.

It is possible to have more methods using actions.

3.5.1 Actions

Actions are an extension point to the default HTTP methods provided in the JCR REST API. Methods may be defined in modules and make it easy to perform additional (and complex) operations on nodes.

Here is an example of an action being called from an URL:

POST http://localhost:8080/cms/render/default/en/sites/ACME/home.startWorkflow.do
 

All actions use the *.do extension at the end. The above example will start a workflow process on the /sites/ACME/home node. Additional parameters may be specified either using the URL query string, although it is recommended to use HTTP body parameters. Here are some additional examples of actions provided by Digital Experience Manager: - NewUser (module: userregistration) - PublishFile (module: docspace) - MailAction (module: formbuilder) - GetFeed (module: feedimporter) - DocumentConverterAction (module: docConverter)

As you can imagine, this makes it easy to use content actions directly from a simple HTML form, without any Javascript (in this example calling the newUser action):

<form method="post" action="<c:url value='${currentNode.path}.newUser.do' context='${url.base}'/>" name="newUser" id="newUser">

3.5.2 Example: native iPhone/iPad application

An interesting example application illustrating the usefulness of the REST API is a prototype of a native iPhone/iPad application that was designed by Digital Experience Manager. The native application connects to Digital Experience Manager on startup, retrieves a configuration file that contains different screen properties, notably queries that will be executed with the REST find servlet. The results are generated using JSON output. The native application can then display the content any way it chooses. Having the content in JSON format makes it easy to adapt to multiple screen sizes, as the native prototype is a dual iPhone and iPad application. The application is also capable of creating new content by using POST HTTP requests to create new content objects. All this is quite optimal and integrated with the authentication as it also uses the login and logout servlets.

As you can see in the above example, the native application displays the ACME demo content, with native device rendering. This makes for a strong mobile user experience while having exactly the same content base. It is also possible to cache the data in the native client for offline browsing.

3.6 Mobile rendering

An alternative to the native application rendering is to use user agent matching to change the template type so that the rendering may adapt the size and navigation to the size of mobile devices. Digital Experience Manager makes it possible to configure the user agent matching using regular expression matching and changing the template type dynamically so it becomes possible to switch to alternate scripts to render the content. For example, if we have the following configuration in the WEB-INF/etc/spring/application-renderer.xml file:

<bean class="org.jahia.services.render.filter.UserAgentFilter">
    <property name="priority" value="6" />
    <property name="applyOnModes" value="live,preview" />
    <property name="applyOnConfigurations" value="page" />
    <property name="userAgentMatchingRules">
        <map>
            <entry key=".*iPhone.*" value="iphone" />
            <entry key=".*iPod.*" value="iphone" />
            <entry key=".*iPad.*" value="iphone" />
            <entry key=".*Android.*" value="iphone" />
        </map>
    </property>
</bean>

This means that if an iPhone or Android user agent is detected, it will first look for an "html-iphone" script directory for a view script, and if it does not exist, it will default to an "html" directory. As you can see this simple yet powerful mechanism makes it possible to do all kinds of user agent matching. You could even use it to render for specific desktop user agents (such as legacy ones). It is also possible to use integrate with solutions such as the Apache Mobile Filter (http://www.apachemobilefilter.org) which can expose mobile device capabilities as request attributes if you need more precise control over page rendering. This might also be a good candidate for a filter, or you could integrate WURFL (http://wurfl.sourceforge.net/) as a module.

3.7 Macros

As described in the content flow, Digital Experience Manager also has a macro mechanism, which makes it possible to insert markers in pages (even in free text field) that will be dynamically replaced with the corresponding values. This is useful if you want to use a macro to insert a user's name, or anything you might think of. Macros may be defined in modules as JSR-223 script files responding to a specific syntax (such as {getConstant} or {username}), and Digital Experience Manager also offers a few default macros such as:

  • Constants stored in a node property display
  • Form token generation, to prevent multiple submissions of the same form
  • Display the current user name

3.8 Filters

Macros actually require a marker to be inserted in the page for the content to be inserted, so there may be some cases where you actually want to filter the output and perform transformations in real time. This can be done through the usage of filters. For example, it might be useful to use a filter to transform all email addresses detected and replace them with an obfuscated version that will avoid detection by spam web spiders. Digital Experience Manager provides different filters out of the box, but you may of course add your own. Here is a non-exhaustive list:

  • Portlet process action filter (for portlet support)
  • Static asset filter (injects JavaScript and CSS in the HTML page header)
  • Metrics logging filter (gathers statistics on object views)
  • User agent dispatcher (for mobile rendering)
  • HTML cache
  • Email obfuscator
  • And a lot more…

As you can see, some filters are quite powerful, while others may be very specific to a certain usage. Filters are an important part of the internal processing of Digital Experience Manager.

4 Back-end layer

This section presents all the various technologies and frameworks available in Digital Experience Manager's back-end layer.

4.1 OSGi

OSGi (aka Open Services Gateway initiative) is a dynamic module system for Java. It is currently the most powerful and most mature dynamic module system available for Java applications. In OSGi, modules are actually called "bundles". They are specialized JARs that include extra MANIFEST.MF entries that declare the dependencies between modules, as well as versioning and package information made available to other modules. In effect, most existing JAR can be converted to an OSGi bundle with little work (they are even automatic transformation tools available). In the OSGi runtime, only packages that are exported will be available and visible to other bundles, only if the using bundles also import them. So in effect there can be fine-grained control of accessible Java packages (as well as associated versions) between bundles.

Starting with Digital Experience Manager 7, new modules must now be written as OSGi bundles. As OSGi is a mature and powerful dynamic module system for Java, it becomes a lot easier to build full-fledged Jahia modules that can interact with each other, while avoiding complex interdependencies that might make maintenance and deployment complex. At the same time, it also leverages the already available OSGi bundles such as the Felix Web Console or the Felix Shell to quickly add functionality to a Digital Experience Manager installation.

In the following table we illustrate how working modules behaves before the introduction of OSGi and after:

  Before OSGi With OSGi
Class or library deployment Requires web app restart  No restart needed
Module is "exploded" on deployment
Quick changes to source files don't require deploment Only works in exploded directory, not module's source
External libraries are deployed into WEB-INF/lib and exposed to all other modules
Undeployment cleans up everything immediately
Modules depending on others cannot be deployed without their dependency
Modules started/stopped after installation

OSGi offers to module developers:

  • true hot deployment: it is now possible to deploy and fully undeploy modules that contain complex dynamic content such as Java code or libraries
  • proper dependency management: the OSGi standard clearly defines the interdependencies between bundles, including bundle versioning, making it possible to use different versions of bundles in different parts of the application
  • isolation: OSGi modules can finely control what they expose and what they use, making sure that no authorized access to resources inside modules are accessed
  • ready-made tools: with little effort it is possible to use existing OSGi tools and libraries in your projects. These tools may offer extensions or new functionality, such as extensions to the Felix Web Console, the Felix Gogo shell, etc…

Figure 1 - Integrated Apache Felix OSGi web console

OSGi is a powerful framework that can scale from embedded systems to large server-side applications, and does require a little understanding of the way the framework works to get started. Fortunately, Digital Experience Manager comes with tooling that makes the transition easy, including Maven plugins that convert existing modules to OSGi bundle projects, or even transforming on-the-fly simple legacy (WAR) Jahia modules to deploy directory onto Digital Experience Manager.

4.2 Spring Webflow

Spring Web Flow builds on Spring MVC and allows implementing the "flows" of a web application. A flow encapsulates a sequence of steps that guide a user through the execution of some business task. It spans multiple HTTP requests, has state, deals with transactional data, is reusable, and may be dynamic and long-running in nature.

Figure 2 - Example of a Spring web flow

The sweet spot for Spring Web Flow are stateful web applications with controlled navigation such as checking in for a flight, applying for a loan, shopping cart checkout, or even adding a confirmation step to a form. What these scenarios have in common is one or more of the following traits:

  • • There is a clear start and an end point.
  • • The user must go through a set of screens in a specific order.
  • • The changes are not finalized until the last step.

Once complete it shouldn't be possible to repeat a transaction accidentally.

Digital Experience Manager integrates Spring Webflow as a rendering technology available in modules to make it possible to build complex form handling views. For example, Spring Webflow is used in Digital Experience Manager in the new Server Settings and Site settings administration panels.

Module developers can leverage the power of Spring Webflow to build their own user interfaces that may require multiple step form input, and validate form processing before performing an action.

Webflow are defined through an XML file that defines the application flow. Here below is an example of a simple flow:

<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
    <var name="adminPropertiesHandler" class="org.jahia.modules.serversettings.flow.AdminPropertiesHandler"/>
    <on-start>
        <evaluate expression="adminPropertiesHandler.init()" />
        <evaluate expression="adminPropertiesHandler.adminProperties" result="flowScope.adminProperties"/>
    </on-start>
    <view-state id="adminPropertiesForm" model="adminProperties">
        <on-render>
            <evaluate expression="adminPropertiesHandler.userMembership" result="requestScope.userGroups"/>
        </on-render>
        <transition on="submit">
            <evaluate expression="adminPropertiesHandler.save(messageContext)" />
        </transition>
    </view-state>
</flow>

As you can see in the above example, the flow definition file makes it easy to define the different view states as well as the transitions between the views. If you're interested in learning more about Spring Webflow, checkout the resources available here : http://docs.spring.io/spring-webflow/docs/2.3.2.RELEASE/reference/html/ . We also presented the integration of Spring Webflow at JahiaOne 2014. You may find the video here : https://www.youtube.com/watch?v=TUESY3l5XIw&feature=youtu.be

4.3 External data providers

Digital Experience Manager External Data Providers allow for the integration of external systems as content providers in the Java Content Repository (JCR) managed by Digital Experience Manager. All external data providers must at least provide access to content (aka "read" external data provider), and may optionally allow for content searching or even allow writing/updating new or existing content. One of the most interesting  feature of External Data Providers is that some of them may provide "enhanceable" content, which means that the raw content they provide can be extended by Digital Experience Manager content (such as for example being able to add comments to an object provided by an External Data Provider). In order to be accessible, external content has to be mapped as nodes inside Digital Experience Manager so the server can manipulate them as regular nodes (edit/copy/paste/reference etc.). This means that the external provider module must provide a CND definition file for each content object type that will be mapped into the JCR back-end.

Here is an example CND definition file from the ModulesDataSource:

[jnt:editableFile] > jnt:file
- sourceCode (string) itemtype = codeEditor
[jnt:cssFile] > jnt:editableFile
[jnt:cssFolder] > jnt:folder
[jnt:javascriptFolder] > jnt:folder
[jnt:javascriptFile] > jnt:editableFile


External Data is made accessible by registering a provider declared in a Spring XML bean definition file that may specify some properties of the provider (such as the mount point, unique key, the data source, etc.)

<bean id="ExternalMappedDatabaseProvider" class="org.jahia.modules.external.ExternalContentStoreProvider" parent="AbstractJCRStoreProvider">
    <property name="key" value="ExternalMappedDatabaseProvider"/>
    <property name="mountPoint" value="/external-database-mapped"/>
    <property name="identifierMappingService" ref="ExternalProviderIdentifierMappingService"/>
    <property name="dataSource">
        <bean class="org.jahia.modules.external.test.db.MappedDatabaseDataSource"/>
    </property>
</bean>

A provider then accesses the underlying data source (implementing the ExternalDataSource and other optional Java interfaces if needed) to read, save or search data. An implementation of the ExternalDataSource interface must also list the node types that it is capable of handling. This can be done programmatically or inside a Spring configuration file. Here is an example of declarative nodeType support from the ModuleDataSource:

<bean id="ModulesDataSourcePrototype" class="org.jahia.modules.external.modules.ModulesDataSource"
      scope="prototype">
    <property name="supportedNodeTypes">
        <set>
            <value>jnt:cssFolder</value>
            <value>jnt:cssFile</value>
            <value>jnt:javascriptFolder</value>
            <value>jnt:javascriptFile</value>
        </set>
    </property>
</bean>

These content are simple content (simple text files where the content of the file is mapped to a simple string (with a specific editor)) As you can see, External Data Providers are a very interesting technology to fully integrate external data with the full power of the Digital Experience Manager CMS features. For example, the eCommerce Factory product is mostly built using an External Data Provider that plugins into an eCommerce back-end.

4.4 Workflow

Digital Experience Manager integrates the jBPM 6 workflow engine (http://www.jboss.org/jbpm) that provides support for advanced workflow integrations through the definition of workflows, using the standardized Business Process Model and Notation (BPMN) 2.0 specification. Digital Experience Manager's UI is integrated with the workflow screens so that the experience is seamless for end-users who will never have to leave the UI to perform workflow operations (unless integrators wish to, of course). It is also compatible with any jBPM compatible GUI workflow definition tools such as the web base JBPM Designer (https://www.jboss.org/jbpm/components/designer.html) or the Eclipse plugin (https://www.jboss.org/jbpm/components/eclipse-plugin.html). Please note that these components are additional components that must be installed and deployed by the integrator as they are not part of Digital Experience Manager's core.

4.5 JBoss Drools and event listeners

Often, as modifications of content happen, integrators will face the need to perform a specific action when an event occurs. In previous versions of Digital Experience Manager, event listeners could be either written in Java classes or in JSP files, or even Groovy scripts. Starting with version 6.5, it was replaced with a much more powerful and easier to use rule system based on JBoss Drools. An example of such a rule is given below:

rule "Image update"
salience 25
#Rebuild thumbnail for an updated image and update height/width
when
    A file content has been modified
    - the mimetype matches image/.*
then
    Create an image "thumbnail" of size 150
    Create an image "thumbnail2" of size 350
    Set the property j:width of the node with the width of the image
    Set the property j:height of the node with the height of the image
    Log "Image updated " + node.getPath()
end

As you can see rules are similar to the English language formulation and this makes it easy for integrators to use and read. Of course the vocabulary of conditions, making it easy to respond to any event with any action.

4.6 File repository

Digital Experience Manager 6 was the first version to include the Java Content Repository as its standard file repository and build services on top of it. Actually, the integration of Jackrabbit is not a strong dependency, as Digital Experience Manager uses the standard JCR API to offer access to multiple repositories. In Digital Experience Manager 6 it was already possible to access CIFS/SMB file repositories. On top of the file repository services, different interfaces expose content through various interfaces such as WebDAV, template file browsing and Digital Experience Manager's AJAX UI. On the other side of the repository, integration with a rules engine is used among other things for image thumbnail generation and metadata extraction. This rule engine is also pluggable and can be extended by integrators to perform other specific logic upon repository events.

4.7 Searching and indexing

Digital Experience Manager comes built-in with strong support for searching and indexing, and does so by combining multiple frameworks in order to offer the following features:

  • Full-text searches (Apache Lucene)
  • Multi query languages support (Apache Jackrabbit)
  • Facets (Apache Solr)
  • "Did you mean" (Apache Solr)
  • Open search
  • Connectors to other search repositories such as Alfresco via EntropySoft connectors (available in our Digital Experience Manager Unified Content Hub extension)

In order to use the above features, Digital Experience Manager provides two technologies: full-text search tag libraries and query languages

4.7.1 Full text queries using search tag libraries

The full-text query feature is made available through a set of tags that are focused on searching using basic text matching with content object properties or file contents. It produces results as hits that contain information such as the target object that matched the result, an extract of the matching content and the matching score. It also supports search options defined by the JSR-283 standard such as optional words, mandatory or excluded words, search by sentence or word, etc.

Here is an overview of the features available when using full text queries:

  • Search on all content within a site.
  • Search on multiple sites on the server.
  • Search the contents of files in the content repository.
  • Search the contents of files in external repository (only with the Digital Experience Manager United Content Hub extension).
  • Highlight searched terms in the results page.
  • Order by matching score.
  • Exclusion of matching property (through content definition parameters).
  • Limit results to improve performance.

Full text queries are a great way to offer an easy to use yet powerful search feature on a Digital Experience Manager installation, but they are not very useful to perform more targeted queries, such as retrieving a list of the last 10 news entries or similar queries. This is where the query languages become interesting.

4.7.2 Query languages

The query language feature is actually a native functionality of a JCR-compliant implementation such as Apache Jackrabbit. It offers different query languages that are functionally equivalent, but differ in implementation and usage scenarios. It allows for complex condition matching and result ordering, as well as in some cases joins on multiple content object types. The result of the query is a list of matching nodes, ordered by the specified properties.

Here is an overview of the features offered by this type of querying:

  • Search by content type (news, article, etc.)
  • Complex conditions based on properties, or even in the case of SQL-2 or Query Object Model, joins.
  • Integration with faceted search
  • Integration with front-end HTML caching

The following query languages are available:

  • SQL- 2: Similar to the standard SQL database language so easy to use for developers. The queries are parsed and transformed into Java Query Object Model queries and then executed as such. As this is part of JCR v2, it is relatively new and therefore there are some issues with its implementation, notably on join performance. For most simple queries it will do fine, but for more complex ones it is recommended to use XPath until this language implementation matures.
  • JQOM (Java Query Object Model): this is a Java object representation of a JCR v2 query. It is possible to build these using Digital Experience Manager's provided query tag libraries, or to build them directly from Java code. SQL-2 and JQOM queries are quite similar, except that JQOM avoid the parsing stage, so they are a bit faster. In practice, it is quite seldom that JQOM is used, but it might be interesting in some cases.
  • XPath: although it has been marked as deprecated in JCR v2, it is still available in Apache Jackrabbit and is by far the most optimized query language. It is not as easy to use as SQL-2, but it is very useful to build very fast queries; therefore, often worth the extra effort in designing the query. There are some tricks to know how to search for multi-language content, as it is not handled transparently, in the case of the other two implementations. But even Digital Experience Manager uses it internally for speed in the cases where SQL-2 performance is not fast enough.

Digital Experience Manager also comes built-in with modules that use queries to provide their functionality. An example of this includes the "last news retrieval" feature in the news module. Also available is a generic "query" module that will ask for the query when added to a content page. This makes it easy for editors to be able to build custom queries at content creation time, without requiring any assistance from the integrators (of course this module should not be made available if this possibility is to be restricted).

4.8 Authentication and authorization

One of Digital Experience Manager's strengths has always been its powerful authentication and authorization sub-system. It allows for modular yet precise controls of permissions on a wide-variety of objects or actions. Permissions may be very granular or as coarse as desired, which makes it a great tool for deployment in small to large enterprises.

4.8.1 Single sign-on

Digital Experience Manager integrates with the following SSO frameworks:

  • Central Authentication Service (CAS) SSO, http://www.jasig.org/cas
  • Java EE container authentication support
  • Pluggable authentication pipeline that can be easily implemented to add support for more SSO solutions

The last framework is useful in the case of integration with non-standard SSO technologies or custom-built ones. One possible example would be the case of a mobile service provider that uses phone numbers as authentication logins. Interfacing with a custom database will integrate into Digital Experience Manager's back-end, exposing user and group information directly to Digital Experience Manager's UI and permissions.

While it is possible to integrate with Kerberos http://web.mit.edu/kerberos/ (the authentication valve is present in the distribution) this integration is not officially part of the tested and supported stack for Digital Experience Manager.

Please get in touch with the company to know the usage conditions.

Once the user is properly identified, the authorization sub-system is composed of:

  • Access control lists on content objects
  • Roles the user may participate in
  • Permissions on any user actions for a specific role

In order to be able to set access control lists, user and group services are provided, and are of course also pluggable. By default Digital Experience Manager comes with its own user and group provider service, as well as a connector to LDAP repositories, but it is also possible to develop custom services to plugin to either a custom database or a remote service. Digital Experience Manager is also capable of storing properties and user information for external users and groups inside its own services, making it possible to store personalization data in Digital Experience Manager. It should also be noted that all these service implementations are available at the same time, so there is no need to replace one with the other.

4.8.2 Roles and permissions

New to Digital Experience Manager is the introduction of full-fledged roles. Roles are basically a collection of permissions, regrouped under a logical name. For example an "editor" role regroups permissions for editing content and starting workflow processes. Digital Experience Manager comes with default roles built-in, as well as with a powerful UI to modify the default assignments. Integrators may of course define their own roles and permissions, as well as change the default assignments. It is also possible to add permissions in modules and automatically assign them to existing roles upon deployment.

Roles can then be assigned to users and/or groups at any location in the content repository. For example, you may define a role "editor" to a specific group in a specific section of the website. They will be able to act as that role only in that specific location in the content repository, and nowhere else. This makes it easy to delegate responsibilities to collaborate on content editing, reviewing and overall content management. It is of course recommended to re-use roles through the various sites and sections, as a minimal set of roles will be good both for site management and authorization performance (as HTML caching is also using roles to determine which content is viewable or not).

4.9 Import / export

Digital Experience Manager's import/export feature is an extremely powerful mechanism for migrating content in various ways between Digital Experience Manager sites, or even between Digital Experience Manager installations. It uses the JSR-170 (or JCR) XML format as a basis for content export, along with other specific files such as file hierarchies for binary data export. All these different files are compressed in a ZIP file that may be used by the import sub-system. This makes it possible to export a complete Digital Experience Manager installation, a set of sites, a single site or even a sub-section of a site using the same import/export technology. Using this feature, users can migrate content between sites, or even between sections of sites, or also use it to export content to non- Digital Experience Manager systems or import from non- Digital Experience Manager systems. The same system is also used for migrations from previous versions of Digital Experience Manager to the newest available version.

4.10 Distant publication

Digital Experience Manager may be deployed in multiple instances to cover scenarios where a Digital Experience Manager instance is located inside a firewall, and a public instance is located inside a DMZ zone accessible from the public web. To publish data from the inside to the outside, Digital Experience Manager has a feature called distant publication (also known as remote publication), which makes it easy to automate the process of migrating data from an authoring server to a browsing one. Note that this is still compatible with user-generated content such as a deployed forum on the public instances, meaning that remote publication will not touch user generated content created on the public instance.

4.11 Portlets

Digital Experience Manager includes an embedded portal server, which is based on the Apache Pluto reference implementation of the JCR Portlet API specification. The goal of this implementation is to offer support for integrators who need to embed portlets on content pages. This means that any portlet API compliant application may be integrated with Digital Experience Manager in a few simple steps.

4.11.1 Portlet versus modules

To differentiate portlets from modules, we offer the following table that summarizes the differences:

  Portlet Module
Classification Older technology, extension to traditional Web server model using well defined approach based on strict isolation mode. Using newer, loosely defined "Web 2.0" techniques, integration at both server or client level.
Philosophy/Approach Approaches aggregation by splitting role of Web server into two phases: markup generation and aggregation of markup fragments. Uses APIs provided by different modules as well as content server to aggregate and reuse the content.
Content dependencies Aggregates presentation-oriented markup fragments (HTML, WML, VoiceXML, etc.). Can operate on pure content and also on presentation-oriented content (e.g., HTML, JSON, etc.).
Location dependencies Traditionally content aggregation takes place on the server. Content aggregation can take place either on the server-side or on the client-side, but usually happens on the server.
Aggregation style "Salad bar" style: Aggregated content is presented 'side-by-side' without overlaps. "Melting Pot" style: Individual content may be combined in any manner, resulting in arbitrarily structured hybrid rendering and editing.
Event model Read and update event models are defined through a specific portlet API. CRUD operations are based on JCR architectural principles, and on the client REST interfaces allow content interactions.
Relevant standards Portlet behavior is governed by standards JSR 168, JSR 286 and WSRP, although portal page layout and portal functionality are undefined and vendor-specific. Base standards are JCR API, REST, JSON and XML. Defacto standards include JQuery as a Javascript framework.
Portability Portlets developed with the portlet API are in theory portable to any portlet container. Modules are Digital Experience Manager specific.
Repositories Portlet repositories have been a pipe dream for a long time, but despite multiple efforts they have never taken off and they stay usually specific to a portlet container implementation. . Modules are available on Digital Experience Manager's Private App Store, developers and integrators are encouraged and free to post them there, or anywhere else they wish.
Performance A page will be fully dependent of the rendering speed of each portlet to achieve good performance, which may be difficult if closed source portlets are present in the system. Modules have built-in support for page caching if they re-use Digital Experience Manager -stored content, which is generally the case.

In general, integrators looking for a powerful and rapid integration solutions will probably want to use modules. The main use case for portlet usage is the integration of legacy applications that are only available as portlets. In the case of other systems (servlets, web services) it is preferred to use modules as the integration will be more robust, easier to re-use and deploy and to maintain, of course.

5 Performance

High performance on high-traffic web sites is often tricky to achieve. In this section we will present the technologies available in Digital Experience Manager that will help you handle large loads as well as scale out.

5.1 Caches

Caches are essential to high performing web systems such as Digital Experience Manager to be able to avoid recreating dynamic content under large system loads. Digital Experience Manager uses a multi-layered caching subsystem.

5.1.1 Cache types

The cache types all use the same cache service that is responsible for providing cache implementations. Digital Experience Manager now standardizes on the EHCache (http://ehcache.org/) implementation, which can range from very simple setups all the way to distributed TerraCotta (http://www.terracotta.org/) or BigMemory (http://www.terracotta.org/bigmemory) cache instances.

Digital Experience Manager uses multiple cache layers to optimize the performance of page delivery:

  • the browser cache
  • front-end HTML caches
  • object caches
  • database caches

Each of these cache layers plays a different role in making sure values are only computed once.

5.1.2 The browser cache layer

While not integrated in Digital Experience Manager but in the browser, the browser cache plays a critical role in guaranteeing good performance for the end-user. For example, Digital Experience Manager's usage of the GWT framework makes it possible for AJAX source code to be aggressively cached in the browser cache, therefore making sure we don't reload script code that hasn't changed. Digital Experience Manager also properly manages the browser cache to make sure it doesn't cache page content that has changed. It also controls expiration times for cached content, so that the browser doesn't request content that is rarely changed.

5.1.3 The front-end HTML cache layer

Historically, Digital Experience Manager has had many front-end HTML cache layer implementations. The first was the full-page HTML cache. While very efficient when a page was already available in the cache, it didn't degrade very well for pages that had a fragment of the HTML that changed from page to page, or from user to user (for example by displaying the user name on the page). In Digital Experience Manager 5 we introduced the ESI cache server, which added the ability to cache fragments of HTML. This technology required a separate cache server that executed in a separate virtual machine to perform its magic. While much better than the full-page cache for dynamic page rendering, the ESI caching system suffered from problems with inter-server communication, which was very tricky to get to work efficiently. Also, integrating the ESI cache required good knowledge of the fragment-caching model when developing templates, which was an additional burden on integrators. Digital Experience Manager 6 takes the best of both worlds, by combining the sheer efficiency of the embedded full-page cache with the fragment handling of the ESI cache server. This new cache implementation is called the "module cache" and integrates fragment caching at a module level, making the interaction with templates very natural. Template developers usually don't have to add any markup in order to have their fragments correctly cached. Even when they need to control the fragment generation, this is much easier to do than in previous versions of Digital Experience Manager. The "Skeleton Cache" is also an HTML front-end cache that basically caches everything "around" the fragments, and by regrouping both cache sub-systems we obtain the equivalent in terms of performance to the full-page HTML cache that existed in previous versions of Digital Experience Manager while retaining the flexibility of a fragment cache.

5.1.4 Object cache layer

The next layer below the front-end HTML cache sub-systems is the object cache layer. This layer handles some Java objects that cannot be optimally cached by the underlying layers. In previous versions of Digital Experience Manager this layer had a lot of different caches, but in the most recent versions it has been reduced to the strict minimum based on performance testing. It serves as a layer on top of the database caches in order to avoid reconstructing objects for each model request. This is all handled internally by Digital Experience Manager and it is only important to interact with these caches if integrators are directly calling back-end APIs that don't automatically update the caches (a good example of this are the LDAP user and group caches).

5.1.5 Database caches

The last layer of caches is the database cache layer that makes sure that only minimal interaction with the database happens. This cache is important because database communication requires object (de-) serialization as well as network communication, so the overhead of database query execution may be quite substantial. The Hibernate ORM and Jackrabbit frameworks handle this layer transparently, so normally developers and integrators will not need to deal with it.

5.2 Clustering

Deploying Digital Experience Manager in a cluster is a very powerful way of distributing CPU and memory load to handle larger traffic sites. A typical Digital Experience Manager cluster installation is illustrated in the above graph. Digital Experience Manager nodes communicate with each other through cache and database layers, but also access shared resources: a shared file system and the database. The file system is used for the binary content if the server is configured to store it there, or in the database if the default configuration is used. The database stores everything else. It is therefore very important to have a high-performance database installation, as Digital Experience Manager will depend on it to scale. Digital Experience Manager can also differentiate nodes in a cluster setup in order to offer more specialized processing. We will review here quickly the different node types.

5.2.1 Visitors nodes

Digital Experience Manager "visitors" nodes are specialized Digital Experience Manager nodes that only serve as content publishing nodes. They also interact with portlets or application modules to render pages and input user generated content. Using this node specialization allows the separation of visitors load from authoring and background processing loads.

5.2.2 Authoring nodes

Digital Experience Manager "authoring" nodes are cluster nodes that can be used to either browse or edit Digital Experience Manager content. This is the most common usage of Digital Experience Manager nodes, and therefore it is interesting to have multiple instances of these nodes in order to distribute the load.

5.2.3 Processing node

In Digital Experience Manager, long-running tasks such as workflow validation operations, copy & pasting, content import and indexing are executed as background tasks, and only executed on the processing node. This way, while these long operations are executed, other nodes are still able to process content browsing and editing requests. Note that for the moment it is only allowed to have one processing node. This node is designed to be fault-tolerant, so in case it fails during processing, it can simply be restarted and it will resume operations where it left off.

5.3 More resources on performance

As Digital Experience Manager constantly strives to improve on performance, make sure to check our website for additional resources on performance, as well as our "Configuration and Fine Tuning Guide" that contains best practices of deployment and configuration to properly setup Digital Experience Manager for high loads.

6 Additional resources

On our website (www.jahia.com), you will find the following resources to help you continue your experience of Digital Experience Manager:

  • Forum: this is the community forum, where Digital Experience Manager users can exchange questions and answers. It is highly recommended to check the forums for any questions you may have as they could have been already addressed previously.
  • Commercial support: Jahia also offers commercial support contracts to fit your needs. These may range from standard basic support all the way to custom assistance contracts. Please check http://www.jahia.com for details on our commercial offerings.
  • Documentation: on our www.jahia.com/resources/techwiki/ section you will also find our online documentation ranging from end users guides to integrators documentation and API. Make sure to check back often, as we will be updating them as new releases come out.

Videos: also available on www.jahia.com and our Youtube channel (http://www.youtube.com/user/JahiaCMS) are tutorial videos that will show you how to accomplish certain tasks or illustrate some specific functionality.