public abstract class IlvManagerServlet
extends jakarta.servlet.http.HttpServlet
<servletpath>request=image &bbox=x,y,width,height (manager coordinate system) &layer=layer1, layer2 &width= resulting image width &height= resulting image height &format=JPEG [&bgcolor=0xffffff] [&transparent=false]This request returns an image corresponding to the (x,y,width,height) area of the manager.
<servletpath>request=capabilities &format=[json|octect-stream]This request returns information on the manager. It can be of two different formats:
<html> <head> <script language="JavaScript"> var minx=0.0; var miny=0.0; var maxx=1024.0; var maxy=512.0; var themes=new Array(); var overviewthemes=new Array(); themes[0]="a layer name"; overviewthemes[0]=true; themes[1]="another layer"; overviewthemes[1]=true; themes[2]="a third layer"; overviewthemes[2]=true; var maxZoom=6; </script> </head> </body> </html>Once the HTML page is loaded by the client browser, the JavaScript code is executed. You can then query the JavaScript variables.
java.io.DataOutput
and is organized like this:
Double: Left coordinate of manager's bounding box. Double: Top coordinate of manager's bounding box. Double: Right coordinate of manager's bounding box. Double: Bottom coordinate of manager's bounding box. Int: Number of layers. For each layer: String (UTF format): Name of the layer. Boolean: Whether or not the layer is an overview layer. Double: Maximum zoom levelThis servlet allows installing a user customized
IlvHitmapDefinition
by setting an init
parameter like this:
<init-param> <param-name>hitmap</param-name> <param-value>mypackage.MyHitmapDefinition</param-value> </init-param>Where
mypackage.MyHitmapDefinition
must be a subclass of
IlvHitmapDefinition
.Modifier and Type | Field and Description |
---|---|
static String |
ImageMapAreaGeneratorProperty
The name of the property that is used during the generation of
an image map.
|
Constructor and Description |
---|
IlvManagerServlet()
Creates a
IlvManagerServlet . |
IlvManagerServlet(IlvManagerServletSupport support)
Deprecated.
Beginning with JViews 8.1 use a subclass and redefine
createServletSupport(ServletContext) instead. |
Modifier and Type | Method and Description |
---|---|
protected void |
additionalCapabilities(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.ServletOutputStream out,
String mimeFormat)
Deprecated.
beginning with JViews 8.1 use
getAdditionalCapabilities(HttpServletRequest) instead. |
void |
addServerActionListener(ServerActionListener listener)
Adds the specified listener to receive events when an action
is requested from the client.
|
protected void |
beforeDraw(jakarta.servlet.http.HttpServletRequest request,
IlvManagerView view)
Called before the image is created.
|
protected IlvManagerServletSupport |
createServletSupport(jakarta.servlet.ServletContext context)
Returns a new instance of
IlvManagerServletSupport . |
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 BufferedImage |
generateImage(jakarta.servlet.http.HttpServletRequest request,
IlvRect bbox,
int width,
int height,
String[] requestedLayers,
Color bgColor,
boolean transparent)
Generates the image.
|
protected Map |
getAdditionalCapabilities(jakarta.servlet.http.HttpServletRequest request)
Allows you to put additional capabilities to the capability request.
|
boolean |
getAntialiasing()
Returns
true if the manager view is antialiased when the image is generated. |
boolean |
getContentLengthEnable()
Returns
true if the servlet support is bufferized. |
protected String |
getDefaultImageMapHREF(jakarta.servlet.http.HttpServletRequest request,
IlvManagerView view)
Returns the HREF that corresponds to the background of the
image map.
|
protected IlvImageMapAreaGenerator |
getImageMapAreaGenerator(jakarta.servlet.http.HttpServletRequest request,
IlvGraphic obj,
IlvManagerView view,
IlvTransformer t)
Returns the area generator for the specified graphic object.
|
float |
getJPEGQuality()
Returns the quality of the produced JPEG file.
|
protected IlvManagerLayer[] |
getLayers(jakarta.servlet.http.HttpServletRequest request,
IlvManagerView view)
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.
|
protected IlvRect |
getManagerBBox(jakarta.servlet.http.HttpServletRequest request,
IlvManagerView view)
Computes the bounding box of the manager.
|
abstract IlvManagerView |
getManagerView(jakarta.servlet.http.HttpServletRequest request)
Returns the manager view used for the specified request.
|
protected double |
getMaxZoomLevel(jakarta.servlet.http.HttpServletRequest request,
IlvManagerView view)
Returns the maximum zoom level authorized by the servlet.
|
protected IlvManagerServletSupport |
getServletSupport()
Returns the
IlvManagerServletSupport instance. |
protected IlvManagerServletSupport |
getSupport()
Deprecated.
Beginning with JViews 8.1 use
getServletSupport() instead. |
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.
|
protected boolean |
isOverviewLayer(jakarta.servlet.http.HttpServletRequest request,
IlvManagerLayer layer)
Returns
true if the specified layer returned
by getLayers should be displayed in an overview window. |
boolean |
isVerbose()
Returns
true if the servlet is on verbose mode. |
protected void |
prepareManagerView(jakarta.servlet.http.HttpServletRequest request,
IlvManagerView view)
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)
Prepare a session for the client.
|
void |
removeServerActionListener(ServerActionListener listener)
Removes the specified listener so that it no longer receives events
generated from the client.
|
void |
setAntialiasing(boolean value)
Sets the antialiasing of the manager view when the image generated.
|
void |
setContentLengthEnable(boolean value)
Sets the flag that switches the servlet support in a bufferized mode.
|
void |
setJPEGQuality(float quality)
Sets the quality of the produced JPEG file.
|
void |
setVerbose(boolean value)
Turns the verbose mode on and off.
|
protected boolean |
shouldGenerateImageMap(jakarta.servlet.http.HttpServletRequest request,
IlvManagerLayer layer,
IlvManagerView view,
IlvTransformer t)
Returns
true if image map information should be
generated for the specified layer. |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
public static final String ImageMapAreaGeneratorProperty
IlvImageMapAreaGenerator
,
Constant Field Valuespublic IlvManagerServlet()
IlvManagerServlet
.@Deprecated public IlvManagerServlet(IlvManagerServletSupport support)
createServletSupport(ServletContext)
instead.support
- The manager servlet support.public void init(jakarta.servlet.ServletConfig config) throws jakarta.servlet.ServletException
init
in interface jakarta.servlet.Servlet
init
in class jakarta.servlet.GenericServlet
config
- The ServletConfig
instance.jakarta.servlet.ServletException
@Deprecated protected final IlvManagerServletSupport getSupport()
getServletSupport()
instead.protected final IlvManagerServletSupport getServletSupport()
IlvManagerServletSupport
instance.
The servlet delegates most operations to the servlet support.
Derived classes can access the servlet support to implement high level
functionality.protected IlvManagerServletSupport createServletSupport(jakarta.servlet.ServletContext context)
IlvManagerServletSupport
.public final void setVerbose(boolean value)
isVerbose()
public final boolean isVerbose()
true
if the servlet is on verbose mode.setVerbose(boolean)
public final void setJPEGQuality(float quality)
quality
- can be in the [0,1] range, 0 for bad quality
and high compression, 1 for high quality and poor compression.
The default value is 0.75
.getJPEGQuality()
public final float getJPEGQuality()
setJPEGQuality(float)
public final void setAntialiasing(boolean value)
value
- the new antialising state of the manager viewgetAntialiasing()
public final boolean getAntialiasing()
true
if the manager view is antialiased when the image is generated.
The default value is true.setAntialiasing(boolean)
public final void setContentLengthEnable(boolean value)
value
- The bufferized flag.getContentLengthEnable()
public final boolean getContentLengthEnable()
true
if the servlet support is bufferized.
The default value is false
.setContentLengthEnable(boolean)
public abstract IlvManagerView getManagerView(jakarta.servlet.http.HttpServletRequest request) throws jakarta.servlet.ServletException
request
- The current HTTP request.jakarta.servlet.ServletException
protected IlvRect getManagerBBox(jakarta.servlet.http.HttpServletRequest request, IlvManagerView view) throws jakarta.servlet.ServletException
request
- The current HTTP request.view
- The manager view returned by getManagerView
.jakarta.servlet.ServletException
protected double getMaxZoomLevel(jakarta.servlet.http.HttpServletRequest request, IlvManagerView view)
request
- The current HTTP request.view
- The manager view returned by getManagerView
.protected IlvManagerLayer[] getLayers(jakarta.servlet.http.HttpServletRequest request, IlvManagerView view) throws jakarta.servlet.ServletException
request
- The current HTTP request.view
- The manager view (returned by getManagerView
).jakarta.servlet.ServletException
protected boolean isOverviewLayer(jakarta.servlet.http.HttpServletRequest request, IlvManagerLayer layer)
true
if the specified layer returned
by getLayers
should be displayed in an overview window.
The default implementation
always return true
.request
- The current HTTP request.layer
- A manager layer.getLayers(jakarta.servlet.http.HttpServletRequest, ilog.views.IlvManagerView)
protected Object getLock(jakarta.servlet.http.HttpServletRequest request)
request
- The current HTTP request.getManagerView(jakarta.servlet.http.HttpServletRequest)
protected IlvImageMapAreaGenerator getImageMapAreaGenerator(jakarta.servlet.http.HttpServletRequest request, IlvGraphic obj, IlvManagerView view, IlvTransformer t)
request
- the current HTTP request.obj
- the graphic object for which the area will be generated.view
- the manager view for the specified request.t
- the transformer used to draw the view.protected boolean shouldGenerateImageMap(jakarta.servlet.http.HttpServletRequest request, IlvManagerLayer layer, IlvManagerView view, IlvTransformer t)
true
if image map information should be
generated for the specified layer.request
- the current HTTP request.layer
- the layer.view
- the manager view for the specified request.t
- the transformer used to draw the view.protected String getDefaultImageMapHREF(jakarta.servlet.http.HttpServletRequest request, IlvManagerView view)
null
meaning no HREF.request
- the current HTTP request.view
- the manager view for the specified request.public final void addServerActionListener(ServerActionListener listener)
IlvView.performAction()
method
is called. This method queries the server for a new image, but
additional parameters are sent in the image request so that
an action such as adding, removing, or selecting objects can be
performed before the image is generated. An action is
defined by a name and a list of parameters. To implement
the action on the client side, you will implement
the ServerActionListener
interface
and check the action name and parameters in the event.listener
- The listener.removeServerActionListener(ilog.views.servlet.ServerActionListener)
public final void removeServerActionListener(ServerActionListener listener)
listener
- The listener.addServerActionListener(ilog.views.servlet.ServerActionListener)
@Deprecated protected void additionalCapabilities(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.ServletOutputStream out, String mimeFormat)
getAdditionalCapabilities(HttpServletRequest)
instead., 'myprop1' : 'myvalue1', 'myprop2' : 'myvalue2'
request
- The current HTTP request.out
- The servlet output stream for writing additional
capabilities.mimeFormat
- since JViews 8.1 always set to "json"protected Map getAdditionalCapabilities(jakarta.servlet.http.HttpServletRequest request)
Map
should contain pairs of propertyName
and propertyValue
for each additional capability.request
- The current HTTP request.null if none
).protected void beforeDraw(jakarta.servlet.http.HttpServletRequest request, IlvManagerView view) throws jakarta.servlet.ServletException
request
- The current HTTP request.view
- The manager view returned by getManagerView
.jakarta.servlet.ServletException
protected void prepareManagerView(jakarta.servlet.http.HttpServletRequest request, IlvManagerView view) throws jakarta.servlet.ServletException
request
- The current HTTP request.view
- The manager view returned by getManagerView
.jakarta.servlet.ServletException
protected BufferedImage generateImage(jakarta.servlet.http.HttpServletRequest request, IlvRect bbox, int width, int height, String[] requestedLayers, Color bgColor, boolean transparent) throws jakarta.servlet.ServletException
request
- The current HTTP request.bbox
- The area of the manager to draw.width
- The width of the image.height
- The height of the image.requestedLayers
- An array of layer names to draw.bgColor
- The background color of the imagetransparent
- Indicates if the image should be transparent.jakarta.servlet.ServletException
protected 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 overwrite this method to handle a new type
of request, in this case you will have to call the super method.request
- the current Http request.response
- the Http response.IOException
jakarta.servlet.ServletException
protected 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 overwrite this method. To add a new type of request, you
can overwrite the method handleRequest
.doGet
in class jakarta.servlet.http.HttpServlet
request
- The current HTTP request.response
- The HTTP response.IOException
jakarta.servlet.ServletException
public void doPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException
doGet
.doPost
in class jakarta.servlet.http.HttpServlet
request
- The current HTTP request.response
- The HTTP response.IOException
jakarta.servlet.ServletException
doGet(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.