The JSMA system allows to access system wide settings, and facilities such as the fragment cache.
It also offers introspective tools to all JSMAs.
What can JSMA system do for me?You can use the JSMA system to access the fragment cache, or to lookup system settings like the server host. |
Here is an example on how to read data from a JSMA system:
... function listJSMAs() { var result = {}; var jsmas = system.jsmas; for (var i=0;i<jsmas.length;i++) { var jsma = jsmas[i]; result[jsma.name] = listJSMADetails(jsma); } return result; } ... |
The JSMA system provides the following methods:
Returns the git branch of the IFE installation.
... system.branch // => 'master' ... |
Returns the value of key as string or null if no value is set under the key.
... var value = system.get('some.globalValue'); ... |
The key to be looked up in the flexAttributes.
Returns the hostname that is set up in the IFE configuration.
... system.host // => 'https://example.com' ... |
Increases the value of any flex attribute by 1 permanently in an atomic fashion.
... system.increment("some.globalCount") ... |
The key to be incremented in the flexAttributes.
Returns true, if the cache is active, otherwise false.
... if (system.isCacheActive() === true) { ... } ... |
Returns true, if the developer cache is active, otherwise false.
... if (system.isDeveloperCacheActive () === true) { ... } ... |
Returns a list of objects describing the available jsmas, their methods and arguments.
... system.jsmas // => [{ name: 'address', methods: [{ method: 'update', parameters: [['req', 'attributes']] }] }, ...] ... |
Returns a minified version of CSS
... var minCSS = system.minifyCSS(); ... |
Returns a minified version of JS
... var minJS = system.minifyJS(); ... |
Returns the Backend-Title from the IFE configuration.
... var sysName = system.name(); // => 'IFE ... Staging' ... |
Returns the current time in nanoseconds.
... system.now() // => 1476801294345673109 ... |
Returns the date of the deployment of the current installation.
... system.releaseDate // => '2016-10-18' ... |
Removes the key from the flexAttributes
... system.remove('some.globalValue') ... |
The key to be removed from the flexAttributes.
Returns the git commit hash of the current installation
... system.revision // => 'a026cc7' ... |
Sets the value of a specified key.
... system.set("some.globalValue", "SomeContent"); ... |
The key to be set in the flexAttributes.
The value to be set for the key
The full version string. (Version branch revision releaseDate)
... system.version // => "4.1.0 master a026cc7 2016-10-18" ... |
The version number
... system.versionNumber // => '4.1.0' ... |
generates a uuid
... var uuid = system.generateUUID(); ... |