asset.manager Method Definitions
You can use the asset.manager
 callback method to override the existing methods to handle the CRUD (create, read, update and delete) business logic of an asset type. The following is the list of methods that are returned by the asset.manager
callback method:
Method | Description |
---|---|
asset.manager.init | Â |
| Creates a new asset instance. |
asset.manager.postCreate | Â |
asset.manager.setAsDefaultAsset | Makes the provided asset the default asset. |
| Updates the asset instance that corresponds to the provided asset ID. |
| Removes the asset instance based on the provided asset ID. |
| Synchronizes an asset instance, by updating the provided asset with the latest values in the registry. |
| Lists the assets bound by a paging object. If a paging object is not provided, then a default paging object is used. |
| Retrieves a single asset based on the UUID. |
| Searches for assets that are bound by a paging object, which is specified in the query restrictions. |
asset.manager.advanceSearch | Â |
asset.manager.searchByGroup | Retrieves a set of assets that are bound by a paging object, and thereafter groups it by a default property. |
asset.manager.getAssetGroup | Retrieves the set of assets that have the same name. |
asset.manager.compareVersions | Â |
asset.manager.setDefaultAssetInfo | Enriches an asset object with information on whether it is a default asset. |
asset.manager.isDefaultAsset | Â |
| Lists the assets that have been recently added. |
| Lists the most popular assets. |
| Retrieves the list of tags that match the provided asset type. |
| Retrieves the list of assets that match the provided tag. |
asset.manager.addTags | Adds a tag to a given asset. |
asset.manager.removeTags | Removes a tag of a given asset. |
asset.manager.getTags | Retrieves the set of tags applied to an asset. |
| Retrieves the average and the rated value of a particular asset type. |
| Rates a given asset instance. |
| Subscribes to an asset. This is used to add a bookmark in ES. |
| Unsubscribes from an asset. This is used to remove a bookmark in ES. |
| Checks if the user who is currently logged in is subscribed to the provided asset. |
| Returns the list of asset subscriptions that belongs to the user who is currently logged into ES. |
asset.manager.getSubscriptionSpace | Â |
| Attaches a life cycle to an asset. |
| Invokes the default life-cycle action. |
| Invokes the provided life-cycle action. |
| Sets the check item at the provided index to the given state. |
| Retrieves all of the check list items for the asset. |
asset.manager.getLifecycleState | Retrieves the state of a specific life cycle. |
asset.manager.getLifecycleHistory | Retrieves the history of a specific life cycle. |
asset.manager.listAllAttachedLifecycles | Â |
asset.manager.createVersion | Added a specific version to an asset type. |
| Retrieves the name of the asset type. |
asset.manager.getVersion | Retrieves the version of an asset type. |
| Retrieves the thumbnail of the asset type. |
| Retrieves the banner of the asset type. |
| Retrieves the temporal value. |
asset.manager.getAssetResources | Retrieves a list of all the fields that represent resources of the asset (e.g., thumbnail, banner and content). |
| Â |
asset.manager.combineWithRxt | Â |
| Renders a page object. This is done by combining the page details with the asset details, which in turn are combined with the RXT template. If an array of assets are provided, then the assets will not be merged with the RXT template. |
| Renders a page object. This is done by combining the assets details with the RXT template. |
| Retrieves the list of categories for a given asset type. |
| Retrieves the list of fields that can be used to search for an asset. |
The default version of all the above asset.manager
methods are defined in <ES_HOME>/modules/rxt/scripts/asset/asset.js
file.
Example 1 - Altering the search, list and get methods
The following code snippet shows how the search, list and get methods can be altered.
asset.manager = function(ctx) { return { search: function(query, paging) { return this._super.search.call(this, query, paging); }, list: function(paging) { return this._super.list.call(this, paging); }, get: function(id) { return this._super.get.call(this, id); } }; };
Â
Example 2 - Calling the parent implementation when overriding a method
A method that is overridden can still call the parent implementation of a method by using the _super
property. You can use the _super
property, which is a reference to the parent object, to call any of the parent methods. An example of this usage is as follows:
return this._super.search.call(this, query, paging);