A portal plugin basically consists of two files, both placed in ui/apps/plugins/portal/[PLUGINNAME]
manifest.json:
and register.js
Every portal plugin needs to be registered. For development purpose this is done by adding it to the DEV_PLUGINS array found in io.ox/portal/widgets.js.
In register.js use the extensionpoint io.ox/portal/widget/[PLUGINNAME]] to define the functions for widget handling.
A widget title can be set:
If the widget title needs to be clickable this can be done by implementing action:
To extend the baton initialize can be used. This is optional.
load is called right after initialize. It returns a deferred object when done.
After load returns, preview draws the content of the widget:
draw is used to draw contend into a side-popup. The side-popup uses the following delegate: '.item, .content.pointer'
Finally use a extensionpoint io.ox/portal/widget/[PLUGINNAME]/settings to make the plugin appear in the portal settings.
To make this plugin editable set editable to true.
Create a edit function in register.js that handles the editprocess. The model and the view of the Plugin are available as arguments.
Add edit: edit to the extensionpoint to make this function available to the view.
If unique is set to true only one instance of this plugin is allowed.