Package org.apache.felix.webconsole
Class SimpleWebConsolePlugin
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.apache.felix.webconsole.AbstractWebConsolePlugin
-
- org.apache.felix.webconsole.SimpleWebConsolePlugin
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
@Deprecated public abstract class SimpleWebConsolePlugin extends AbstractWebConsolePlugin
Deprecated.Either register a servlet using Servlet API 5 or useAbstractServletSimpleWebConsolePlugin is an utility class that provides default implementation of theAbstractWebConsolePluginand supports the following features:- Methods for (un)registering the web console plugin service
- Default implementation for resource loading
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.felix.webconsole.AbstractWebConsolePlugin
ATTR_FILEUPLOAD, ATTR_FILEUPLOAD_REPO, GET_RESOURCE_METHOD_NAME
-
-
Constructor Summary
Constructors Constructor Description SimpleWebConsolePlugin(String label, String title, String[] css)Deprecated.Creates new Simple Web Console Plugin with the default category (null)SimpleWebConsolePlugin(String label, String title, String category, String[] css)Deprecated.Creates new Simple Web Console Plugin with the given category.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidactivate(org.osgi.framework.BundleContext bundleContext)Deprecated.This method is called from the Felix Web Console to ensure the AbstractWebConsolePlugin is correctly setup.voiddeactivate()Deprecated.This method will close all service trackers, created bygetService(String)method.StringgetCategory()Deprecated.This method should return category string which will be used to render the plugin in the navigation menu.protected String[]getCssReferences()Deprecated.Returns a list of CSS reference paths ornullif no additional CSS files are provided by the plugin.StringgetLabel()Deprecated.Retrieves the label.protected URLgetResource(String path)Deprecated.Called internally byAbstractWebConsolePluginto load resources.ObjectgetService(String serviceName)Deprecated.Gets the service with the specified class name.StringgetServletName()Deprecated.Returns the title for this plugin as returned byAbstractWebConsolePlugin.getTitle()StringgetTitle()Deprecated.Retrieves the title of the plug-in.SimpleWebConsolePluginregister(org.osgi.framework.BundleContext bc)Deprecated.This is an utility method.voidunregister()Deprecated.An utility method that removes the service, registered by theregister(BundleContext)method.-
Methods inherited from class org.apache.felix.webconsole.AbstractWebConsolePlugin
doGet, endResponse, getBrandingPlugin, getBundle, getBundleContext, getParameter, getResourceProvider, getVariableResolver, isHtmlRequest, log, log, readTemplateFile, renderContent, renderMenu, renderTopNavigation, sendRedirect, setBrandingPlugin, setLogLevel, startResponse
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
-
-
-
-
Constructor Detail
-
SimpleWebConsolePlugin
public SimpleWebConsolePlugin(String label, String title, String[] css)
Deprecated.Creates new Simple Web Console Plugin with the default category (null)- Parameters:
label- the front label. SeeAbstractWebConsolePlugin.getLabel()title- the plugin title . SeeAbstractWebConsolePlugin.getTitle()css- the additional plugin CSS. SeeAbstractWebConsolePlugin.getCssReferences()
-
SimpleWebConsolePlugin
public SimpleWebConsolePlugin(String label, String title, String category, String[] css)
Deprecated.Creates new Simple Web Console Plugin with the given category.- Parameters:
label- the front label. SeeAbstractWebConsolePlugin.getLabel()title- the plugin title . SeeAbstractWebConsolePlugin.getTitle()category- the plugin's navigation category. SeeAbstractWebConsolePlugin.getCategory()css- the additional plugin CSS. SeeAbstractWebConsolePlugin.getCssReferences()
-
-
Method Detail
-
activate
public void activate(org.osgi.framework.BundleContext bundleContext)
Deprecated.Description copied from class:AbstractWebConsolePluginThis 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.- Overrides:
activatein classAbstractWebConsolePlugin- Parameters:
bundleContext- the context of the plugin bundle
-
getServletName
public String getServletName()
Deprecated.Description copied from class:AbstractWebConsolePluginReturns the title for this plugin as returned byAbstractWebConsolePlugin.getTitle()- Specified by:
getServletNamein interfacejavax.servlet.ServletConfig- Overrides:
getServletNamein classAbstractWebConsolePlugin- See Also:
GenericServlet.getServletName()
-
getLabel
public final String getLabel()
Deprecated.Description copied from class:AbstractWebConsolePluginRetrieves the label. This is the last component in the servlet path. This method MUST be overridden, if theAbstractWebConsolePlugin()constructor is used.- Specified by:
getLabelin classAbstractWebConsolePlugin- Returns:
- the label.
- See Also:
AbstractWebConsolePlugin.getLabel()
-
getTitle
public final String getTitle()
Deprecated.Description copied from class:AbstractWebConsolePluginRetrieves 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.- Specified by:
getTitlein classAbstractWebConsolePlugin- Returns:
- the plugin title.
- See Also:
AbstractWebConsolePlugin.getTitle()
-
getCategory
public String getCategory()
Deprecated.Description copied from class:AbstractWebConsolePluginThis 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.categoryOSGi property. Currently only single level categories are supported. So, this should be a simple String.- Overrides:
getCategoryin classAbstractWebConsolePlugin- Returns:
- category
- See Also:
AbstractWebConsolePlugin.getCategory()
-
getCssReferences
protected final String[] getCssReferences()
Deprecated.Description copied from class:AbstractWebConsolePluginReturns a list of CSS reference paths ornullif no additional CSS files are provided by the plugin.The result is an array of strings which are used as the value of the
hrefattribute of the<link>elements placed in the head section of the HTML generated. If the reference is a relative path, it is turned into an absolute path by prepending the value of theWebConsoleConstants.ATTR_APP_ROOTrequest attribute.- Overrides:
getCssReferencesin classAbstractWebConsolePlugin- Returns:
- The list of additional CSS files to reference in the head
section or
nullif no such CSS files are required. - See Also:
AbstractWebConsolePlugin.getCssReferences()
-
getResource
protected URL getResource(String path)
Deprecated.Called internally byAbstractWebConsolePluginto load resources. This particular implementation depends on the label. As example, if the plugin is accessed as/system/console/abc, and the plugin resources are accessed like/system/console/abc/res/logo.gif, the code here will try load resource/res/logo.giffrom the bundle, providing the plugin.- Parameters:
path- the path to read.- Returns:
- the URL of the resource or
nullif not found.
-
register
public final SimpleWebConsolePlugin register(org.osgi.framework.BundleContext bc)
Deprecated.This is an utility method. It is used to register the plugin service. Don't forget to call theunregister()when the plugin is no longer needed.- Parameters:
bc- the bundle context used for service registration.- Returns:
- self
-
unregister
public final void unregister()
Deprecated.An utility method that removes the service, registered by theregister(BundleContext)method.
-
getService
public final Object getService(String serviceName)
Deprecated.Gets the service with the specified class name. Will create a newServiceTrackerif the service is not already got.- Parameters:
serviceName- the service name to obtain- Returns:
- the service or
nullif missing.
-
deactivate
public void deactivate()
Deprecated.This method will close all service trackers, created bygetService(String)method. If you override this method, don't forget to call the super.- Overrides:
deactivatein classAbstractWebConsolePlugin- See Also:
AbstractWebConsolePlugin.deactivate()
-
-