Note: The use of internal plug-ins such as API plug-ins has been deprecated in Assets Server 6.73. Plug-ins should instead be created as an external plug-in.
Action plug-ins are one of the ways of extending the functionality of Assets Server. They extend functionality in Assets and Brand portal by making it possible to open HTML pages while retaining certain context specific information. These plug-ins can be used by clicking custom buttons and menus that are added to the interface.
The plug-in page can be a static HTML page hosted inside the Assets Server plug-ins folder, but it can also be a PHP, ASP, JSP or other page hosted on a different server.
This section contains some tips and tricks to get you started.
Note: For Assets Server 6.59 and higher, the recommended way of developing and installing plug-ins is by hosting them externally. For more information, see Working with external plug-ins in Assets Server.
Sample plug-ins and code samples
The easiest way of getting insight in how plug-ins work, is to review some of the sample action plug-ins. There are developer code samples and ready to use plug-ins available:
- Developer plug-in samples: <Config>/plugins/samples/code_samples/action_plugins
- Sample action plug-ins: <Config>/plugins/samples/action_plugins
You can see how they work and how they are configured. They are open source, so feel free to use them as the starting point of your own plug-in.
There are quite a few simple and easy to understand samples like hello_world and search_in_getty showing the basic possibilities of plug-ins. There are also technically more advanced samples like print_contact_sheet and search_other_elvis.
Configuration
The action plug-in configuration determines the characteristics of your plug-in, make sure you read through Action plug-in - configuration before you start developing.
Client context information
Context information like the currently selected assets or folders and information about the logged in user, is passed to the plug-in page via the elvisContext plug-in. The context is a vital part of almost any action plug-in, making it possible for your code to act on the current state of Assets.
Assets Server API
The context information on selected assets and folders is limited. So plug-ins are often developed in conjunction with the Assets Server API to retrieve extra information such as metadata, original files, previews, etc.
A lot of user interface components are available through the JavaScript libraries, like showing a list of thumbnails, asset previews, facets and many more. Using them makes it really easy to quickly build a plug-in UI.
Test & debug environment
We advise you to use an external web browser for plug-in development & testing, this makes it possible to use the browser's debugging tools to debug HTML, CSS and JavaScript. Test the plug-in in the client after the development process is completed.
One common issue when developing plug-ins that reference html, css or js files from your plug-in folder is that Assets tends to 'cache' your css and js files. To ease development, add the following to your Assets Server config:
preventBrowserCacheForServedFilesOfType=html, htm, css, js
Also check out the debug plug-in, this is a great tool during plug-in development.
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.