Holds the content-type configuration for a tenant: the asset type definitions loaded from the content-types repository, and the paths to the JS source files that back them. Written as the root types element of the content-types repository's types.xml, with one source element per JS file to load. AssetTypeService deserialises an instance of this class from the repository's types.xml, merges in the individual *.type.xml asset type files, then calls init to build a Nashorn script engine from the configured JS sources and wire it into any asset-type element (such as a JsContentItemAssetView) that needs to invoke a named function against it. Implements JsExecutor so a function reference or function name can be invoked through executeJs.
Group: Content
Implements: JsExecutor
Properties
| Property | Returns | Description |
|---|---|---|
| assetTypeErrors | List<String> | Per-file parse errors collected while loading the individual asset type (*.type.xml) files, one message per file that could not be parsed. |
| assetTypes | List<AssetType> | The asset type definitions configured for this content-type repository. |
| jsPaths | List<String> | Paths to the JS source files that are loaded into this content type's script engine when init runs. |
| loadError | String | Describes why loading the content-type configuration failed outright, if it did. Set only when AssetTypeService could not parse the content-type configuration at all, in which case this instance carries no asset types. |
Methods
getJsPaths()
Returns: List<String>
Paths to the JS source files that are loaded into this content type's script engine when init runs.
getAssetTypes()
Returns: List<AssetType>
The asset type definitions configured for this content-type repository.
executeJs(Object func, Object args)
Returns: Object
Invokes a function on the content-type repository's script engine, given either a JS function reference or the name of a global function, and returns its result. Returns null when there is no function, when the named function does not exist, or when the engine failed to build - in each of those cases a warning is logged rather than an exception thrown.
| Parameter | Description |
|---|---|
func | a JS function reference, or the name of a global function to invoke |
args | the arguments passed to the function |
getLoadError()
Returns: String
Describes why loading the content-type configuration failed outright, if it did. Set only when AssetTypeService could not parse the content-type configuration at all, in which case this instance carries no asset types.
getAssetTypeErrors()
Returns: List<String>
Per-file parse errors collected while loading the individual asset type (*.type.xml) files, one message per file that could not be parsed.