Page History
...
The base of a theme is the index file from which the main page is build. Blueriq uses a template engine called StringTemplate to make server properties available in the client.
A default Blueriq index page is injected with a template context that features the following properties:
Property | Type | Description | |
---|---|---|---|
theme | String | Name of the theme currently selected | |
apiBasePath | String | Base path for the web API | |
webResourcesBasePath | String | Base path for web resources | |
extensions | Object (ExtensionContext) | Contains all registered CSS and JavaScript files | |
cssExtensionUrls | String[] | URLs to all registered CSS files | |
jsExtensionUrls | String[] | URLs to all registered JavaScript files | |
sessionId | String | Current session id | |
currentPageJson | String | Current page in JSON format | |
developmentMode | boolean | Indicates whether or not the application runs in development mode | |
sessionTimeout | int | Configured session timeout in seconds |
When creating a custom theme you need to provide an index file.
Creating the index file
The index file is the starting point of a custom theme and is a StringTemplate template that follows a certain structure. For full details on the StringTemplate syntax and usage please check the official documentation.
A StringTemplate index file in Blueriq has the following structure:
Code Block | ||||
---|---|---|---|---|
| ||||
delimiters "$", "$" main(context) ::= << [HTML] >> |
First the delimiters to use around StringTemplate variables are set to "$" instead of the default "<" ">" delimiters to be able to use variables within HTML.
Configuration
In order to configure your theme so it will be known by the Runtime several properties must be set. The following example shows properties for registering a theme named "custom_dashboard":
...