Not a developer? Go to MovableType.com

News

About the Movable Type Registry

By Byrne Reese
Posted June 8, 2007, in Documentation / Developers / Registry Reference.

This guide is not a comprehensive guide for developers on how to construct, define and develop a plugin. This guide serves merely as a reference for the Movable Type registry used by developers to define the characteristics of their plugins.

For instruction on how to build a plugin, see TODO:Building Your First Plugin.

About Components and The Registry

Movable Type at is core is nothing more than a shell. In essence core provides no functionality directly to user, instead, the core provides a framework for add ons called "components" to register features, functionality, behavior, rules and capabilities with the core framework. The framework then assembles all of these features into a collection of user interfaces and backend components that make Movable Type what it is: a powerful and infinitely extensible publishing and application framework.

The glue that holds all of these features together is called the "registry." Related features and functionality are grouped together in bundles called components. Components, then, provide a very useful, convenient and portable way to define new features and functionality within Movable Type.

This reference manual defines the structure of the core Movable Type registry. New entries can be added to the registry by plugins to augment Movable Type's core feature set.

Plugins vs. Components

The most frequent question developers have is "what is the difference between a component and plugin?" On a technical level there is actually very little difference, but conceptually there is a big difference.

The intent of a component is to define a set of semantics for the central Movable Type registry. In the process they also define the features and functionality that utilize the semantics they define. A plugin on the other hand adds features and functionality utilizing pre-existing registry semantics.

A perfect example of this differentiation is found in the extensible importing framework. The core "CMS Component" is what provides the blogging and publishing system of Movable Type. Without the CMS component there is little relevance to any import functionality because the CMS component defines the core data model for the system that data would be imported into. Therefore the import framework is not "core." The import framework is a set of APIs provided by the CMS component.

Other components within the system define their own internal and external APIs to be utilized by developers, bloggers and readers.

How the Registry Works

The registry works by giving a place for components to store configuration directives and behaviors. The registry is a collection of key/value pairs. Each key is a unique identifier for the value it contains. Keys are then used by the core application and components to lookup those values in order to function according to their definition.

Each component and plugin defines for itself the set of items it wishes to add to the registry within a simple configuration file. This file is in a simple format called YAML, which allows developers to represents very simple data structures in human and machine readable form. The structure of this file is simple and mirrors the structure of the registry itself making it very simple to merge the key/value pairs found within it into the core registry.

Internationalization

Throughout the registry strings are defined that are meant to be displayed through a user interface. These strings are frequently expressed in English. For those strings that may need to be translated in order to appear within the application according to user's language preferences, those string can be wrapped in a "trans" subroutine to signal to Movable Type that a string is translatable. For example:

   $registry = {
permissions => {
'system.create_blog' => {
label => trans("Create Blogs"),
group => 'sys_admin',
order => 100,
},
},
};

For more information on the internationalization of plugins and components, see TODO:Plugin Internationalization.

Back

2 Comments

Jay Allen

Jay Allen on December 4, 2007, 1:36 p.m. Reply

For instruction on how to build a plugin, see TODO:Building Your First Plugin.

FWIW, TODO presumably NOTYETDONE.

Jay Allen

Jay Allen on December 4, 2007, 2:05 p.m. Reply

And another: “TODO:Plugin Internationalization.”

Byrne Reese

Byrne Reese was previously the Product Manager of Movable Type at Six Apart, where he had also held positions as the Manager of Platform Technology and Product Manager for TypePad. Byrne is a huge supporter of the Movable Type user and developer community. He dedicates much of his time to promoting and educating people about Movable Type as well as building the tools and plugins for Movable Type that are showcased on Majordojo. He contributes regularly to open source; and he is an advocate for open protocols and standards like Atom and OpenID.

Website: http://profile.typekey.com/byrnereese