An OpenWGA Java CMS web application consists of two main components:
- an "OpenWGA Design" responsible for the layout and the functions of the website or web application
- an "OpenWGA ContentStore" storing and maintaining the contents of the website or web application in a hierarchical database repository
When you create a new CMS web application using the OpenWGA Developer Studio, both components are created for you.
The "OpenWGA Design" consists of files stored in the folder "designs" of your OpenWGA Java CMS runtime project.
The "OpenWGA ContentStore" has been created as a database in the integrated HSQL-Database-Server that is part of the OpenWGA Java CMS system.
The embedded HSQL-Server is a maintenance free database server and a perfect environment for developers. But it is not intended as a high performance database server for you production system. You can create WGA ContentStores on other database servers like your MySQL Server using the OpenWGA admin client.
How OpenWGA combines Content and Design
In order to understand what design resources are responsible for which task we first take a look at how OpenWGA combines content and templates.
When you open an OpenWGA CMS website in the browser, your browser calls an URL of the following form:
When OpenWGA receives such a request it first reads the <dbkey>-part of the URL and opens the requested WGA ContentStore.
The URL-parts <medium> and <layout> are used to find the design resource (the "template") to render the page.
Note: You can define one template for each "medium" you want to publish your site or application on. For example in addition to the medium "html" you may publish you site to a medium "rss" using a template that generates an RSS-Feed.
If there is a <contentkey-or-name>-part in the URL, WGA looks for the requested document in the contentstore using the given key or name. In this case the template specified by <layout> is rendered "in the context of the document" (otherwise it is rendered without an implicit document context). Within a context your template can directly access data from the requested document.
OpenWGA Website Layouts
When using OpenWGA as a CMS (Web Content Management System) you will not want that your templates are addressed and called directly. Instead the requested content document should decide what CMS template should be used to render it.
To achieve this the <layout>-part of the URL may have the special value "default". This special value tells OpenWGA to find the template to render the page using a "content type definition" referenced in the requested content document.
Content Types are creates and stored in the WGA ContentStore by the website designer. When authors create a new page using the OpenWGA Content Manager they have to select one of those content types.
The content type definition references two design resources: One reference goes to an "outer layout" and another reference to an "inner layout".
This concept allows the web designer to work with one global site layout (the outer layout) including different "inner layouts" for the different content types without repeating the global site layout for each and every content type template.
Most websites do have only one outer layout referenced by all content types. However there are situations where you want special outer layouts for special content types. For e.g. the home page sometimes needs a different layout as all other pages of the site.
OpenWGA reads the outer layout referenced by the requested content and renders this template using its integrated template engine.
The sample website delivered with the OpenWGA developer Studio uses two content types: "standard" and "news".
Both use the same "outer layout" template stored in /designs/<your-design-name>/tml/html/outer/standard.tml.
The "inner layout" templates of the content types are stored in /designs/<your-design-name>/tml/html/inner/standard.tml and /designs/<your-design-name>/tml/html/inner/news.tml.
Learn more about OpenWGA Templates, managing web content or developing web applications using OpenWGA.