ilog.views.diagrammer.faces.dhtml.servlet
Class IlvFacesDiagrammerServletSupport

java.lang.Object
  extended by ilog.views.servlet.IlvManagerServletSupport
      extended by ilog.views.sdm.servlet.IlvSDMServletSupport
          extended by ilog.views.diagrammer.servlet.IlvDiagrammerServletSupport
              extended by ilog.views.diagrammer.faces.dhtml.servlet.IlvFacesDiagrammerServletSupport
All Implemented Interfaces:
IlvFacesDiagrammerConstants, IlvDHTMLConstants, IlvDHTMLFrameworkConstants, IlvFacesConstants, IlvFrameworkConstants

public class IlvFacesDiagrammerServletSupport
extends IlvDiagrammerServletSupport
implements IlvFacesDiagrammerConstants, IlvDHTMLFrameworkConstants

The IlvFacesDiagrammerServletSupport class is an extension of the IlvDiagrammerServletSupport that handle requests that are coming from the DHTML faces diagrammer component.

Since:
JViews 6.5

Field Summary
 
Fields inherited from class ilog.views.servlet.IlvManagerServletSupport
ImageMapAreaGeneratorProperty
 
Fields inherited from interface ilog.views.diagrammer.faces.IlvFacesDiagrammerConstants
DASHBOARD_DIAGRAM, DATA_SOURCE, DATA_URL, DIAGRAMMER, EDITABLE, INPUT_XSL, OUTPUT_XSL, PARAM_CSS, PARAM_XML, PROPERTY_ACCESSOR, STYLE_SHEETS
 
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
IlvFacesDiagrammerServletSupport()
          Deprecated. Beginning with JViews 7.5 use IlvFacesDiagrammerServletSupport(ServletContext) instead.
IlvFacesDiagrammerServletSupport(javax.servlet.ServletContext context)
          Creates a new IlvFacesDiagrammerServletSupport 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  void addJSFActionListeners()
          Adds the server actions that are needed by various client-side interactions.
protected  IlvPopupMenuServletSupport createPopupMenuSupport()
          Creates a new instance of popup menu servlet support.
protected  IlvSelectionSupport createSelectionSupport()
          Overrides IlvManagerServletSupport.createSelectionSupport() to return an IlvDiagrammerSelectionSupport selection support.
protected  String findFile(String file)
          Finds a data file on the server given a relative URL.
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, boolean forceCreation)
          Returns an artificial faces context to retrieve value bindings.
protected  IlvImageMapAreaGenerator getImageMapAreaGenerator()
          Returns the current image map area generator.
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.
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.
 IlvSDMView getSDMView(javax.servlet.http.HttpServletRequest request)
          Returns the SDM view associated with this servlet.
 IlvTileManager getTileManager(javax.servlet.http.HttpServletRequest request)
          Returns the tile manager.
protected  Object getValue(javax.servlet.http.HttpServletRequest request, String key)
          This method is used to retrieve any data that is used by the implementation of the servlet. This method has been overridden to use JSF context.
 boolean handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This method is overridden to handle the "project" parameter.
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)
          This method is overridden to set the reference zoom of the view and to add support for IlvJComponentGraphic objects. This method has been overridden to configure the manager view for tiling.
protected  void setDataSource(javax.servlet.http.HttpServletRequest request, String source)
          Sets the data source specified in the request to the diagrammer.
protected  void setValue(javax.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. This method has been overridden to use JSF context.
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.diagrammer.servlet.IlvDiagrammerServletSupport
getDefaultProject, getDiagrammer, initSDMView, setDefaultProject, setProject
 
Methods inherited from class ilog.views.sdm.servlet.IlvSDMServletSupport
getDataURL, getDefaultStyleSheet, getDefaultXmlFile, getLayers, getManagerView, installImageMapAreaGenerator, isMultiSession, setDataURL, setDefaultStyleSheet, setDefaultXmlFile, setMultiSession, setStyleSheet, setXmlFile
 
Methods inherited from class ilog.views.servlet.IlvManagerServletSupport
addServerActionListener, beforeDraw, encodeImage, getAdditionalCapabilities, getAntialiasing, getContentLengthEnable, getContext, getDefaultImageMapHREF, getDynamicLayers, getExpirationDate, getGraphicObjectComparator, getInternalLock, getJPEGQuality, getKey, 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
 

Constructor Detail

IlvFacesDiagrammerServletSupport

public IlvFacesDiagrammerServletSupport()
Deprecated. Beginning with JViews 7.5 use IlvFacesDiagrammerServletSupport(ServletContext) instead.

This constructor is deprecated use IlvFacesDiagrammerServletSupport(ServletContext) instead.

Since:
JViews 7.5

IlvFacesDiagrammerServletSupport

public IlvFacesDiagrammerServletSupport(javax.servlet.ServletContext context)
Creates a new IlvFacesDiagrammerServletSupport 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.

createSelectionSupport

protected IlvSelectionSupport createSelectionSupport()
Overrides IlvManagerServletSupport.createSelectionSupport() to return an IlvDiagrammerSelectionSupport selection support.

During the creation of this support, listeners to handle selection and move are installed.

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

getFacesContext

protected FacesContext getFacesContext(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response,
                                       boolean forceCreation)
Returns an artificial faces context to retrieve value bindings.

Parameters:
request - The HTTP request.
response - The HTTP response.
forceCreation - Set to true to force the creation of faces context even when FacesContext.getCurrentInstance() does not return null.
Returns:
A faces context instance or null.
Since:
JViews 7.5

addJSFActionListeners

protected void addJSFActionListeners()
Adds the server actions that are needed by various client-side interactions.

This method registers an instance of the following listeners:

Since:
JViews 7.5

findFile

protected String findFile(String file)
Finds a data file on the server given a relative URL.

Overrides:
findFile in class IlvSDMServletSupport
Parameters:
file - The relative URL of the file to find on the server.
Returns:
The absolute URL of the file, or null if the file could not be found.
Since:
JViews 6.5

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.

getValue

protected Object getValue(javax.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:

If you want to implement another strategy to allocate views to sessions, you need to override this method and the IlvSDMServletSupport.setValue(javax.servlet.http.HttpServletRequest, java.lang.String, java.lang.Object) method. This method has been overridden to use JSF context.

Overrides:
getValue in class IlvSDMServletSupport
Parameters:
request - The current HTTP request.
key - The key.
Since:
JViews 8.0

setValue

protected void setValue(javax.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:

If you want to implement another strategy to allocate views to sessions, you need to override this method and the IlvSDMServletSupport.getValue(javax.servlet.http.HttpServletRequest, java.lang.String) method. This method has been overridden to use JSF context.

Overrides:
setValue in class IlvSDMServletSupport
Parameters:
request - The current HTTP request.
key - The key.
value - The value.
Since:
JViews 8.0

getSDMView

public IlvSDMView getSDMView(javax.servlet.http.HttpServletRequest request)
Returns the SDM view associated with this servlet.

Overrides:
getSDMView in class IlvSDMServletSupport
Parameters:
request - The request being processed.

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
This method is overridden to handle the "project" parameter.

Overrides:
handleRequest in class IlvDiagrammerServletSupport
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

setDataSource

protected void setDataSource(javax.servlet.http.HttpServletRequest request,
                             String source)
Sets the data source specified in the request to the diagrammer.

Parameters:
request - The http request.
source - The data source request parameter value.

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.

getImageMapAreaGenerator

protected IlvImageMapAreaGenerator getImageMapAreaGenerator()
Returns the current image map area generator. This method is useful to be overridden if another image map generator is used.

Overrides:
getImageMapAreaGenerator in class IlvSDMServletSupport

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.

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

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"

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

prepareManagerView

protected void prepareManagerView(javax.servlet.http.HttpServletRequest request,
                                  IlvManagerView view)
                           throws javax.servlet.ServletException
This method is overridden to set the reference zoom of the view and to add support for IlvJComponentGraphic objects. This method has been overridden to configure the manager view for tiling.

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

getLock

protected Object getLock(javax.servlet.http.HttpServletRequest request)
Description copied from class: IlvSDMServletSupport
Returns a locking object that is used to lock the contents of the manager. The default implementation of this method depends on whether the servlet is in monosession or in multisession mode:

Overrides:
getLock in class IlvSDMServletSupport
Parameters:
request - The current HTTP request.
See Also:
IlvSDMServletSupport.setValue(HttpServletRequest, String, Object), IlvSDMServletSupport.getValue(HttpServletRequest, String)


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