Plugins allow DART to read and write data formats (such as tar, zip, etc.), to upload and download files using various protocols (such as s3, ftp, etc.), to communicate with the REST APIs of remote repositories (such as APTrust) and to help users through the complexities of initial setup and configuration (such as the APTrust and DPN setup modules).
The documentation in this section gives a high-level overview plugin structure and behavior as a starting point for developing your own plugins. You'll find more detail information in DART's API documentation and source code, as well as in the unit tests that accompany existing plugins. Along with an overview of each plugin type, this documentation provides relevant links to source and test code for further study.
The Base Plugin
id - A UUID string that uniquely identifies the plugin. When writing a plugin, you should generate this once. It lives from then on as a hard-coded identifier.
name - The name of the plugin. This will appear in parts of the DART UI that use the plugin.
description - A description of what the plugin does.
version - The plugin version, which is a string. E.g. '1.0.14'.
readsFormats - A list of strings, this applies only to plugins that can read data from formats such as zip, tar, rar, parchive, etc. The values in this field should be the file extensions of the types of files the plugin can read. For example, ['.tar.', '.gz', '.gzip', '.tar.gz']. This should be empty for plugins that are not intended to read file formats. Use all lower case letters.
writesFormats - A list of strings indicating the file formats the plugin can write. E.g. ['.tar.', '.gz', '.gzip', '.tar.gz']. This should be empty for plugins that are not intended to write file formats. Use all lower case letters.
implementsProtocols - The network protocols that this plugin implements. For example, an FTP plugin may implement ['ftp', 'sftp', 'ftps']. This applies only to plugins of type NetworkClient. If your plugin is not a NetworkClient, this should be an empty list. Use all lower case letters.
talksToRepository - This describes what type of repository your plugin talks to. For example, 'fedora', 'aptrust', etc. This applies only to plugins of type Repository. If your plugin is not a Repository plugin, this should be empty. Use all lower case letters.
The PluginManager uses these descriptions to tell the application what plugins are available and what capabilities they have.
Plugins are EventEmitters. They can work synchronously or asynchronously, but they must emit a standard set of events to communicate with the UI (or the JobRunner, when DART runs in command-line mode).
Format Readers read file formats, such as tar, zip, and anything else a developer might want.
Format Writers write file formats.
Network Clients provide methods for uploading and download via different network protocols.
Repo Clients provide communication between DART and the REST APIs of remote repositories.
The PluginManager provides methods for discovering and loading installed plugins.