Module system and pluginsο
Open Forms has a plugin system for the several modules. Each module has a specific goal providing some high-level functionality. Each module is invoked in different stages of the form (submission) process.
Within each module, one or more plugins are available that implement the low-level functionality that a module delivers. Often there are plugins for different standards or they implement necessary vendor-specific details.
Typically, a plugin uses some backend to communicate with an external system to perform some task.
Todo
Document other modules: formio, forms.validation,
pre_requests, validations and variables.
Developing pluginsο
Plugins for each module are developed in roughly the same way, but they tend to use a different base class that belongs to that particular module.
Registering a plugin within a module makes it available for form editors to use in their forms.
Adding your pluginο
Plugins are implemented as Django apps (which are essentially Python packages).
Typically you can look at a demo plugin for each module in
openforms.<module>.contrib.demo which acts as an example.
Create the python package in
openforms.<module>.contrib.<vendor>Ensure you have an AppConfig defined in this package, e.g.:
# openforms.<module>.contrib.<vendor>.apps.py class MyPlugin(AppConfig): name = "openforms.<module>.contrib.<vendor>" verbose_name = "My <vendor> plugin" label = "<module>_<vendor>" def ready(self): from . import plugin # noqa
Itβs important to import the plugin as part of the
readyhook of theAppConfig, as this ensures that the plugin is added to the registry.Add the application to
settings.INSTALLED_APPS, this will cause theAppConfigto be loaded.