This content is archived. See latest version here

Last updated: Mar 31 2014

Meta models can be extended through the use of Modules. A Module is part of the meta model providing the main entry point in the client for all extensibility objects. Modules can be installed in the system and activated from the meta class.

A module consists of the following:

  • A module manifest - defines information about the module and references to module the configuration.
  • A module configuration - the .NET class that implemented the IModuleConfigurator interface.

The Module Manager loads and calls the Module Configurator methods when a module is activated, deactivated, installed or uninstalled. Each module should implement the Module Configurator.

Remember that a meta model can only be modified in Design mode. Refer to the MetaClassManager Class section for more information.

All classes referred to here are available in the Mediachase.BusinessFoundation.Data.Modules namespace.

Default modules

The following modules are default: Change Tracking, History and Localization.

Change Tracking

Change Tracking adds new fields to a meta class and registers the user and the date and time of modification. After activation, the Change Tracking module will add these meta field:

  • Created - updates this field when a new meta object is created.
  • Modified - updates this field when a new meta object is modified
  • CreatorId - copies the current user meta information from DataContext to this field when a new meta object is created.
  • ModifierId - copies the current user meta information from DataContext to this field when a new meta object is created.

Call the CreateModuleManifest of the ChangeTrackingManager class to get the module manifest.

History

History saves meta object modifications to the history meta class. After activation, the History module creates a meta class named [MetaClassName]\_History, and creates a copy of the entity object if selected field is modified. The [MetaClassName]\_History meta class will have an ObjectId field that has the original primary key value.

  • Call CreateModuleManifest of the HistoryManager class to get the module manifest.
  • Call SetSelectedFields of the HistoryManager class, passing the meta class to set the collection of selected fields.
  • Call GetSelectedFields of the HistoryManager class, passing the meta class to get the collection of selected fields.

You can read the history of the entity object from the [MetaClassName]_History meta class

Localization

The Localization module allows fro localization of field values.

Do the following to define available languages after installation:

  • Call GetInstalledLanguages of theLocalizationManager class to get installed languages.
  • Call InstallLanguage of the LocalizationManager class passing the culture info Name, to install a new language.
  • Call UninstallLanguage of the LocalizationManager class passing the culture info Name, to uninstall a language.

After activation, you should define localizable field. The localization module creates a new field named [FieldName]_[ThreeLetterWindowsLanguageName]. You can use this field to read or save localizable values. If the value is null you should use the orginal field to get a value. When adding a new language, the localization module automatically creates new fields

  • Call GetLocalizableFields of the LocalizationManager to get localizable fields.
  • Call ActivateFieldLocalization of the LocalizationManager, passing the meta class and meta field to activate field localization.
  • Call DeactivateFieldLocalization of the LocalizationManager, passing meta class and meta field to deactivate field localization.

Installing a module

Call Install of the ModuleManager class, passing the module manifest and attributes to install a new module.

Activating a module

Call Activate of the ModuleManager class, passing the module manifest and meta class to activate a module in the meta class.

Deactivating a module

Call Deactivate of the ModuleManager class, passing the module manifest and meta class to deactivate a module.

Uninstalling a module

Call Uninstall of the ModuleManager class, passing the module manifest to uninstall a module.


Do you have feedback on this documentation? Send an email to documentation@episerver.com. For development-related questions and discussions, refer to our Forums on https://world.episerver.com/forum/