The elvisContext functions make it possible to execute built-in functionality of Assets.
This makes it possible for example to open a search tab, browse to a folder, activate a Collection, check-in files, check-out files, and so on.
These functions can be executed from within a plug-in page by using elvisContext. All functions can be tested using the debug plug-in.
openSearch(q, sort)
Opens a search tab and searches on a specified query.
Parameters
q |
The query to search for. For more information, see The Assets Server query syntax. Optional. Default is empty (search all). |
sort |
The sort order of results. For detailed information, see Assets Server REST API - search. Optional. Default is the last used sort setting in the client. |
openBrowse(folderPath, includeSubFolders, q, sort)
Opens a search tab, browsed to a specified folder.
Parameters
folderPath |
The path to browse to. Optional. Default is the root folder. |
includeSubFolders |
Defines if results from subfolders should be included (true | false). Optional. Default is false. |
q |
The query to search for. For more information, see The Elvis 6 query syntax. Optional. Default is empty. |
sort |
The sort order of results. For detailed information, see Elvis 6 REST API - search. Optional. Default is the last used sort setting in the client. |
openAssets(assetIds)
Opens one or more assets in Detail view.
Parameters
assetIds |
A comma-separated list of Assets Server IDs. Required. |
openContainers(containerIds, sort)
Opens one or more Containers in Detail view.
Parameters
containerIds |
A comma-separated list of Assets Server IDs. Required. |
sort |
The sort order of the container children. For detailed information, see Assets Server REST API - search. Optional. Default is the last used sort setting in the client. |
activateContainers(containerIds)
Activate one or more containers (Collections) in the Collection panel of the client.
Parameters
containerIds |
A comma-separated list of Assets Server IDs. Required. |
checkout(assetIds)
Checks-out an asset.
Parameters
assetIds |
A comma-separated list of Assets Server IDs. Required. |
Notes:
|
Metadata fields
Before the method is called, the plug-in should validate the checked-out state of an asset. This can be done by retrieving the following metadata fields by performing an API call to /services/search:
- checkedOut. If the asset is checked-out, the date when this was done is shown.
- checkedOutBy. If he asset is checked-out, the name of the user who checked-out the asset is shown. Use it to compare it with the user name of the currently logged in user.
checkin(assetIds)
Checks-in an asset.
Parameters
assetIds |
A comma-separated list of Assets Server IDs. Required. |
Note: The function is asynchronously executed in Assets and returns immediately without a return value.
Metadata fields
Before the method is called, the plug-in should validate the checked-out state of an asset. This can be done by retrieving the following metadata field by performing an API call to /services/search:
- lastModifiedCheckedOut. If the checked-out asset is updated locally, the date when this was done is shown. When the asset is updated, the asset is available for check-in.
cancelCheckout(assetIds)
Cancels the check-out of a file.
Parameters
assetIds |
A comma-separated list of Assets Server IDs. Required. |
Note: The function is asynchronously executed in Assets and returns immediately without a return value.
Comment
Do you have corrections or additional information about this article? Leave a comment! Do you have a question about what is described in this article? Please contact Support.
0 comments
Please sign in to leave a comment.