API Docs ![]() |
Technical Overview
Webiva is a Content Management System built on Ruby on Rails. It currently ships with rails 2.3.4 as a frozen gem. A number of additional gems are shipped frozen with the system to make installation quicker and easier to debug (no gem versioning issues). As shipped, Webiva only supports mysql as a backend database. This is not really a structural limitation, but rather a configuration issue as some of the embedded migration code is DB specific (the domain creation code in particular uses mysql permission code).
Webiva is set up like a standard Rails application with a couple of exceptions. First, the Webiva is a multi-database system. One Webiva installation can host a number of different domains and each domain is stored in it’s own database. There is one master database (called “webiva” by default) that contains information global to all the websites. The config/ directory therefore looks a little different than a standard Rails app. There is no database.yml file, instead there is a cms.yml file and a cms_migrator.yml (along with backgroundrb.ym, defaults.yml and possibly backup.yml). cms.yml is the configuration file for top level Webiva database and doesn’t have permissions on any of the domain databases. cms_migrator.yml describes an database use with additional permissions that can create the database for each domain that is added to the system.
The configuration files for each domain are stored in the config/sites/ directory - each domain on the system will generate a file called config/sites/[database_name].yml as each database is accessed through a separate database user.
The second major difference is that Webiva adds another directory in the vendor directory called “modules.” The modules directory can contain any number of additional modules that can add additional functionality to the system.
From an application perspective, Webiva operates like normal rails application from the administration backend, but the front end of the website that it outputs is created via a separate system. Overall, Webiva has what amount to two separate MVC patterns implemented - one for the front end and one for the back end:

Both have access to the same data models, but the equivalent of the controller for the front end of the website is called a Renderer and derives from the ParagraphRenderer class. For views, Renderers can use erb partials to display individual paragraphs, but there is an alternative called Site Features which ties into the Design Template system and allows website builders to customize the output of individual paragraphs as much as possible. Site features are defined by sub-classing the ParagraphFeature class.
For the backend, controllers can be built pretty much like regular rails controllers, with the exception that adding in routes beyond the default :controller/:action/*path is a little tricky. All admin backend controllers should derive from the CmsController class, while controllers that define the options for individual paragraph types should derive from the ParagraphController class.
Renderers are developed similiarly to regular rails controllers, with the exception that they output using render_paragraph instead of render.
API Docs ![]() |

