...
Table of Contents | ||
---|---|---|
|
An asset type , which is also referred to as an artifact type, is a resource in that is used in the Publisher and Store. WSO2 Enterprise Store (ES) ships some default assets: Gadgets and Sites. An asset extension allows you to define a new asset type with a set of custom behaviors and views. The behaviors defined within an asset extension are only applicable for that specific asset type.
...
- Changing an asset view - Modifying the way the asset listing page appears.
- Changing CRUD behavior of an asset - Calling an external end-point endpoint after creating an asset instance.
Therefore, you need to create a new asset extension in such instances to be able to add a new customized asset type to ES.
...
ES Component | Directory |
---|---|
Publisher | <ES_HOME>/repository/deployment/server/jaggeryapps/publisher/extensions/assets/ |
Store | <ES_HOME>/repository/deployment/server/jaggeryapps/store/extensions/assets/ |
The following diagram explained the folder structure of the assets
directory. This diagram shows a number of asset extensions along with the default extension. The default directory contains sub-folders that handle the behavior and views of a generic asset type. In addition, the default
directory provides an example of the directory structure that should be maintained for you need to maintain when adding an asset extension. However, note that each of the listed items are optional. Therefore, an asset extension need not have all of the items indicated in the following diagram. The ES extension model will automatically inherit the CRUD logic and pages from the default
extension folder.
...
- Define a callback method that allows the CRUD logic to be modified.
- Define new pages and APIs.
- Override the current pages and APIs.
- Change the RXT properties of an asset.
- Define a callback method, which is called on the asset data prior to rendering.
For more information, see asset.js Script.
- A
themes
directory- Any partials, JS scripts or CSS files for new or overridden pages are added in this directory.
- This directory is used to customize the view in ES. For more information, see Asset Extension.
- An
apis
directory- Controllers, which either override the existing APIs or add new endpoints, are added in this directory.
- The APIs defined in the
asset.js
asset.server
callback method are looked up in this folder.
- A
pages
directory- Controllers, which either override the existing pages or add new pages, are added to this directory.
- The pages defined in the
asset.js
asset.server
callback method are looked up in this folder.
...