Overview

Definitions and meanings of words

When using the term WAF in this document, it is the short expression for
Web Adaptive Framework, which is the core framework the CMS and E-commerce products are built on. Also just called the Relatude Content Engine in sales material.

Introduction

Our motivation for developing WAF is that we feel traditional CMS solutions does not meet the real world requirements of many of today’s websites. The functionality and purpose of websites are broadening and it is no longer just about publishing content.

Conventional CMS solutions are good at publishing content but not so good at being frameworks for web applications. Sure, today most CMS systems come with a lot of added modules for functionality like Blog, E-shop etc, and so do WAF, but this is not enough. Websites are becoming tightly integrated with the business processes of a company, and every company has different needs and it becomes difficult to use standardized modules. The alternative in many situations is to custom build things from scratch. This is time consuming and these systems often become disconnected from the rest of the website and need a separate UI.

With the semantic data modelling capabilities of WAF you do not need to create separate customized databases or systems. Everything can be stored in WAF and everything can be edited through the same UI. You also save a lot of time as WAF will generate the code and database fields for you automatically. In fact, the key aim with WAF is:

Combine the freedom and flexibility found in custom built software with the cost and user-friendliness found in standardized software

As an example: Let’s say you wanted to expand your website with an online CV database where your already registered users could expand their profile with CV data. In WAF you would simply expand the user object using object inheritance. You would define new classes for entities like: companies, colleges, education types etc. and set up one-to-many and many-to-many relations between them. Once the semantic data model is defined WAF would generate all the C# classes, database fields and edit interface for you. The CV database becomes an integral part of you website and CMS system. Since it becomes part of WAF you also get access to functionality for: free text searching, user access control, template system for rendering, user friendly URLs, version handling, images scaling, video conversions, Google analytics integration and much more.

In essence WAF is a fully fledged ORM system with an integrated UI and functionality related to web.

Key components

WAF follows a basic three layer architecture:

The Application Storage Layer

The storage or data layer consists of three parts: the database, the text index and the file system. The database has one table for each class defined in the system with a field for each property.

The database is the master storage for all content except files. The database is also the key engine behind the WAF query language AQL.

The text index system is build on top Lucene and contains text extracts for both database fields and files. The text index is fast and efficient at doing free text searches across all properties and files. It supports concepts such as relevance based result lists and fuzzy searches.

WAF uses the NTSF file system to store files uploaded to the system. The files are organized in folders located within the websites root folder.

The data layer contains abstractions of the SQL language to provide a query system independent of the database provider.

Data Objects

The “DataObject” is the main data flowing between the storage layer and the application engine layer. The data-object is a generic object that can house all the properties that belongs to a WAF object. The property values are stored in a dictionary so the same data-object can be used for any class data and support lazy loading of individual properties not loaded in the first request.

The Application Engine Layer

The application engine layer is more complicated. The key purpose is to receive data queries from the interface and return the data in the form of objects based on compiled classes. Typical examples are: users, documents, forum messages, etc. To be able to do this fast it has a built in cache mechanism so that calls to the storage layer and resulting SQL statements can be avoided as much as possible. The caching mechanism is automatic and very effective. In a normal website most pages will not require a single SQL and execute within 5-10 ms. It reloads only relevant parts on content changes. This cache must not be confused with the built in page cache mechanism in ASP.Net. The ASP.Net page cache can be used in addition to the WAF cache, but as WAF is very fast most websites will not need this. This simplifies the development of templates.

The key API against the engine layer is the WAF Session object. A WAF session object is created for every web session. The WAF Session object contains information about the user’s access rights and validates all queries and operations against this. The WAF Session object is the key object you work against to retrieve or change data in WAF.

The engine layer is also responsible for generating the class files according to data definition and compile changes to the content classes in runtime.

The engine layer has built in support for communicating to users via the UI, Email, SMS and MMS.

A last important part of the engine is the system for hosting workflows. Workflows are used in several areas of the system. The workflow system mainly used for long running processes that are not suitable to run in the context of a page rendering. Typical examples are the sending of large number of newsletters or SMS, imports or exports to and from other systems.

Adaptive Objects

The base class of all adaptive objects is called ContentBase. This class is the base class of all entities in WAF, which means all: users, templates, files, forums, blogs, sites, domains, user groups, etc. If you have defined your own classes the code files for these classes are located in “Models/WAF” if it's an MVC project. These classes are partial classes and you can override methods to add custom functionality. To customize a class, use the partial class located in the “WAF_Custom” folder. Since each entity you define in WAF is represented by an actual class you get full intellisense when you work with these objects in Visual Studio.

Application Interface

The presentation layer of WAF is mainly split in two. The visit and edit part.

The visit part is the part all site visitors go to. The rendering of this is done in normal Razor view-files, or .aspx files that you create from scratch using normal ASP.Net components such as: Controls, UserControls, Masterpages etc. The WAF HttpModule rewrites the requested URL to the correct template file. (WAF supports friendly URL’s).

Making the templates is normally the most time-consuming job of setting up a site in WAF but there is complete freedom in the template design.

The edit part is the admin interface. It is accessed by typing “/edit” after the websites address. This interface is the same for every WAF website but is adapted to your semantic data model. It is split into modules that group functionality. The key purpose is to edit and preview content changes. There are about 10 built in modules, but you can also easily create your own modules.

AQL

AQL is short for Adaptive Query Language. AQL is the primary query API to get content out of WAF.