ilog.tgo.faces.graph.dhtml.servlet
Class IltFacesGraphServletSupport

java.lang.Object
  extended by ilog.views.servlet.IlvManagerServletSupport
      extended by ilog.views.faces.dhtml.servlet.IlvFacesManagerServletSupport
          extended by ilog.tgo.faces.graph.dhtml.servlet.IltFacesGraphServletSupport
All Implemented Interfaces:
IltFacesJTGOConstants, IlvDHTMLConstants, IlvDHTMLFrameworkConstants, IlvFacesConstants, IlvFrameworkConstants
Direct Known Subclasses:
IltFacesEquipmentServletSupport, IltFacesNetworkServletSupport

public abstract class IltFacesGraphServletSupport
extends IlvFacesManagerServletSupport
implements IltFacesJTGOConstants

This class implements the servlet support for IltFacesGraphServlet class.

Since:
JViews 7.5

Field Summary
protected  Comparator<IlvGraphic> graphicObjectComparator
          Comparator used to sort the IlvGraphic instances for image map purposes.
protected  Comparator<IlvManagerLayer> managerLayerComparator
          Comparator used to sort the IlvManagerLayer instances for image map purposes.
 
Fields inherited from class ilog.views.faces.dhtml.servlet.IlvFacesManagerServletSupport
IMAGE_MAP_GENERATOR_PARAM, TILE_MANAGER_PARAM
 
Fields inherited from class ilog.views.servlet.IlvManagerServletSupport
ImageMapAreaGeneratorProperty
 
Fields inherited from interface ilog.tgo.faces.IltFacesJTGOConstants
CONTEXT, DATA_SOURCE, DATA_SOURCE_ID, DEFAULT_STYLE_SHEET, EQUIPMENT, NETWORK, OBJECT_ACTION_MB, PROPERTY_ACCESSOR, STYLE_SHEETS
 
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
IltFacesGraphServletSupport(javax.servlet.ServletContext ctx)
          Constructor.
 
Method Summary
protected abstract  void addJSFActionListeners()
          Adds the server actions that invokes the select interactors' value change listener.
protected  FacesContext createFacesContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Creates a faces context to be used by the select (and select rectangle) actions.
protected  IlvPopupMenuServletSupport createPopupMenuSupport()
          Creates a new instance of popup menu servlet support.
protected  IlvSelectionSupport createSelectionSupport()
          Creates a new instance of selection servlet support.
static IlvManagerLayer[] FilterLayers(IlvManagerLayer[] source)
          Filters out the internal JViews TGO layers from a given list of layers.
 IlvManagerLayer[] getDynamicLayers(javax.servlet.http.HttpServletRequest request, IlvManagerView view)
          Returns all the IlvManagerLayer instances that are not part of the graph's background.
protected  Comparator<IlvGraphic> getGraphicObjectComparator(IlvManagerLayer layer, IlvManagerView view, javax.servlet.http.HttpServletRequest request)
          Returns a Comparator implementation that will be used to sort the IlvGraphic instances in the given layer that need to have their image map generated.
protected abstract  IlpGraphView getGraphView(javax.servlet.http.HttpServletRequest request)
          Returns the graph view stored in the session, or creates a new one if needed.
protected  IlvImageMapAreaGenerator getImageMapAreaGenerator(javax.servlet.http.HttpServletRequest request, IlvGraphic obj, IlvManagerView view, IlvTransformer t)
          Returns the area generator for the specified graphic object.
 IlvManagerLayer[] getLayers(javax.servlet.http.HttpServletRequest request, IlvManagerView view)
          Returns the list of layers that are allowed to be rendered.
protected  Object getLock(javax.servlet.http.HttpServletRequest request)
          Overrides the default implementation of getLock, instead of using IlvManagerView.getRegion, we use the session.
protected  Comparator<IlvManagerLayer> getManagerLayerComparator(IlvManagerView view, javax.servlet.http.HttpServletRequest request)
          Returns a Comparator implementation that will be used to sort the IlvManagerLayer that are used to generate the image map when requested.
 IlvManagerView getManagerView(javax.servlet.http.HttpServletRequest request)
          The implementation of the getManagerView from the IlvManagerServletSupport class.
protected  IlvManagerView getOverviewManagerView(javax.servlet.http.HttpServletRequest request)
          Returns the manager view to be used when rendering the overview.
protected static String GetViewId(javax.servlet.http.HttpServletRequest request)
          Returns the identifier used to store the view and related objects in session.
 boolean handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          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.
protected  void installImageMapAreaGenerator(IlvManager manager, IlvImageMapAreaGenerator generator)
          Deprecated. Since JViews 8.1 use IlvFacesManagerServletSupport.shouldGenerateImageMap(HttpServletRequest, IlvManagerLayer, IlvManagerView, IlvTransformer)} and/or getImageMapAreaGenerator(HttpServletRequest, IlvGraphic, IlvManagerView, IlvTransformer) to filter the objects that will generate image map areas.
protected  void logHandleRequestException(Exception exception)
          Appropriately logs a record for an exception that has been thrown while handling a client request.
protected  URL resolveFileName(javax.servlet.http.HttpServletRequest request, String file)
          Returns the URL that corresponds to the given file.
protected abstract  void setStyleSheets(javax.servlet.http.HttpServletRequest request, String stylesheets)
          Sets a given list of comma separated style sheets into the underlying JViews TGO component.
protected abstract  boolean shouldGenerateImageMap(javax.servlet.http.HttpServletRequest request, IlvGraphic graphic, IlvManagerView view, IlvTransformer t)
          Returns true if image map information should be generated for the specified IlvGraphic.
 
Methods inherited from class ilog.views.faces.dhtml.servlet.IlvFacesManagerServletSupport
additionalCapabilities, generateImage, getFacesContext, getMenuFactory, getTileManager, installImageMapAreaGenerator, isOverviewRequest, isSessionExpired, prepareManagerView, shouldGenerateImageMap
 
Methods inherited from class ilog.views.servlet.IlvManagerServletSupport
addServerActionListener, beforeDraw, encodeImage, getAdditionalCapabilities, getAntialiasing, getContentLengthEnable, getContext, getDefaultImageMapHREF, getExpirationDate, getInternalLock, getJPEGQuality, getKey, getManagerBBox, 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

graphicObjectComparator

protected Comparator<IlvGraphic> graphicObjectComparator
Comparator used to sort the IlvGraphic instances for image map purposes.

Since:
JViews 8.1
Internal method or field: do not use!

managerLayerComparator

protected Comparator<IlvManagerLayer> managerLayerComparator
Comparator used to sort the IlvManagerLayer instances for image map purposes.

Since:
JViews 8.1
Internal method or field: do not use!
Constructor Detail

IltFacesGraphServletSupport

public IltFacesGraphServletSupport(javax.servlet.ServletContext ctx)
Constructor.

Parameters:
ctx - The servlet context, which is stored internally.
Method Detail

addJSFActionListeners

protected abstract void addJSFActionListeners()

Adds the server actions that invokes the select interactors' value change listener.


getGraphView

protected abstract IlpGraphView getGraphView(javax.servlet.http.HttpServletRequest request)
Returns the graph view stored in the session, or creates a new one if needed.

Parameters:
request - The current servlet request.

setStyleSheets

protected abstract void setStyleSheets(javax.servlet.http.HttpServletRequest request,
                                       String stylesheets)
                                throws javax.servlet.ServletException
Sets a given list of comma separated style sheets into the underlying JViews TGO component. The style sheet is used internally whenever a new image is processed.

Parameters:
request - The request being processed.
stylesheets - The style sheet being set.
Throws:
javax.servlet.ServletException

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 IlvFacesManagerServletSupport
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

createPopupMenuSupport

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

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

createSelectionSupport

protected IlvSelectionSupport createSelectionSupport()
Creates a new instance of selection servlet support.

This implementation returns null. Subclasses must override this method to support selection requests.

Overrides:
createSelectionSupport in class IlvManagerServletSupport
Returns:
A selection servlet support.

getLayers

public IlvManagerLayer[] getLayers(javax.servlet.http.HttpServletRequest request,
                                   IlvManagerView view)
                            throws javax.servlet.ServletException
Returns the list of layers that are allowed to be rendered.

Overrides:
getLayers in class IlvManagerServletSupport
Parameters:
request - The current HTTP request.
view - The manager view (returned by getManagerView).
Throws:
javax.servlet.ServletException

getManagerView

public IlvManagerView getManagerView(javax.servlet.http.HttpServletRequest request)
                              throws javax.servlet.ServletException
The implementation of the getManagerView from the IlvManagerServletSupport class.

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

getLock

protected Object getLock(javax.servlet.http.HttpServletRequest request)
Overrides the default implementation of getLock, instead of using IlvManagerView.getRegion, we use the session.

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

GetViewId

protected static String GetViewId(javax.servlet.http.HttpServletRequest request)
Returns the identifier used to store the view and related objects in session.

Parameters:
request - The current servlet request.
Internal method or field: do not use!

createFacesContext

protected FacesContext createFacesContext(javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response)
Creates a faces context to be used by the select (and select rectangle) actions.

Parameters:
request - The current Http request.
response - The Http response.
Returns:
The newly created faces context.
Internal method or field: do not use!

resolveFileName

protected URL resolveFileName(javax.servlet.http.HttpServletRequest request,
                              String file)
Returns the URL that corresponds to the given file.

Parameters:
request - The current request being processed.
file - The path to a file.
Internal method or field: do not use!

FilterLayers

public static IlvManagerLayer[] FilterLayers(IlvManagerLayer[] source)
Filters out the internal JViews TGO layers from a given list of layers.

Parameters:
source - The raw list of layers to be rendered
Internal method or field: do not use!

getOverviewManagerView

protected IlvManagerView getOverviewManagerView(javax.servlet.http.HttpServletRequest request)
                                         throws javax.servlet.ServletException
Returns the manager view to be used when rendering the overview.

The overview cannot be rendered directly from the main manager view because JTGO has its own zoom policies that may conflict (the "Logical" zoom policy, for example). This method creates a specific manager view for rendering the overview, storing it in the session for reuse.

Parameters:
request - The current servlet request.
Throws:
javax.servlet.ServletException
Internal method or field: do not use!

installImageMapAreaGenerator

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

Installs the given image map generator into all the appropriate objects of the manager view.

Overrides:
installImageMapAreaGenerator in class IlvFacesManagerServletSupport
Parameters:
manager - The manager containing the graphic objects
generator - The image map generator to be installed

logHandleRequestException

protected void logHandleRequestException(Exception exception)
Appropriately logs a record for an exception that has been thrown while handling a client request.

It addresses the special cases by adjusting the log level appropriately.

See implementation for details.

Internal method or field: do not use!

getDynamicLayers

public IlvManagerLayer[] getDynamicLayers(javax.servlet.http.HttpServletRequest request,
                                          IlvManagerView view)
Returns all the IlvManagerLayer instances that are not part of the graph's background.

Overrides:
getDynamicLayers in class IlvManagerServletSupport
Parameters:
request - The current HttpServletRequest.
view - The IlvManagerView returned by getManagerView().
Returns:
An array containing all the dynamic layers or an empty array if no layer is dynamic.
See Also:
IlvManagerServletSupport.getDynamicLayers(javax.servlet.http.HttpServletRequest, ilog.views.IlvManagerView)

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 IlvFacesManagerServletSupport
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 abstract boolean shouldGenerateImageMap(javax.servlet.http.HttpServletRequest request,
                                                  IlvGraphic graphic,
                                                  IlvManagerView view,
                                                  IlvTransformer t)
Returns true if image map information should be generated for the specified IlvGraphic.

Parameters:
request - The current HTTP request.
graphic - The graphic object.
view - The manager view for the specified request.
t - The transformer used to draw the view.
Since:
JViews 8.1
Internal method or field: do not use!

getGraphicObjectComparator

protected Comparator<IlvGraphic> getGraphicObjectComparator(IlvManagerLayer layer,
                                                            IlvManagerView view,
                                                            javax.servlet.http.HttpServletRequest request)
Returns a Comparator implementation that will be used to sort the IlvGraphic instances in the given layer that need to have their image map generated.

When used, the Comparator should yield an ordered collection in descending order with the IlvGraphic instances of higher priority being listed first.

A null value can be returned to indicate that no sorting needs to take place.

Overrides:
getGraphicObjectComparator in class IlvManagerServletSupport
Parameters:
layer - The layer that contains IlvGraphic instances to be potentially sorted.
view - The manager view for the specified request.
request - The current HTTP request.
Returns:
The Comparator that will be used to sort the IlvGraphic instances that need to have their image map generated. Or null if no sorting is needed.
Since:
JViews 8.1
Internal method or field: do not use!

getManagerLayerComparator

protected Comparator<IlvManagerLayer> getManagerLayerComparator(IlvManagerView view,
                                                                javax.servlet.http.HttpServletRequest request)
Returns a Comparator implementation that will be used to sort the IlvManagerLayer that are used to generate the image map when requested.

When used, the Comparator should yield an ordered collection in descending order with the IlvManagerLayer instances of higher priority being listed first.

A null value can be returned to indicate that no sorting needs to take place.

Overrides:
getManagerLayerComparator in class IlvManagerServletSupport
Parameters:
view - The manager view for the specified request.
request - The current HTTP request.
Returns:
The Comparator that will be used to sort the IlvManagerLayer that are used to generate the image map when requested. Or null if no sorting is needed.
Since:
JViews 8.1
Internal method or field: do not use!


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