public abstract class IlvSVGManagerServlet
extends javax.servlet.http.HttpServlet
<servletpath>?request=image &width = resulting image width &height= resulting image height [&layer=layer1, layer2] [&viewBox=x,y,width,height]This request returns an SVG image corresponding to the manager. If the layer option is used, the only generated layers are the ones specified. If the
viewBox
option is set, its value overrides the one set with
SVGDocumentBuilderConfigurator.setViewBox(ilog.views.IlvRect)
on the
SVGDocumentBuilderConfigurator
used to generate the SVG in the
the IlvSVGManagerServlet
instance.Constructor and Description |
---|
IlvSVGManagerServlet(SVGDocumentBuilderConfigurator configurator)
Creates a manager servlet.
|
Modifier and Type | Method and Description |
---|---|
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Responds to the servlet request.
|
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Responds to the servlet request.
|
protected Document |
generateSVGDocument(javax.servlet.http.HttpServletRequest request,
int width,
int height,
String[] requestedLayers)
Generates the SVG document.
|
boolean |
getContentLengthEnable()
Returns
true if the servlet support is buffered. |
protected IlvManagerLayer[] |
getLayers(javax.servlet.http.HttpServletRequest request,
IlvManager manager)
Returns the list of layers that are allowed to be rendered.
|
protected Object |
getLock(javax.servlet.http.HttpServletRequest request)
Returns a locking object that is used to lock the contents of the manager
while it is being rendered.
|
abstract IlvManager |
getManager(javax.servlet.http.HttpServletRequest request)
Returns the
IlvManager used for the specified request. |
protected boolean |
handleRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Responds to the servlet request.
|
void |
init(javax.servlet.ServletConfig config)
Initializes the manager servlet.
|
boolean |
isVerbose()
Returns
true if the servlet is in verbose mode. |
protected void |
prepareManager(javax.servlet.http.HttpServletRequest request,
IlvManager manager)
Allows you to prepare the manager view content before the image is
generated or the capabilities are computed.
|
protected void |
prepareSession(javax.servlet.http.HttpServletRequest request)
Prepares a session for the client.
|
void |
setContentLengthEnable(boolean value)
Sets the flag that switches the servlet support in a buffered mode.
|
void |
setVerbose(boolean value)
Turns the verbose mode on and off.
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
public IlvSVGManagerServlet(SVGDocumentBuilderConfigurator configurator)
configurator
- The configurator that will be used to generate SVG.public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
config
- The ServletConfig
instance.javax.servlet.ServletException
public final void setVerbose(boolean value)
isVerbose()
public final boolean isVerbose()
true
if the servlet is in verbose mode.setVerbose(boolean)
public final void setContentLengthEnable(boolean value)
value
- The buffered flag.getContentLengthEnable()
public final boolean getContentLengthEnable()
true
if the servlet support is buffered. The default
value is false
.setContentLengthEnable(boolean)
public abstract IlvManager getManager(javax.servlet.http.HttpServletRequest request) throws javax.servlet.ServletException
IlvManager
used for the specified request.
You can return the same manager every time, or return a manager for each
request session if the content of the manager depends on the session.request
- The current HTTP request.javax.servlet.ServletException
protected IlvManagerLayer[] getLayers(javax.servlet.http.HttpServletRequest request, IlvManager manager) throws javax.servlet.ServletException
request
- The current HTTP request.manager
- The manager (returned by getManager
).javax.servlet.ServletException
protected Object getLock(javax.servlet.http.HttpServletRequest request)
request
- The current HTTP request.getManager(javax.servlet.http.HttpServletRequest)
protected void prepareManager(javax.servlet.http.HttpServletRequest request, IlvManager manager) throws javax.servlet.ServletException
request
- The current HTTP request.manager
- The manager returned by getManager
.javax.servlet.ServletException
protected Document generateSVGDocument(javax.servlet.http.HttpServletRequest request, int width, int height, String[] requestedLayers) throws javax.servlet.ServletException
request
- The current HTTP request.width
- The width of the image.height
- The height of the image.requestedLayers
- An array of layer names to draw, the array may be empty if all
layers have to be drawn.javax.servlet.ServletException
protected boolean handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
false
if the request is
not a request recognized by this servlet. You may override this method to
handle a new type of request, in which case you will have to call the
super method.request
- The current HTTP request.response
- The HTTP response.IOException
javax.servlet.ServletException
protected void prepareSession(javax.servlet.http.HttpServletRequest request)
request
- The current request.public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
prepareSession(javax.servlet.http.HttpServletRequest)
then handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
. You normally do not
need to override this method. To add a new type of request, you can
override the method handleRequest
.doGet
in class javax.servlet.http.HttpServlet
request
- The current HTTP request.response
- The HTTP response.IOException
javax.servlet.ServletException
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
doGet
.doPost
in class javax.servlet.http.HttpServlet
request
- The current HTTP request.response
- The HTTP response.IOException
javax.servlet.ServletException
doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.