ilog.views.faces.dhtml.servlet
Class IlvFacesManagerServletSupport

java.lang.Object
  extended by ilog.views.servlet.IlvManagerServletSupport
      extended by ilog.views.faces.dhtml.servlet.IlvFacesManagerServletSupport
All Implemented Interfaces:
IlvDHTMLConstants, IlvDHTMLFrameworkConstants, IlvFacesConstants, IlvFrameworkConstants

public class IlvFacesManagerServletSupport
extends IlvManagerServletSupport
implements IlvFacesConstants, IlvDHTMLFrameworkConstants

The IlvFacesManagerServletSupport class is an extension of the IlvManagerServletSupport that handles requests coming from the DHTML faces view component.

Since:
JViews 6.5

Field Summary
protected static String IMAGE_MAP_GENERATOR_PARAM
          The name of the image map generator request parameter.
protected static String TILE_MANAGER_PARAM
           
 
Fields inherited from class ilog.views.servlet.IlvManagerServletSupport
ImageMapAreaGeneratorProperty
 
Fields inherited from interface ilog.views.faces.IlvFacesConstants
BUTTON_GROUP_ID, BUTTON_TYPE, CHARTS_BUNDLE, CORE_BUNDLE, CURSOR, DATA, DECODED_PROPERTY, DEFAULT_LINE_COLOR, DELETION_ALLOWED, DIAGRAMMER_BUNDLE, ENABLED, FILL_ON, FORCE_UPDATE_PROPERTIES, FRAMEWORK_BUNDLE, GANTT_BUNDLE, HEIGHT, IMAGE, IMAGE_MODE, INFO_PROVIDER_MB, INT_NOT_DEFINED, ITEM_DISABLED_STYLE_CLASS, ITEM_HIGHLIGHTED_STYLE_CLASS, ITEM_STYLE_CLASS, LINE_COLOR, LINE_WIDTH, MAPS_BUNDLE, MENU_MODEL_ID, MESSAGE, MESSAGE_BOX, MESSAGE_BOX_ID, MOVE_ALLOWED, OBJECT_FINDER, PARAM_COMPID, PARAM_DATA, PARAM_KEY, PARAM_NAMESPACE, PARAM_RESOURCE, PARAM_SERVICE, PARAM_TYPE, POPUP_MENU, POPUP_MENU_FACTORY, POPUP_MENU_FACTORY_CLASS, PORTLET_NAMESPACE, PROJECT, RESOURCES_PATH, RESOURCES_PATH_PREFIX, ROLLOVER_IMAGE, SELECTED, SELECTED_IMAGE, SERVICE_FORWARD, SERVICE_FORWARD_INT, SERVLET, SERVLET_CLASS, SERVLET_URL, STYLE, STYLE_CLASS, TGO_BUNDLE, TITLE, TOGGLE, VALUE, VIEW, VIEW_ID, WIDTH
 
Fields inherited from interface ilog.views.faces.dhtml.IlvDHTMLFrameworkConstants
SESSION_ID_PREFIX, STATE_URL, STATIC_LAYERS_COUNT_PARAM, TILE_MANAGER, UPDATE_INTERVAL
 
Fields inherited from interface ilog.views.faces.IlvFrameworkConstants
ACTION_NAME, AUTO_REFRESH, BOUNDING_BOX, CONSTRAINED_ON_CONTENTS, INTERACTOR, INTERACTOR_ID, MAX_ZOOM_LEVEL, MIN_ZOOM_LEVEL, NB_BUTTONS, ORIENTATION, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, PAN_FACTOR, STATIC_LAYERS_COUNT, TILE_SIZE, VISIBLE_LAYERS, ZOOM_FACTOR, ZOOM_LEVELS
 
Fields inherited from interface ilog.views.faces.IlvFacesConstants
BUTTON_GROUP_ID, BUTTON_TYPE, CHARTS_BUNDLE, CORE_BUNDLE, CURSOR, DATA, DECODED_PROPERTY, DEFAULT_LINE_COLOR, DELETION_ALLOWED, DIAGRAMMER_BUNDLE, ENABLED, FILL_ON, FORCE_UPDATE_PROPERTIES, FRAMEWORK_BUNDLE, GANTT_BUNDLE, HEIGHT, IMAGE, IMAGE_MODE, INFO_PROVIDER_MB, INT_NOT_DEFINED, ITEM_DISABLED_STYLE_CLASS, ITEM_HIGHLIGHTED_STYLE_CLASS, ITEM_STYLE_CLASS, LINE_COLOR, LINE_WIDTH, MAPS_BUNDLE, MENU_MODEL_ID, MESSAGE, MESSAGE_BOX, MESSAGE_BOX_ID, MOVE_ALLOWED, OBJECT_FINDER, PARAM_COMPID, PARAM_DATA, PARAM_KEY, PARAM_NAMESPACE, PARAM_RESOURCE, PARAM_SERVICE, PARAM_TYPE, POPUP_MENU, POPUP_MENU_FACTORY, POPUP_MENU_FACTORY_CLASS, PORTLET_NAMESPACE, PROJECT, RESOURCES_PATH, RESOURCES_PATH_PREFIX, ROLLOVER_IMAGE, SELECTED, SELECTED_IMAGE, SERVICE_FORWARD, SERVICE_FORWARD_INT, SERVLET, SERVLET_CLASS, SERVLET_URL, STYLE, STYLE_CLASS, TGO_BUNDLE, TITLE, TOGGLE, VALUE, VIEW, VIEW_ID, WIDTH
 
Fields inherited from interface ilog.views.faces.dhtml.IlvDHTMLConstants
AUTO_SUBMIT, BACKGROUND_COLOR, CAPABILITIES_LOADED_HANDLER, COMPONENT, DO_ACTION_ON_BG_DESELECT, ERROR_MESSAGE, GENERATE_IMAGE_MAP, IMAGE_FORMAT, IMAGE_LOADED_HANDLER, IMAGE_MAP_GENERATOR, IMAGE_MAP_GENERATOR_CLASS, IMAGE_MAP_VISIBLE, IMAGE_SERVLET_CONTEXT, INVOCATION_CONTEXT, JSF_CONTEXT, ON_CLICK, ON_SELECTION_CHANGED, PORTLET_CONTEXT_KEY, PORTLET_SESSION_KEY, REPLACE_PATTERN, RESIZABLE, SESSION_EXP_HANDLER, SUBMITTED_VALUE, WAITING_IMAGE
 
Fields inherited from interface ilog.views.faces.IlvFacesConstants
BUTTON_GROUP_ID, BUTTON_TYPE, CHARTS_BUNDLE, CORE_BUNDLE, CURSOR, DATA, DECODED_PROPERTY, DEFAULT_LINE_COLOR, DELETION_ALLOWED, DIAGRAMMER_BUNDLE, ENABLED, FILL_ON, FORCE_UPDATE_PROPERTIES, FRAMEWORK_BUNDLE, GANTT_BUNDLE, HEIGHT, IMAGE, IMAGE_MODE, INFO_PROVIDER_MB, INT_NOT_DEFINED, ITEM_DISABLED_STYLE_CLASS, ITEM_HIGHLIGHTED_STYLE_CLASS, ITEM_STYLE_CLASS, LINE_COLOR, LINE_WIDTH, MAPS_BUNDLE, MENU_MODEL_ID, MESSAGE, MESSAGE_BOX, MESSAGE_BOX_ID, MOVE_ALLOWED, OBJECT_FINDER, PARAM_COMPID, PARAM_DATA, PARAM_KEY, PARAM_NAMESPACE, PARAM_RESOURCE, PARAM_SERVICE, PARAM_TYPE, POPUP_MENU, POPUP_MENU_FACTORY, POPUP_MENU_FACTORY_CLASS, PORTLET_NAMESPACE, PROJECT, RESOURCES_PATH, RESOURCES_PATH_PREFIX, ROLLOVER_IMAGE, SELECTED, SELECTED_IMAGE, SERVICE_FORWARD, SERVICE_FORWARD_INT, SERVLET, SERVLET_CLASS, SERVLET_URL, STYLE, STYLE_CLASS, TGO_BUNDLE, TITLE, TOGGLE, VALUE, VIEW, VIEW_ID, WIDTH
 
Constructor Summary
IlvFacesManagerServletSupport()
          Deprecated. Beginning with JViews 8.1 use IlvFacesManagerServletSupport(ServletContext) instead.
IlvFacesManagerServletSupport(javax.servlet.ServletContext context)
          Creates an new IlvFacesManagerServletSupport instance.
 
Method Summary
protected  void additionalCapabilities(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletOutputStream out, String mimeFormat)
          Allows you to add additional capabilities to the capability request.
protected  IlvPopupMenuServletSupport createPopupMenuSupport()
          Creates a new instance of popup menu servlet support.
protected  BufferedImage generateImage(javax.servlet.http.HttpServletRequest request, IlvRect bbox, int width, int height, String[] requestedLayers, Color bgColor, boolean transparent)
          Generates the image.
protected  FacesContext getFacesContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Returns an artificial faces context to use value bindings.
protected  IlvImageMapAreaGenerator getImageMapAreaGenerator(javax.servlet.http.HttpServletRequest request, IlvGraphic obj, IlvManagerView view, IlvTransformer t)
          Returns the area generator for the specified graphic object.
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.
 IlvManagerView getManagerView(javax.servlet.http.HttpServletRequest request)
          Returns the manager view used for the specified request.
protected  IlvMenuFactory getMenuFactory(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Retrieves or creates the menu factory used in this popup menu request.
 IlvTileManager getTileManager(javax.servlet.http.HttpServletRequest request)
          Returns the tile manager.
 boolean handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Responds to HTTP requests.
protected  void installImageMapAreaGenerator(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Installs the image map generator passed as a request parameter.
protected  void installImageMapAreaGenerator(IlvManager manager, IlvImageMapAreaGenerator generator)
          Deprecated. Since JViews 8.1 use shouldGenerateImageMap(HttpServletRequest, IlvManagerLayer, IlvManagerView, IlvTransformer)} and/or getImageMapAreaGenerator(HttpServletRequest, IlvGraphic, IlvManagerView, IlvTransformer) to filter the objects that will generate image map areas.
protected  boolean isOverviewRequest(javax.servlet.http.HttpServletRequest request)
          Returns true if the specified request is an overview image request, false otherwise.
protected  boolean isSessionExpired(javax.servlet.http.HttpServletRequest request)
          This method returns true if the session has expired.
protected  void prepareManagerView(javax.servlet.http.HttpServletRequest request, IlvManagerView view)
          Allows you to prepare the manager view content before the image is generated or the capabilities are computed. Overridden to configure the manager view for tiling and to add support for IlvJComponentGraphic objects.
protected  boolean shouldGenerateImageMap(javax.servlet.http.HttpServletRequest request, IlvManagerLayer layer, IlvManagerView view, IlvTransformer t)
          Returns true if image map information should be generated for the specified layer.
 
Methods inherited from class ilog.views.servlet.IlvManagerServletSupport
addServerActionListener, beforeDraw, createSelectionSupport, encodeImage, getAdditionalCapabilities, getAntialiasing, getContentLengthEnable, getContext, getDefaultImageMapHREF, getDynamicLayers, getExpirationDate, getGraphicObjectComparator, getInternalLock, getJPEGQuality, getKey, getLayers, getManagerBBox, getManagerLayerComparator, getMaxZoomLevel, getMinZoomLevel, getPopupMenuSupport, getSelectionSupport, getZoomLevels, isOverviewLayer, isPopupEnabled, isSelectionEnabled, isVerbose, removeServerActionListener, setAntialiasing, setContentLengthEnable, setImageResponseCachePolicy, setJPEGQuality, setPopupEnabled, setSelectionEnabled, setVerbose, useTileManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGE_MAP_GENERATOR_PARAM

protected static final String IMAGE_MAP_GENERATOR_PARAM
The name of the image map generator request parameter.

Since:
JViews 7.5
See Also:
Constant Field Values

TILE_MANAGER_PARAM

protected static final String TILE_MANAGER_PARAM
Since:
JViews 8.0
See Also:
Constant Field Values
Internal method or field: do not use!
Constructor Detail

IlvFacesManagerServletSupport

public IlvFacesManagerServletSupport()
Deprecated. Beginning with JViews 8.1 use IlvFacesManagerServletSupport(ServletContext) instead.

Creates an new IlvFacesManagerServletSupport instance.

Since:
JViews 7.5

IlvFacesManagerServletSupport

public IlvFacesManagerServletSupport(javax.servlet.ServletContext context)
Creates an new IlvFacesManagerServletSupport instance.

Parameters:
context - The servlet context
Method Detail

createPopupMenuSupport

protected IlvPopupMenuServletSupport createPopupMenuSupport()
Creates a new instance of popup menu servlet support.

Overrides:
createPopupMenuSupport in class IlvManagerServletSupport
Returns:
A new popup menu servlet support.

getFacesContext

protected FacesContext getFacesContext(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response)
Returns an artificial faces context to use value bindings. If no current instance is found a new one is created.

Parameters:
request - The http request.
response - The http response.
Returns:
A faces context instance.
Since:
JViews 7.5

installImageMapAreaGenerator

protected void installImageMapAreaGenerator(IlvManager manager,
                                            IlvImageMapAreaGenerator generator)
Deprecated. Since JViews 8.1 use shouldGenerateImageMap(HttpServletRequest, IlvManagerLayer, IlvManagerView, IlvTransformer)} and/or getImageMapAreaGenerator(HttpServletRequest, IlvGraphic, IlvManagerView, IlvTransformer) to filter the objects that will generate image map areas.

Installs the specified image map generator in all the objects of the manager.

Parameters:
manager - The manager
generator - The image map generator
Since:
JViews 7.5

installImageMapAreaGenerator

protected void installImageMapAreaGenerator(javax.servlet.http.HttpServletRequest request,
                                            javax.servlet.http.HttpServletResponse response)

Installs the image map generator passed as a request parameter.

Parameters:
request - The HTTP request
response - The HTTP response
Since:
JViews 7.5

getImageMapAreaGenerator

protected IlvImageMapAreaGenerator getImageMapAreaGenerator(javax.servlet.http.HttpServletRequest request,
                                                            IlvGraphic obj,
                                                            IlvManagerView view,
                                                            IlvTransformer t)
Returns the area generator for the specified graphic object.

Overrides:
getImageMapAreaGenerator in class IlvManagerServletSupport
Parameters:
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.

shouldGenerateImageMap

protected boolean shouldGenerateImageMap(javax.servlet.http.HttpServletRequest request,
                                         IlvManagerLayer layer,
                                         IlvManagerView view,
                                         IlvTransformer t)
Returns true if image map information should be generated for the specified layer.

Overrides:
shouldGenerateImageMap in class IlvManagerServletSupport
Parameters:
request - The current HTTP request.
layer - The layer.
view - The manager view for the specified request.
t - The transformer used to draw the view.

isSessionExpired

protected boolean isSessionExpired(javax.servlet.http.HttpServletRequest request)
This method returns true if the session has expired.

Parameters:
request - The request being processed.
Returns:
true if the session expired.

isOverviewRequest

protected boolean isOverviewRequest(javax.servlet.http.HttpServletRequest request)
Returns true if the specified request is an overview image request, false otherwise.

Parameters:
request - The http request.
Returns:
true if the specified request is an overview image request, false otherwise.
Since:
JViews 7.5

getManagerView

public IlvManagerView getManagerView(javax.servlet.http.HttpServletRequest request)
                              throws javax.servlet.ServletException
Returns the manager view used for the specified request. You can return always the same manager view, or return a manager view for each request session if the content of the manager depends on the session.

Specified by:
getManagerView in class IlvManagerServletSupport
Parameters:
request - The current HTTP request.
Throws:
javax.servlet.ServletException

getMenuFactory

protected IlvMenuFactory getMenuFactory(javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response)
                                 throws javax.servlet.ServletException
Retrieves or creates the menu factory used in this popup menu request.

Parameters:
request - The http request.
response - The http response.
Returns:
The factory that will generate the requested popup menu.
Throws:
javax.servlet.ServletException
Since:
JViews 7.5

handleRequest

public boolean handleRequest(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws IOException,
                             javax.servlet.ServletException
Responds to HTTP requests. This method responds to image or capabilities requests . It returns false if the request is not a request recognized by this servlet.

Overrides:
handleRequest in class IlvManagerServletSupport
Parameters:
request - The current HTTP request.
response - The HTTP response.
Returns:
false when the request is not recognized by this servlet.
Throws:
IOException
javax.servlet.ServletException

generateImage

protected BufferedImage generateImage(javax.servlet.http.HttpServletRequest request,
                                      IlvRect bbox,
                                      int width,
                                      int height,
                                      String[] requestedLayers,
                                      Color bgColor,
                                      boolean transparent)
                               throws javax.servlet.ServletException
Generates the image. You may override this method to add additional information on the generated image.

Overrides:
generateImage in class IlvManagerServletSupport
Parameters:
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 image
transparent - Indicates if the image should be transparent.
Throws:
javax.servlet.ServletException

getTileManager

public IlvTileManager getTileManager(javax.servlet.http.HttpServletRequest request)
                              throws javax.servlet.ServletException
Returns the tile manager. The tile manager is responsible for retrieving and/or storing image tiles.

Overrides:
getTileManager in class IlvManagerServletSupport
Parameters:
request - The http request.
Returns:
The tile manager.
Throws:
javax.servlet.ServletException

additionalCapabilities

protected void additionalCapabilities(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.ServletOutputStream out,
                                      String mimeFormat)
Allows you to add additional capabilities to the capability request. They must be put in the stream as a JSON fragment. Example:
   , 'myprop1' : 'myvalue1', 'myprop2' : 'myvalue2'
 

Overrides:
additionalCapabilities in class IlvManagerServletSupport
Parameters:
request - The current HTTP request.
out - The servlet output stream for writing additional capabilities.
mimeFormat - since JViews 8.1 always set to "json"

prepareManagerView

protected void prepareManagerView(javax.servlet.http.HttpServletRequest request,
                                  IlvManagerView view)
                           throws javax.servlet.ServletException
Allows you to prepare the manager view content before the image is generated or the capabilities are computed. The current implementation does nothing. Overridden to configure the manager view for tiling and to add support for IlvJComponentGraphic objects.

Overrides:
prepareManagerView in class IlvManagerServletSupport
Parameters:
request - The current HTTP request.
view - The manager view returned by getManagerView.
Throws:
javax.servlet.ServletException
Since:
JViews 8.0

getLock

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.

The default implementation returns an object that identifies the manager view. This allows the getManagerView method to always return the same IlvManagerView without leading to multithreading problems.

This lock must never be taken on the AWT/Swing thread, otherwise deadlocks may occur.

Overrides:
getLock in class IlvManagerServletSupport
Parameters:
request - The current HTTP request.
See Also:
IlvManagerServletSupport.getManagerView(javax.servlet.http.HttpServletRequest)


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.