The BASE application includes an extensions mechanism that makes it possible to dynamically add functions to the GUI without having to edit the JSP code. It is, for example, possible to add menu items in the menu and toolbar buttons in selected toolbars.
Go to the Chapter 21, Plug-ins and extensions.
► ► menu to display a list of possible extension points and all installed extensions. From this page, if you are logged in with enough permissions, it is also possible to configure the extensions system, enable/disable extensions, etc. Read more about this inExtensions can come in two forms, either as an XML file in the BASE Extensions XML format or as a JAR file. A JAR file is required when the extension needs to execute custom-made code or use custom resources such as icons, css stylesheets, or JSP files.
The code examples in this chapter can be downloaded from the BASE plug-ins site: http://baseplugins.thep.lu.se/wiki/net.sf.basedb.examplecode
An extensions point is a place in the BASE core or web client interface
where it is possible to extend the functionality with custom extensions. An
extension point has an ID which must be unique among all existing
extension points. Extension points registered by the BASE web client all
starts with net.sf.basedb.clients.web
prefix. The
extension point also defines an
Action
An extensions is a custom addition to the BASE web client
interface or core API. This can mean a new menu item in the menu or a
new button in a toolbar. An extension must provide an
ActionFactory
An Action
getTitle()
,
getIcon()
and getOnClick()
.
An ActionFactory
A Renderer
A RendererFactory
An ErrorHandlerFactory
LoggingErrorHandlerFactory
A ClientContext
In the BASE web client the context is always a
JspContext
ClientContext
object is provided as a
parameter it is always safe to cast it to a JspContext
object. Extension points in the core usually use a
ClientContext
.
The context can also be used by an extension to request that a specific javascript or stylesheet file should be included in the HTML code.