example_plugin might look like this:
example_plugin \- plugin.json \- js \- example_plugin.js \- eg_reporting.js \- requirements.schema \- template \- details.hsvt \- static \- ui.js \- picture.gif \- style.css \- file \- form \- details.json \- i18n \- local \- en.template.json \- en.form.json \- global \- test \- test_feature1.js \- global.js (optional)
plugin.json file describes the plugin.
locals directive is used in the
plugin.json file, these are implemented as additional arguments. For example, with
The Platform uses it to alter the application’s schema when the plugin is installed or updated, and then make the various schema objects available to the plugin as readable names in the plugin’s local schema dictionaries.
HSVT Templates are stored in the
template directory with a
.hsvt file extension.
Files in the
static directory are made available over HTTP. Use it for client side resources like scripts, stylesheets and images.
Note that CSS files are rewritten slightly.
Filenames of files in the
static directory may only contain the characters
a-zA-Z0-9_-, and must have an extension which may only contain
To use these files in your plugin, use the std:plugin:resources() template function to include references to the files in your HTML, or the
staticDirectoryUrl property on your
Plugin object to form URLs.
There is no access control on the files, and they’ll be served to anyone who knows the URL.
Files are served with expiry times several years in the future. Whenever the files are updated, for example on plugin upgrade, the URL of the files is changed.
Files in the
file directory are accessible to the plugin using your plugin’s
This is intended to be used to contain bundled data used by the plugin which should not be publicly available. For example, rarely used lookup data could be stored as JSON files and loaded when required.
file/form directory is the conventional location for files used as form definitions, loaded with the plugin form interface.
static directory for files which are to be made available over HTTP and do not need access control.
Files in the
i18n directory provide resources for internationalisation of this plugin. They are split into
local provides resources for this plugin only, and
global provides them to the entire application. When searching for resources,
local takes priority.
All filenames start with the locale ID, for example,
i18n is short for ‘internationalisation’, which is a very long word.
If you do use a global.js file, it must include the O.plugin() call to create your plugin object, for example,
var example_plugin = O.plugin("example_plugin");