Package org.apache.felix.webconsole
Class AbstractWebConsolePlugin
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.felix.webconsole.AbstractWebConsolePlugin
- All Implemented Interfaces:
Serializable
,Servlet
,ServletConfig
- Direct Known Subclasses:
SimpleWebConsolePlugin
Deprecated.
The Web Console can be extended by registering an OSGi service for the interface
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 of the options is to extend the AbstractWebConsolePlugin overwriting
the renderContent(HttpServletRequest, HttpServletResponse)
method.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate
(BundleContext bundleContext) Deprecated.This method is called from the Felix Web Console to ensure the AbstractWebConsolePlugin is correctly setup.void
Deprecated.This method is called, by the Web Console to de-activate the plugin and release all used resources.static BrandingPlugin
Deprecated.final Bundle
Deprecated.Returns theBundle
pertaining to thebundle context
with which this plugin has been activated.Deprecated.This method should return category string which will be used to render the plugin in the navigation menu.abstract String
getLabel()
Deprecated.Retrieves the label.static final String
getParameter
(HttpServletRequest request, String name) Deprecated.Use the Servlet API for uploadsDeprecated.Returns the title for this plugin as returned bygetTitle()
abstract String
getTitle()
Deprecated.Retrieves the title of the plug-in.org.apache.felix.webconsole.servlet.RequestVariableResolver
getVariableResolver
(ServletRequest request) Deprecated.Returns theRequestVariableResolver
for the given request.void
Deprecated.Logs the message in the levelvoid
Deprecated.Logs the message in the levelstatic final void
setBrandingPlugin
(BrandingPlugin brandingPlugin) Deprecated.static final void
setLogLevel
(int logLevel) Deprecated.Sets the log level to be applied for calls to thelog(int, String)
andlog(int, String, Throwable)
methods.Methods inherited from class javax.servlet.http.HttpServlet
service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, init, log, log
-
Field Details
-
ATTR_FILEUPLOAD
Deprecated.Use the Servlet API for uploadsThis attribute is not supported anymore- See Also:
-
ATTR_FILEUPLOAD_REPO
Deprecated.Use the Servlet API for uploadsThis attribute is not supported anymore- See Also:
-
GET_RESOURCE_METHOD_NAME
Deprecated.Web Console Plugin typically consists of servlet and resources such as images, scripts or style sheets. To load resources, a Resource Provider is used. The resource provider is an object, that provides a method which name is specified by this constants and it is 'getResource'.- See Also:
-
-
Constructor Details
-
AbstractWebConsolePlugin
public AbstractWebConsolePlugin()Deprecated.
-
-
Method Details
-
getServletName
Deprecated.Returns the title for this plugin as returned bygetTitle()
- Specified by:
getServletName
in interfaceServletConfig
- Overrides:
getServletName
in classGenericServlet
- Returns:
- the name of this servlet instance
- See Also:
-
getCategory
Deprecated.This method should return category string which will be used to render the plugin in the navigation menu. Default implementation returns null, which will result in the plugin link rendered as top level menu item. Concrete implementations wishing to be rendered as a sub-menu item under a category should override this method and return a string or definefelix.webconsole.category
OSGi property. Currently only single level categories are supported. So, this should be a simple String.- Returns:
- category
-
activate
Deprecated.This method is called from the Felix Web Console to ensure the AbstractWebConsolePlugin is correctly setup. It is called right after the Web Console receives notification for plugin registration.- Parameters:
bundleContext
- the context of the plugin bundle
-
deactivate
public void deactivate()Deprecated.This method is called, by the Web Console to de-activate the plugin and release all used resources. -
getLabel
Deprecated.Retrieves the label. This is the last component in the servlet path. This method MUST be overridden, if theAbstractWebConsolePlugin()
constructor is used.- Returns:
- the label.
-
getTitle
Deprecated.Retrieves the title of the plug-in. It is displayed in the page header and is also included in the title of the HTML document. This method MUST be overridden, if theAbstractWebConsolePlugin()
constructor is used.- Returns:
- the plugin title.
-
getBundle
Deprecated.Returns theBundle
pertaining to thebundle context
with which this plugin has been activated. If the plugin has not be activated by calling theactivate(BundleContext)
method, this method returnsnull
.- Returns:
- the bundle or
null
if the plugin is not activated.
-
log
Deprecated.Logs the message in the level- Parameters:
level
- The log level at which to log the messagemessage
- The message to log
-
log
Deprecated.Logs the message in the level- Parameters:
level
- The log level at which to log the messagemessage
- The message to logt
- TheThrowable
to log with the message
-
getParameter
Deprecated.Use the Servlet API for uploadsDo not use this method anymore. Use the Servlet API for request parameter handling.- Parameters:
request
- The request objectname
- The name of the parameter- Returns:
- The parameter value or
null
if the parameter is not set
-
getBrandingPlugin
Deprecated.Returns theBrandingPlugin
currently used for web console branding.- Returns:
- the brandingPlugin
-
setBrandingPlugin
Deprecated.Sets theBrandingPlugin
to use globally by all extensions of this class for branding.Note: This method is intended to be used internally by the Web Console to update the branding plugin to use.
- Parameters:
brandingPlugin
- the brandingPlugin to set
-
setLogLevel
public static final void setLogLevel(int logLevel) Deprecated.Sets the log level to be applied for calls to thelog(int, String)
andlog(int, String, Throwable)
methods.Note: This method is intended to be used internally by the Web Console to update the log level according to the Web Console configuration.
- Parameters:
logLevel
- the maximum allowed log level. If message is logged with lower level it will not be forwarded to the logger.
-
getVariableResolver
public org.apache.felix.webconsole.servlet.RequestVariableResolver getVariableResolver(ServletRequest request) Deprecated.Returns theRequestVariableResolver
for the given request.The resolver is added to the request attributes via the web console main servlet before it invokes any plugins. The preset properties are
appRoot
set to the value of theWebConsoleConstants.ATTR_APP_ROOT
request attribute andpluginRoot
set to the value of theWebConsoleConstants.ATTR_PLUGIN_ROOT
request attribute.- Parameters:
request
- The request whose attribute is returned- Returns:
- The
RequestVariableResolver
for the given request. - Since:
- 3.5.0
-
AbstractServlet