architecture

OpenWebCMS? is divided into two parts: the front end Notes application and the Java backend.

Notes front end

This is a more or less standard Notes database with a GUI for creating content and designing the site. Some hidden elements like views and agents provide interfaces to the Java backend.

Java backend

The heart of a CMS system ist the backend, which does all the automatic stuff like building navigation and adding headers and footers to a page.

The backend of OpenWebCMS? is written in Java because certain things are not possible in LotusScript?. In pre 3.5 releases all the stuff was put in the agent '(wOpenContent)'. That was ok for the functionality, but was quite slow for many things.

But first things first: was does the Java backend?

  • Building navigators based on the available content.
  • Evaluating DML against the actual content document and adding the result before or after the content.

    Seems simple, eh? But in fact it's all but simple...

    Evaluating DML against the content is not that complicated; there is a NotesSession?.evaluate() method which can be easily used. The time needed for that mostly depends on the complexity of the DML formula.
    But what if that formula is quite time consuming? Some kind of caching would be nice then; why evaluating that expensive DML every time a page is being opened? And there the fun starts, how to implement a persistent memory cache, which holds it's values between multiple agent runs?

    And then the navigation system; the navigation system of OpenWebCMS? is really flexible. I cannot think of any navigator which is not possible with it. And that flexiblity brings complexity with it. Loads of complexity, to be exact. Just have a look into the Java code to get the idea...

    Then when a navigator is already computed, it would be wise to cache it, too. Because there's no need to compute a navigator every time a page is being opened. Unless some content was added or change, of course.

    And finally we need logging for debugging and administrative reasons. The logging should have some different log levels (like 'debug' and 'informational'). And how time consuming is the logging? Opening a page should be as fast as possible, so we must not waste too much time with logging calls.

    Delivering content to the browser

    When a browser wants to have a content document, it's being opend with the (wContent) form. In that the agent (wOpen) is defined as WebQueryOpen? agent. It runs some methods of the backend in order to compute pre- and postDML, the navigators and write the results to some fields, for example 'preHTML' and 'postHTML'.

    General logic of the caching system - Servlet and WebQueryOpen? agents

    As said above we need some kind of caching. That means holding already computed strings (containing HTML, JavaScript?... stuff) in the memory in order to re-use them.

    We divided the backend into two parts:

    - the (wOpen) java agent, sitting in a CMS database
    - a servlet on the domino server which does all the work and holds the cache

    The key of understanding here is the fact, that a servlet on the domino server and a WebQueryOpen? agent are running the the same virtual machine. That means they share memory and can the agent can access methods of the servlet.

    In OpenWebCMS? the domino servlet is not used by browsers directly (as in other CMS systems). It does not deliver HTML to a browser. It is only being called from the (wOpen) agent, computes navigators and other stuff, saves the resulting HTML to the CMS document which is being delivered to the browser.
    And the servlet saves the computed stuff to it's cache.

    So when the next WebQueryOpen? agent comes to the servlet and wants to have the same data, it's not being computed again but served directly from the cache.