public abstract class IlvSVGManagerServlet
extends jakarta.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(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response)
Responds to the servlet request.
|
void |
doPost(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response)
Responds to the servlet request.
|
protected Document |
generateSVGDocument(jakarta.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(jakarta.servlet.http.HttpServletRequest request,
IlvManager manager)
Returns the list of layers that are allowed to be rendered.
|
protected Object |
getLock(jakarta.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(jakarta.servlet.http.HttpServletRequest request)
Returns the
IlvManager used for the specified request. |
protected boolean |
handleRequest(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response)
Responds to the servlet request.
|
void |
init(jakarta.servlet.ServletConfig config)
Initializes the manager servlet.
|
boolean |
isVerbose()
Returns
true if the servlet is in verbose mode. |
protected void |
prepareManager(jakarta.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(jakarta.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, servicepublic IlvSVGManagerServlet(SVGDocumentBuilderConfigurator configurator)
configurator - The configurator that will be used to generate SVG.public void init(jakarta.servlet.ServletConfig config)
throws jakarta.servlet.ServletException
init in interface jakarta.servlet.Servletinit in class jakarta.servlet.GenericServletconfig - The ServletConfig instance.jakarta.servlet.ServletExceptionpublic 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(jakarta.servlet.http.HttpServletRequest request) throws jakarta.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.jakarta.servlet.ServletExceptionprotected IlvManagerLayer[] getLayers(jakarta.servlet.http.HttpServletRequest request, IlvManager manager) throws jakarta.servlet.ServletException
request - The current HTTP request.manager - The manager (returned by getManager).jakarta.servlet.ServletExceptionprotected Object getLock(jakarta.servlet.http.HttpServletRequest request)
request - The current HTTP request.getManager(jakarta.servlet.http.HttpServletRequest)protected void prepareManager(jakarta.servlet.http.HttpServletRequest request,
IlvManager manager)
throws jakarta.servlet.ServletException
request - The current HTTP request.manager - The manager returned by getManager.jakarta.servlet.ServletExceptionprotected Document generateSVGDocument(jakarta.servlet.http.HttpServletRequest request, int width, int height, String[] requestedLayers) throws jakarta.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.jakarta.servlet.ServletExceptionprotected boolean handleRequest(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response)
throws IOException,
jakarta.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.IOExceptionjakarta.servlet.ServletExceptionprotected void prepareSession(jakarta.servlet.http.HttpServletRequest request)
request - The current request.public void doGet(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response)
throws IOException,
jakarta.servlet.ServletException
prepareSession(jakarta.servlet.http.HttpServletRequest) then handleRequest(jakarta.servlet.http.HttpServletRequest, jakarta.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 jakarta.servlet.http.HttpServletrequest - The current HTTP request.response - The HTTP response.IOExceptionjakarta.servlet.ServletExceptionpublic void doPost(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response)
throws IOException,
jakarta.servlet.ServletException
doGet.doPost in class jakarta.servlet.http.HttpServletrequest - The current HTTP request.response - The HTTP response.IOExceptionjakarta.servlet.ServletExceptiondoGet(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse)© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.