This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Learn » eZ Publish » The eZ Content Model

The eZ Content Model

Monday 12 May 2008 12:28:00 pm

  • Currently 3 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

The eZ content model serves as the framework for web publishing, media portals, intranets, e-commerce sites, extranets, and more. This article explains the structure of the eZ content model, as well as what makes it extensible and flexible enough to enable the creation of the most demanding and wide-ranging applications.

The management and processing of content is the key component of Content Management Systems. An Enterprise Content Management framework such as eZ Publish is required to offer an even broader approach, in order to be extensible and to meet users' needs.

Active record pattern

When content is stored in a relational database in an object-oriented system, one might think of the well-known active record pattern, where each table in the relational database is mapped to a class in your application. This normally means that an object of this class represents a single row in the database table. The active record pattern is used in web-centric applications like Ruby On Rails and many PHP frameworks.

However, the active record pattern can have undesirable implications, as listed below, if you try to map complex content structures to a database.

  • Extensibility: Offering the ability to create new types of content in an application would mean that the user or administrator has to extend the database schema.
  • Versioning: If content objects inside the application are mapped to single rows in the database, versioning can only be implemented by using multiple column indices on the original ID and the version of the content object. The same is true for object statuses (like “draft” and “published”) and multilingual content.
  • Structuring: Content, once stored in the database, is required to be structured in some way before it is possible to present it to users of the application. In most cases, this means that the data is mapped to some tree structure, commonly describing the navigation structure of a website. If you want to structure content from different tables, you cannot map this to a relational database in any sensible manner. Aggregating such different content into one tree must be done on the application side, which can be impractical.

eZ Publish

eZ Publish uses an implementation of the active record pattern – more precisely a Table Data Gateway – but only as a database abstraction layer, not to directly map content into the database schema. To map content to the database, eZ Publish uses an object-oriented model, as shown in the illustration below.

Simplified eZ Publish database model

As the simplified illustration above shows, the structure is separated into three main parts: content classes, instances and metadata. The developer of an application can use pre-defined classes and create new content classes. Just like a PHP class, each content class has a number of attributes of different datatypes. The actual content is represented as instances of classes and is mapped to the database in a way that facilitates the easy maintenance of different versions, statuses and languages. Both the content class structure and the actual content can be modified at any time without having to change the database structure. A simple “Article” object might have a “Title” attribute of the “string” datatype, as well as a “Body” attribute of the “XML block” datatype. Objects for e-commerce have special “Price” attributes, so that a user can purchase, and pay through payment gateways, products that are assigned different taxes and discounts.

36 542 Users on board!

Tutorial menu


Printer Friendly version of the full article on one page with plain styles


Proudly Developed with from