Adding-a-type-or-a-field-to-a-strict-type

This section describes how you can add a field to a strict type or a type to an existing namespace that is backward compatible. Note that with the advent of version 7.6 this is no longer an issue. Version 7.6 introduced the concept of relaxed CND which makes all type changes backward compatible. However in case a project still wants to use strict types this section is relevant.

A number of changes to a namespace are backwards compatible and can be carried out without running upgrade modules.  These are

  1. adding a new type
  2. adding a non-mandatory property or child-node definition to an existing strict type

(Note that weak node types do not need to be reloaded for adding fields) 

There are a large number of incompatible changes, including but not limited to

  1. Renaming a property/child node/nodetype
  2. Deleting a property/child node/nodetype
  3. Adding a mandatory property
  4. Modifying the type of a property
  5. Up/down-casting the required type for a child node
  6. Changing the multiplicity of an item definition
  7. Change the orderability of a node type
  8. Modify the super types used (base and/or mixins)

Though this might look restrictive, the most common case is handled easily, as described below.  For non-compatible changes, you can use updater modules to convert the content.

Preparation

It is assumed here that the template, nodetype description and prototype triple (hipposysedit:templatetype node) for the type that is added or modified, is available in a separate XML file.  When adding a field, a hipposysedit:field node must be added to the hippopsysedit:nodetype node for the type that is modified.  Similarly, a property (or child node) should be added to the prototype, containing the default value.

When unsure whether the changes are compatible or not,  backups of the database and the lucene index should be created before starting the procedure.

Dynamic reloading

Within the web console, one can use the "import cnd" functionality to reload the cnd for a namespace.  The templates and prototypes need to be imported too, of course, to be able to use the new type or property.  When adding a type, this can be achieved directly by importing an xml file containing the hipposysedit:templatetype node containing the template, type description and prototype.  When adding a field, the existing node should be removed first.

Startup/bootstrap reloading

To use this functionality in an upgrade, one should remove the corresponding initialization nodes from the initialize folder from an upgrade module.  The templates can be reinitialized in a similar manner, removing templates and their initialization item in the upgrade module.  Even though an upgrade module is used, do not register a namespace visitor; the same namespace version will be used and no run over the content is necessary.

Advanced

When a type is modified and sub-types exist, the templates and prototypes for these sub-types need to be modified too.

Hippo Europe: +31 (0)20 5224466
Hippo North America: +1 (707) 773-4646