We have created an open-source JavaScript library to simplify building AJAX application in HTML that connect with the Assets Server API. The library has classes that help out with most common tasks needed in HTML pages to show data from Assets Server.
The library is based on the jQuery JavaScript library, making it easy to customize and extend. There is also a prototype-js based version of the samples in the 'prototype-js' branch in Github. The following paragraphs give a short description of the available classes.
- ElvisAPI. This class provides a thin layer around commonly used REST API methods. It streamlines the authentication process and underlying AJAX calls so you can focus on coding your added functionality.
- ElvisPlugin. This class provides utility methods for Assets Server plug-ins, to give access to the elvisContext from Assets.
- HitRenderer. This class simplifies creating HTML of the JSON search results received from the REST API. It can render HTML for hits, the amount of hits found, for a pager to navigate larger number of results and it can handle thumbnail clicks.
- FacetRenderer. This class simplifies creating HTML from the JSON search facets received from the REST API. It can render HTML for facets and it can add search parameters to filter on selected facets.
- ColumnTree. This class renders a folder browser in HTML. It handles browsing through the Assets Server folder structure similar to how this works in Assets. You can select folders and collections use the HitRenderer to display the assets contained in them.
- PreviewLightBox. This class shows a simple overlay over the page and displays the preview for a hit, it can display a preview in the full browser window, it can correctly display all preview types provided by Assets Server and it can navigate back and forth between multiple previews.
Where to get it
The JavaScript library is available on the open-source code collaboration platform GitHub with a number of API sample interfaces.
The JavaScript files and all associated CSS and images are located in the shared_resources/elvis_api folder.
How to contribute
We encourage everyone to share and contribute improvements or new samples with the Assets Server community.
If you have experience with Git and GitHub, it is very easy to make contributions. You can fork the project, make your changes and then send us a pull request so we can review and add your improvements.
If you don't have experience with Git, you can just email patches or zip files to us and we will include them in the samples.
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.