Packages
Last updated
Last updated
A package is a plugin that defines a list of features (such as dashboards, datasources etc.) that can be installed by an Live admin user. It also defines a list of required identified channels and plugins. These definitions should be stored inside a manifest file, that can be either yaml or json. An example for a package source structure is shown below:
live-plugins/plugin-my-package
pom.xml
src/main/resource
manifest.yaml
All packages require the plugin-package-manager. Without it, Live will not recognize a package plugin as a package and will not allow the admin user to install the features.
At the moment that a package is installed, the features are not installed automatically. Some of them may require manual configuration. For example, before installing a dashboard, we need to define its perspective.
The package manager plugin requires Live 3.29.0 or newer, and adds a new section to the admin screen. In this section, all installed packages are listed:
Accessing a package, we can visualize its details, as well as activate and deactivate its features. There is also the possibility to inactivate the entire package, providing a way to hide all installed features at once, without losing its configuration.
Package manager plugin is not responsible for restricting access to installed objects, at the moment, installed entities will be responsible for permission semantics. At the moment, Live core features, as well as JS, CSS and Groovy snippets, cannot be edited when created by a plugin.
Packaging also allows the package creator to define a feature README (using markdown) and its version. It's also possible to register the changelog, but it isn't displayed at the user interface yet.
The package manager allows to create packages containing the following features:
Dashboards
Datasources
Lookup Tables
Pipes Modules
Rules
Groovy Snippets *
JS snippets *
CSS snippets *
IMPORTANT: If a package contains a JS or a CSS snippets it must require the web snippets plugin. If it contains a Groovy Snippet, it should require the plugin-groovy. See more about dependecies at required plugins section.
Package manager plugin exposes the EntitiyRegistryService
service, that allows other plugins to register new entities types and, therefore, more features.
All packages require plugin package manager. Without it, Live will not recognize a package plugin as a package and will not allow the admin user to install the features.
As already mentioned, if a package contains a JS or a CSS snippet, it should require the plugin-websnippets. If it contains a Groovy snippet, it should require the plugin-groovy.
These dependencies should be described at the manifest file. The following example shows a package that depends on plugin-package-manager, plugin-websnippets and plugin-feed.
Packages may require certain channel identifications to be configured in Live. This dependencies should also be described at the manifest, using the requiredEntities. For example:
All features can be defined by the manifest file. A example is shown bellow:
IMPORTANT: The version 4 UUID must be generate a must not be reused.
The include
indicates the location of the feature content. So, for this example, the file structure will be:
live-plugins/plugin-my-package
pom.xml
src/main/resource
css-snippets/
packaging_example.css
dashboards/
packaging_example.json
datasources/
packaging_example.pipes
groovy-snippets/
packaging_example.groovy
js-snippets/
packaging_example.js
lookup-tables/
packaging_example.json
pipes-modules/
packaging_example.pipes
rules/
package_example.pipes
manifest.yaml