public abstract class AbstractWebConsolePlugin
extends javax.servlet.http.HttpServlet
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_FILEUPLOAD
The name of the request attribute containig the map of FileItems from the POST request
|
static String |
GET_RESOURCE_METHOD_NAME |
Constructor and Description |
---|
AbstractWebConsolePlugin() |
Modifier and Type | Method and Description |
---|---|
void |
activate(org.osgi.framework.BundleContext bundleContext) |
void |
deactivate() |
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Renders the web console page for the request.
|
protected void |
endResponse(PrintWriter pw) |
static BrandingPlugin |
getBrandingPlugin() |
protected org.osgi.framework.BundleContext |
getBundleContext() |
protected String[] |
getCssReferences()
Returns a list of CSS reference paths or
null if no
additional CSS files are provided by the plugin. |
abstract String |
getLabel() |
static String |
getParameter(javax.servlet.http.HttpServletRequest request,
String name) |
protected Object |
getResourceProvider()
Returns the object which might provide resources.
|
String |
getServletName()
Returns the title for this plugin as returned by
getTitle() |
abstract String |
getTitle() |
protected boolean |
isHtmlRequest(javax.servlet.http.HttpServletRequest request)
Detects whether this request is intended to have the headers and
footers of this plugin be rendered or not.
|
protected abstract void |
renderContent(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res) |
protected void |
renderTopNavigation(javax.servlet.http.HttpServletRequest request,
PrintWriter pw) |
protected void |
sendRedirect(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String redirectUrl)
Utility method to handle relative redirects.
|
static void |
setBrandingPlugin(BrandingPlugin brandingPlugin) |
protected PrintWriter |
startResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
public static final String ATTR_FILEUPLOAD
public static final String GET_RESOURCE_METHOD_NAME
public String getServletName()
getTitle()
getServletName
in interface javax.servlet.ServletConfig
getServletName
in class javax.servlet.GenericServlet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
startResponse(HttpServletRequest, HttpServletResponse)
renderTopNavigation(HttpServletRequest, PrintWriter)
renderContent(HttpServletRequest, HttpServletResponse)
endResponse(PrintWriter)
Note: If a resource is sent back for the request only the first step is executed. Otherwise the first step is a null-operation actually and the latter four steps are executed in order.
doGet
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
protected boolean isHtmlRequest(javax.servlet.http.HttpServletRequest request)
true but has been overwritten in the
WebConsolePluginAdapter
for the plugins.
public void activate(org.osgi.framework.BundleContext bundleContext)
public void deactivate()
public abstract String getTitle()
public abstract String getLabel()
protected abstract void renderContent(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOException
javax.servlet.ServletException
IOException
protected String[] getCssReferences()
null
if no
additional CSS files are provided by the plugin.
The result is an array of strings which are used as the value of
the href
attribute 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 the WebConsoleConstants.ATTR_APP_ROOT
request attribute.
null
if no such CSS files are required.protected org.osgi.framework.BundleContext getBundleContext()
protected Object getResourceProvider()
getResource
method.
This method may be overwritten by extensions. This base class implementation returns this instance.
null
if no
resources will be provided by this plugin.protected PrintWriter startResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
IOException
protected void renderTopNavigation(javax.servlet.http.HttpServletRequest request, PrintWriter pw)
protected void endResponse(PrintWriter pw)
public static String getParameter(javax.servlet.http.HttpServletRequest request, String name)
protected void sendRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String redirectUrl) throws IOException
IOException
public static BrandingPlugin getBrandingPlugin()
public static void setBrandingPlugin(BrandingPlugin brandingPlugin)
brandingPlugin
- the brandingPlugin to setCopyright © 2006–2013 The Apache Software Foundation. All rights reserved.