Skip to content
Jonathan Bullock edited this page Jun 6, 2016 · 6 revisions

Plugin System

This is an initial draft for building a plugin system, and describes the plugin system at a high level.

Features

The plugin system should have at least the following features:

  • Being able to retrieve content from external sources (DBs, REST services, etc)

  • Being able to manipulate content before it’s processed with relevant markup engine (Markdown/AsciiDoc/HTML)

  • Being able to manipulate content after it’s processed with relevant markup engine (Markdown/AsciiDoc/HTML)

  • Be able to process asset files, i.e. minification, LESS/SASS support

  • Be simple to use

Use cases

Implementation

Initial idea is to have a number of plugin interfaces each one defines the hook point in the system/pipeline. For example AssetProcessPlugin or PreRenderingPlugin and each.

Each plugin interface will define the relevant method signature for that hook point and will include a context that will provide the plugin class with access to elements such as the Content Store that are relevant at that point.

ServiceLoader could be used to locate and execute each plugin, so plugins could be added by placing them on the classpath or in the /lib or even /plugin folder.

Considerations

Maybe need to consider order of execution of multiple plugins for same plugin interface?