原文地址:http://dita-ot.sourceforge.net/SourceForgeFiles/doc/plugin/design.html
Design: Create plugin architecture
introduction
There are 2 options for the plugin architecture.
Option One is just like eclipse plugin architecture. We load the plugins every time a build is invoked.
Opion Two is like mozilla firefox. Every time when we installed new plugin, we should start a program to install those plugin and integrate them with toolkit.
Overview
If we want to implement Option One, we need to put the integration step before the preprocess when a build is invoked. If we want to implement Option Two, we can just put integrator as utility in the toolkit and ask users to run that whenever they update, install or remove any plugin. Now we decided to support Option One. So the integrator should be run every time when a build is started and generate the general ant script to be called in the main transformation.
The plugin can also contains the document which serves as the sample document for the plugin. It should contain at least the build script for the document or the document in web pages style with a toc file. The toolkit won't run the build script automatically. Any document plugin with only the source dita files and build script will be considered as the source document plugin and can be build into plugin that toolkit can integrate.
The integration of document is similar to that of ant script. The integrator will generate a general toc file which links to different toc files for each plugin.
Plugin descriptor is an xml file which describe the structure of the plugin and what the plugin contains. The PluginTable search the plugin according plugin descriptor. If there is no plugin descriptor then the plugin cannot be integrated by the toolkit.
Plugin descriptor also contains the dependency information of the plugin and contact information of plugin author. Integrator will validate the dependency between plugins and it will not load the plugin if its required plugin is not loaded. The plugin author information will also be put to website but it can be found in the plugin when the website is inaccessable.