OmniDB 2.9 introduces the plugin system, a feature that allows users to develop and share their own features that can be plugged into OmniDB without having to deploy the whole application again.
Plugin file architecture
The plugin system is based on hooks that are located in different parts of the interface. Each plugin can subscribe to any hook and have a collection of API functions to perform different tasks, such as creating inner/outer tabs, creating tree nodes and calling python functions in the plugin's python code.
Installing existing Plugins
Every plugin must contain the exact file structure with at least the default files:
These files are contained in a specific folder structure that respects OmniDB's architecture.
To install a plugin just extract its zip file, or copy the contents of its folder if you get it from this repository, to OmniDB's folder that contains the actual application:
Right click on the app then -> Show Package Contents
After installing the plugin you must restart OmniDB in order to load the python related files. When you access OmniDB with loaded plugins you can see them by clicking in the plugin icon on the top right part of the screen:
test_plugin subscribes to a few hooks to show what the API can do. One
of the hooks used is
innerTabMenu called whenever the + tab is clicked in
the inner tab list. This hook allows you to implement custom items in that context
To create a plugin you can start with an existing sample plugin (test_plugin, for instance), that already contains the required folder structure, and then modify the core files to implement your desired features.
You can use the Plugin API as a reference on to use all functions and hooks available so far. Checking existing plugins to have an idea of how to they are used is also helpful.
We strongly recommend that you install a python environment and develop your plugins using Django's development test server as it will be automatically restarted everytime a currently loaded python file is changed.
This link contains a description on
how to install python and all requirements to run OmniDB. After everything is setup
just go to the folder
OmniDB/OmniDB and run:
python manage.py runserver
Configuration file that contains basic information about the plugin.
Every plugin python function is called with 2 parameters:
- my_python_function(p_database_object, p_data)
- p_database_object: OmniDB's database object that contains several attributes and functions to retrieve data from the database.