The Redakt content management model comprises a number of different objects that together form a hierarchy of content and metadata. It's important to understand the relation between these different objects in order to develop applications using Redakt.
The following (simplified) entity-relation diagram shows the most important objects and relations within the Redakt content management model. The different entities are described further down in this article.
Node collections
A node collection is, as the name implies, a container for a (hierarchical) collection of nodes. Node collection objects sit at the top of the content management hierarchy. A node collection can be one of the following types:
- Site
A site can have assigned hostnames and contains pages as nodes. - Asset Library
An asset library contains folders and assets as nodes.
Nodes
Nodes are the individual hierarchical items within a node collection. A node either has a parent node or is a root node (of the node collection), thereby forming a tree structure of nodes. A node has a specific node type (f.e. page, folder, or asset) and is of a content model type (a class that implements IContentType
), which is chosen by the content manager when creating a new node. A node can be one of the following types:
- Page
A page node is part of a site node collection. It denotes a single page within the website. A page node has URLs for each content language and may contain multiple versions of (localizable) content. - Folder
A folder node is part of an asset library node collection. It usually does not contain any publishable content itself (although this is possible) but serves as a container for other library assets. - Asset
An asset node is part of an asset library node collection. Like a page node, it may contain multiple versions of (localizable) content, although a single version is more common. Unlike a page, an asset node does not itself have its own URL location.
Which content model types may be created at the root of a node collection or as children of other nodes is determined by attributes placed on the content model classes.
Node versions
A node that contains content-manageable values has one or more node versions. A node version always links to a single localizable content item, and a content item always belongs to only a single node version. Nodes that only serve as a container and do not have content itself (usually folders within an asset library) do not have node versions (and therefore no content).
Node versions allow the same node to have distinctly different content for its content type. At any time, one of the node's versions may be published to the website. This allows content managers to already author a new node version in preparation for publication at a later date, while still maintaining the currently published version as well.
Content items
Content items are the objects that contain the actual property values for a specific piece of content. Content items always contain values for a single content model type (class that implements IContentType
). Content items that are directly linked to a node version (i.e. not nested content) always have the same content type as their owning node.
Content items may be nested, i.e. property values of a content item may themselves be another content item. This allows for complex content structures to be created by content managers.
Which content model types may be created as nested content of other content items, if any, is determined by attributes placed on the content model class properties.
Content items are localizable, meaning that they may contain content values for multiple languages within the same object. For example, if your website supports both English and Spanish, a content item will contain all content model values for both these languages. Content model properties may be marked as culture invariant, meaning a content item will only contain a single value for all languages.
Content revisions
Each time content is saved, a new content revision is created. Therefore, content revisions represent the complete history of changes to the content item. Content values from previous revisions are retained, which allows users to review or roll back to any content revision in the past.
When creating a new node version by copying the content from a previous version, a new content item is created for the new node version, with a copy of the original content as its first revision. Since this is a new content item, it also starts a new content revision history.
Published content
Publishing a node creates a published content object. Published content is a localized, flattened version of a content item combined with node data. A published content object always contains content values for a single language. When publishing multiple languages at the same time, one published content object is saved for each language.
Any nested content that is part of the content item values is dereferenced and embedded within the published content. Other relevant metadata from the node, including name, URL and ancestor node ids is also saved with the published content object, resulting in a single, cacheable object that contains all required data for rendering a page or asset on the website.