Content Adaptation Engine
Description
The Content Adaptation Engine (CAE) is built on top of the Apache Cocoon Framework. Cocoon implements the concepts of separation of concerns and component-based development around the notion of component pipelines, each component on the pipeline specializing on a particular operation. This makes it possible to use a Lego(tm)-like approach in building web solutions, hooking together components into pipelines, often without any required programming. Siruna developed its own Cocoon components who can be inserted in a Cocoon pipeline. All components can be configured using XML parameters which means that no programming is needed to support new websites. Every website has its own pipeline of transformations to adapt the content and to make it mobile.
Architecture
The architecture of the CAE is the same as the Cocoon architecture but with a Siruna facade in front of it. The next figure shows the different components:

The CAE receives its input from the DSTManager, which has already determined the device properties and fetched the content. The input is inside the ContentAdaptationModel when it is passed from the DSTManager to the ContentAdaptationEngine. The CAEBean will make use of the URLTranslator to decide which pipeline (or sitemap.xmap file) should be used. Based on the URL of the website, a proper Cocoon match pattern is created (by using the hierarchical mapping.xml files). Once the correct pipeline (defined in a sitemap.xml file) for that URL is known, Cocoon can be used to transform the website content.
Example of a sample mapping.xml file:
<?xml version="1.0" encoding="iso-8859-1"?> <Mapping xmlns="http://siruna.ugent.be" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://siruna.ugent.be ../sitemap_mapping.xsd"> <Domain name="newscientist.com"> <Page entry="home" directory="false"> <Path>.*</Path> </Page> </Domain> </Mapping>
Example of a sample sitemap.xmap file:
<map:match pattern="helloworld"> <map:generate type="file" src="helloworld.xml"/> <map:transform type="xslt" src="helloworld2html.xsl"/> <map:serialize type="html"/> </map:match>
Cocoon components
A pipeline is used to specify how the different Cocoon components interact with a given request to produce a response. A typical pipeline consists of a generator, followed by zero or more transformers, and finally a serializer.
Generator
A generator is the starting line of a pipeline, it creates a stream of data for further processing. It generates XML content as SAX events.


Selector
A selector chooses a pipeline depending on certain properties (ex. High/Low-end device). They are able to select particular elements of a request and choose the correct pipeline part to use.
Transformer
A transformer is a central point of a pipeline. It consumes SAX events and emits SAX events, so it takes a stream of data and changes it in some way.
Serializer
A serializer is the end point of a pipeline. It transforms SAX events into binary or char streams (HTML) so it can be returned to the client.
More info about the Siruna components can be found here.












