The asset.manager
callback method allows the CRUD (create, read, update and delete) business logic of an asset type to be changed. Thereby, you can use this method to define new methods based on available events. 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 provides an example where the search, list and get methods have been 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 - Overridden method used to call parent implementation
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);