DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
| Anchor | ||||
|---|---|---|---|---|
|
Extending the Apache Felix Web Console
| Table of Contents | ||||||||
|---|---|---|---|---|---|---|---|---|
|
The Apache Felix Web Console is extensible in various ways described on this page.
Providing Web Console Plugins
The Web Console can be extended by registering an OSGi service for the interface javax.servlet.Servlet with the service property felix.webconsole.label set to the label (last segment in the URL) of the page. The respective service is called a Web Console Plugin or a plugin for short.
...
To help rendering the response the Apache Felix Web Console bundle provides two options: One option is to extend the AbstractWebConsolePlugin overwriting the renderContent method. The other option is to register the servlet with another service registration property to indicate the desire to wrap the response.
Extending The AbstractWebConsolePlugin
To leverage the rendering of the common header and footer around the plugin's data area, the plugin can extend the abstract org.apache.felix.webconsole.AbstractWebConsolePlugin class implementing the following methods:
...
In addition to these OSGi-oriented setup methods the Web Console itself will call the Servlet.init(ServletConfig) method before putting the plugin into service and the Servlet.destroy() method when the plugin is removed.
Transparent Response Wrapping
While being very simple and straight forward, extending the AbstractWebConsolePlugin actually creates a binding from the plugin provider bundle to the Web Console bundle, which may be undesired. To support the use case of wanting the benefits of the AbstractWebConsolePlugin but wiring independency of the Web Console, a plugin servlet may be registered with a second service registration property (besides the required felix.webconsole.label):
...
It is suggested that plugins extend from the javax.servlet.http.HttpServlet class and implement the appropriate doXxx(HttpServletRequest, HttpServletResponse) methods such as doGet and doPost. In addition, unless non-GET requests are handled through AJAX calls, it is suggested that non-GET requests return a redirect after processing the request.
Providing Resources
ResourceProvider && getResource && spool
...
If the getResource method returns an accessible non-null URL, the request is serviced by sending back the contents of the given URL. Simple caching support is included which handles the If-Modified-Since header and sets the Last-Modified header from the resource URL.
Branding the Web Console
Branding the Web Consle mainly concerns hooking into the looks of the Web Console providing vendor-provided setup like
...
Further issues with respect to extensions
Task FELIX-1013 regarding extensibility of the web console is maintained in our resource tracking system. Please create issues regarding extensibility as subtasks of this master task or at least link to the master task as being related.
...