Relatude Help

The database's start

The modules hook into every database's start through Relatude.DB's start-up services (chapter 2), so nothing in the host's setup can replace them. A database starts in three steps:

  1. The datamodel. After the host's OnDatamodelInit, each module that applies adds its model types. By default a module applies to every database with the CMS content model (IItem), and never to one without a module it depends on.
  2. Before the store opens. Each module registers its transaction plugins, task runners and jobs, even while it is turned off, so its data stays guarded.
  3. After the store opens, in the background. Each active module, dependencies first, makes its missing user groups and custom logs, runs its new seed steps and does its start-up work.

Step 3 runs after the host's OnStoreOpen and alongside its OnStoreOpenBackground. Content that a module's seed data needs, such as the page the events go under, therefore belongs in OnStoreOpen. CmsModules.IsPartOf(name, store) says whether a module is part of a database.