Resources
What's a Resource?
A Resource is a file linked to a Business object, an External object, a Disposition or a Business Process.
They are a versatile component of the platform and have many use-cases.
Resource types
| Type | Example use-case |
|---|---|
| Image | Image file that can be used in a publication |
| Style CSS | CSS stylesheet for customizing the UI |
| Object icon | Icon set |
| JavaScript | JavaScript file for front-end customization |
| HTML | Used for the content of a publication |
| Markdown | Store a Markdown file |
| Store a PDF file in the application for use in business process | |
| File set | For an external object, it can be used to store a static web site |
| Font | Font file for customizing the UI |
| XML | Store an XML file |
| JSON | Store a JSON file |
| Other | Any other file type |
How to create Resources?
For a Business Object, Disposition or Business Process
Go to the object's form and click Create in the Resources tab :

For an External Object
Use the Create Resources action button in the external object's form :

Configuration
| Field | Description |
|---|---|
| Object | The Business Object, External Object, Disposition or Business Process that uses the resource |
| Type | Type of the resource from (types) |
| Language | Language of the resource ('*' by default, otherwise English or French) |
| Code | Name of the resource |
| Cached? | Tells if the resource is included in the cache or not (No by default) |
Page lifecycle triggers
To run custom code when the UI is ready, or when a page is hidden or shown, create a SCRIPT resource
and attach it to the relevant disposition. Bind the handlers to document:
(function(ui, $) {
$(document).on("ui.ready", function() {
// The UI is ready, after the home page has loaded.
});
$(document).on("ui.pagehide", function(e, persisted) {
// The page is hidden; persisted is true when stored in the back/forward cache.
});
$(document).on("ui.pageshow", function(e, persisted) {
// The page is shown; persisted is true when restored from the back/forward cache.
});
})(window.$ui, jQuery);
The persisted argument distinguishes a page stored in or restored from the back/forward cache
from a page that is unloaded or reloaded.
Using the Java API
The main methods used to access a Resource are:
HTMLTool.getResourceHTMLContent(Grant g, String code)HTMLTool.getResourceCSSContent(Grant g, String code)HTMLTool.getResourceJSContent(Grant g, String code)- See the Javadoc for more details