Skip to content

Model-View-Controller

imperia 11 representation is based on the Model-View-Controller (MVC) architectural pattern.

Before imperia 11, a versioned data management (model) was gradually introduced in order to prepare the product for this concept. In imperia 11, the output layer is systematically separated into controllers and views.

Model#

The data model complies with imperia's document storage, see chapter Document Storage. Also, in the introduction of this documentation you will find a short description about this topic.

View#

The main body of imperia-View-Templates are root.html and body.html.
The reason to use views is that the constituents, such as lists and trees, can be displayed and maintained universally.

imperia uses a special View language. For more information read the View Documentation.

Debugging Views#

Errors in the views can be propagated with the system variable IMPVIEW_ERRORS. Available options are: HTML, JS, STDERR.

"IMPVIEW_ERRORS" = "HTML,JS,STDERR"
  • HTML: error messages are printed as HTML comments.

  • JS: error messages are printed as JavaScript alerts.

  • STDERR: error messages are printed to STDOUT in the error log of the web server or imperia, depending on the configuration.

If IMPVIEW_ERRORS is not set, the default is STDERR and the error messages are written to a log file.

  • "IMPVIEW_DEVTOOLS" = "1": activates debugging tools.

  • "IMPVIEW_CACHE_POLICY" = "timestamp": caches the view templates and reloads them when their timestamp has changed.

Controller#

The counterpart to the old imperia (pre version 9) script permissions is the permissions tree in imperia 11. The whole system is similar to the authorization system of directory structures in a regular file system, especially from the user's point of view.

In the chapter controllers you will find detailed instructions on how to edit the permissions in your imperia UI.