example_plugin might look like this:
example_plugin \- plugin.json \- js \- example_plugin.js \- handle_requests.js \- requirements.schema \- global.js \- static \- ui.js \- picture.gif \- style.css \- template \- page1.html \- file \- form \- details-form.json \- test \- test_feature1.js
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.
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");
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.
HSVT Templates are stored in the
template directory with a
.hsvt file extension.
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.