public class IlvSDMServletSupport extends IlvManagerServletSupport
IlvSDMServlet
.
It adds functionalities to IlvManagerServletSupport
that make it possible to implement a ready-to-use servlet based
on SDM facilities.
This basic implementation works in two modes:
The servlet accepts the following configuration parameters:
"multiSession"
- With the value "true"
,
sets the servlet to multisession mode.
"xmlFile"
- The XML data that is initially loaded
in the SDM engine.
"styleSheet"
- The CSS file that is initially used
by the SDM engine.
"dataURL"
- The URL of a directory where the data
files (style sheets, XML files, icons, and so on) are located
on the server.
ImageMapAreaGeneratorProperty
Constructor and Description |
---|
IlvSDMServletSupport()
Deprecated.
Beginning with Perforce JViews 8.0, use
IlvSDMServletSupport(ServletContext)
instead. |
IlvSDMServletSupport(jakarta.servlet.ServletContext context)
Creates a new SDM servlet support instance in mono-session mode.
|
Modifier and Type | Method and Description |
---|---|
protected String |
findFile(String file)
Finds a data file on the server given a relative URL.
|
String |
getDataURL()
Returns the URL of the directory where the data files
(such as icon files, style sheets, and XML files) are
located.
|
String |
getDefaultStyleSheet()
Returns the default style sheet file.
|
String |
getDefaultXmlFile()
Returns the default XML data file.
|
protected IlvImageMapAreaGenerator |
getImageMapAreaGenerator()
Deprecated.
|
protected IlvImageMapAreaGenerator |
getImageMapAreaGenerator(jakarta.servlet.http.HttpServletRequest request)
Returns the current image map area generator.
|
IlvManagerLayer[] |
getLayers(jakarta.servlet.http.HttpServletRequest request,
IlvManagerView view)
Returns only the nonempty layers.
|
protected Object |
getLock(jakarta.servlet.http.HttpServletRequest request)
Returns a locking object that is used to lock the contents of the manager.
|
IlvManagerView |
getManagerView(jakarta.servlet.http.HttpServletRequest request)
Returns the SDM view associated with the request session.
|
IlvSDMView |
getSDMView(jakarta.servlet.http.HttpServletRequest request)
Returns the SDM view associated with this servlet.
|
protected Object |
getValue(jakarta.servlet.http.HttpServletRequest request,
String key)
This method is used to retrieve any data that is used by the
implementation of the servlet.
|
boolean |
handleRequest(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response)
Responds to HTTP requests.
|
protected void |
initSDMView(jakarta.servlet.http.HttpServletRequest request,
IlvSDMView view)
Initializes the SDM view after it is created for a given session.
|
void |
installImageMapAreaGenerator(jakarta.servlet.http.HttpServletRequest request,
IlvSDMView view)
Installs the image map generator.
|
void |
installImageMapAreaGenerator(IlvSDMView view)
Deprecated.
|
boolean |
isMultiSession()
Returns
true if the servlet is in multisession mode. |
protected void |
prepareManagerView(jakarta.servlet.http.HttpServletRequest request,
IlvManagerView view)
This method is overridden to set the reference zoom of the view and to
add support for
IlvJComponentGraphic objects. |
void |
setDataURL(String url)
Sets the URL of a directory where the data files
(such as icon files, style sheets, and XML files) are
located.
|
void |
setDefaultStyleSheet(String styleSheet)
Sets the default style sheet file.
|
void |
setDefaultXmlFile(String xmlFile)
Sets the default XML data file.
|
void |
setMultiSession(boolean multiSession)
Sets whether the servlet is in multisession mode.
|
void |
setStyleSheet(jakarta.servlet.http.HttpServletRequest request,
String styleSheet)
Sets the style sheet of the SDM engine.
|
protected void |
setValue(jakarta.servlet.http.HttpServletRequest request,
String key,
Object value)
This method is used to store any data that is used by the implementation
of the servlet.
|
void |
setXmlFile(jakarta.servlet.http.HttpServletRequest request,
String xmlFile)
Loads an XML data file in the SDM engine.
|
additionalCapabilities, additionalCapabilities, addServerActionListener, addServerActionListener, beforeDraw, createPopupMenuSupport, createSelectionSupport, encodeImage, generateImage, generateImageWhenSessionExpired, getAdditionalCapabilities, getAntialiasing, getContentLengthEnable, getContext, getDefaultImageMapHREF, getDynamicLayers, getExpirationDate, getGraphicObjectComparator, getHitmapSupport, getImageMapAreaGenerator, getInternalLock, getJPEGQuality, getKey, getManagerBBox, getManagerLayerComparator, getMaxZoomLevel, getMinZoomLevel, getPopupMenuSupport, getSelectionSupport, getTileManager, getZoomLevels, isOverviewLayer, isPopupEnabled, isSelectionEnabled, isVerbose, removeServerActionListener, removeServerActionListener, setAntialiasing, setContentLengthEnable, setImageResponseCachePolicy, setJPEGQuality, setPopupEnabled, setSelectionEnabled, setVerbose, shouldGenerateImageMap, useTileManager
doGetScriptMessage, getParameterValidationListener, getScriptMessageSupport, setParameterValidationListener
@Deprecated public IlvSDMServletSupport()
IlvSDMServletSupport(ServletContext)
instead.public IlvSDMServletSupport(jakarta.servlet.ServletContext context)
context
- The servlet context.public void setMultiSession(boolean multiSession)
multiSession
parameter is true
),
a new SDM view will be created for each different session
connected to this servlet. Otherwise, only one SDM view is
created, and it is shared by all sessions.multiSession
- true
for multisession mode, and
false
for monosession mode.public boolean isMultiSession()
true
if the servlet is in multisession mode.setMultiSession(boolean)
public void setDefaultStyleSheet(String styleSheet)
IlvSDMServlet.init(jakarta.servlet.ServletConfig)
method of the servlet to initialize
the default style sheet used to initialize the SDM engine
when a new client connects to the servlet.styleSheet
- The new default style sheet file.public String getDefaultStyleSheet()
public void setDefaultXmlFile(String xmlFile)
IlvSDMServlet.init(jakarta.servlet.ServletConfig)
method of the servlet to initialize
the default XML file used to initialize the SDM engine
when a new client connects to the servlet.xmlFile
- The new default XML data file.public String getDefaultXmlFile()
public void setDataURL(String url)
url
- The URL.public String getDataURL()
public IlvSDMView getSDMView(jakarta.servlet.http.HttpServletRequest request)
request
- The request being processed.protected void initSDMView(jakarta.servlet.http.HttpServletRequest request, IlvSDMView view)
The default implementation loads the default CSS and XML files if any.
request
- The request being processed.view
- The new SDM view.protected Object getLock(jakarta.servlet.http.HttpServletRequest request)
Hashtable
member variable of the servlet.
getLock
in class IlvManagerServletSupport
request
- The current HTTP request.setValue(HttpServletRequest, String, Object)
,
getValue(HttpServletRequest, String)
public void setStyleSheet(jakarta.servlet.http.HttpServletRequest request, String styleSheet)
request
- The request being processed.styleSheet
- The style sheet file or URL.public void setXmlFile(jakarta.servlet.http.HttpServletRequest request, String xmlFile)
request
- The request being processed.xmlFile
- The name or URL of the XML file containing the data.public 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.handleRequest
in class IlvManagerServletSupport
request
- The current HTTP request.response
- The HTTP response.false
when the request is not recognized by this
servlet.IOException
- The IOException
jakarta.servlet.ServletException
- The ServletException
public IlvManagerLayer[] getLayers(jakarta.servlet.http.HttpServletRequest request, IlvManagerView view)
getLayers
in class IlvManagerServletSupport
request
- The current HTTP request.view
- The manager view.public IlvManagerView getManagerView(jakarta.servlet.http.HttpServletRequest request) throws jakarta.servlet.ServletException
getManagerView
in class IlvManagerServletSupport
request
- The current HTTP request.jakarta.servlet.ServletException
protected void prepareManagerView(jakarta.servlet.http.HttpServletRequest request, IlvManagerView view) throws jakarta.servlet.ServletException
IlvJComponentGraphic
objects.prepareManagerView
in class IlvManagerServletSupport
request
- The current HTTP request.view
- The manager view.jakarta.servlet.ServletException
protected Object getValue(jakarta.servlet.http.HttpServletRequest request, String key)
This method is used to retrieve any data that is used by the implementation of the servlet. The default implementation of this method depends on whether the servlet is in monosession or in multisession mode:
Hashtable
member variable of the servlet.IlvServletPageIdUtil.getSessionAttributeWithPageId(HttpServletRequest, String)
.If you want to implement another strategy to allocate views
to sessions, you need to override this method and the
setValue(jakarta.servlet.http.HttpServletRequest, java.lang.String, java.lang.Object)
method.
request
- The current HTTP request.key
- The key to restore the data.protected void setValue(jakarta.servlet.http.HttpServletRequest request, String key, Object value)
This method is used to store any data that is used by the implementation of the servlet. The default implementation of this method depends on whether the servlet is in monosession or in multisession mode:
Hashtable
member variable of the servlet.IlvServletPageIdUtil.setSessionAttributeWithPageId(HttpServletRequest, String, Object)
.If you want to implement another strategy to allocate views
to sessions, you need to override this method and the
getValue(jakarta.servlet.http.HttpServletRequest, java.lang.String)
method.
request
- The current HTTP request.key
- The key to store the value
.value
- The value to be stored.protected String findFile(String file)
This method uses the base URL specified by setDataURL(java.lang.String)
to find
data files on the server.
file
- The relative URL of the file to find on the server.null
if the file
could not be found.@Deprecated public void installImageMapAreaGenerator(IlvSDMView view)
view
- The SDM view.public void installImageMapAreaGenerator(jakarta.servlet.http.HttpServletRequest request, IlvSDMView view)
request
- The HttpServletRequest
.view
- The SDM view.@Deprecated protected IlvImageMapAreaGenerator getImageMapAreaGenerator()
protected IlvImageMapAreaGenerator getImageMapAreaGenerator(jakarta.servlet.http.HttpServletRequest request)
request
- The HttpServletRequest
object.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.