public class IlvFacesChartServletSupport extends IlvChartServletSupport implements IlvChartConstants, IlvFacesConstants
IlvChart
servlet that implements useful predefined actions
and methods.ACTION_PARAM, AREA_COMPONENT, BG_COLOR_PARAM, CAP_FORMAT_PARAM, CAPABILITIES_REQUEST, CHART_COMPONENT, COMPONENT_PARAM, HITMAP_REQUEST, HTML_CAP_FORMAT, IMAGE_FORMAT_PARAM, IMAGE_REQUEST, IMAGEMAP_NAME, IMAGEMAP_REQUEST, JPEG_IMAGE_FORMAT, JSON_CAP_FORMAT, LEGEND_COMPONENT, OCTET_CAP_FORMAT, OVERVIEW_COMPONENT, PNG_IMAGE_FORMAT, REQUEST_PARAM, VALID_CAP_FORMATS, VALID_COMPONENTS, VERBOSE_PARAM, X_MAX_PARAM, X_MIN_PARAM, Y_MAX_PARAM, Y_MIN_PARAM
AUTO_REFRESH, CHART, DATA_SOURCE, DATA_SOURCE_ID, DATABASE_DRIVER, DATABASE_PASSWORD, DATABASE_QUERY, DATABASE_RESULT_SET, DATABASE_URL, DATABASE_USER, FILENAME, INTERACTOR, INTERACTOR_ID, ITEM_PICKING, KEEP_VISIBLE_WINDOW, LABEL_COLUMN_MAPPING, LAYOUT, LEGEND_LAYOUT, MESSAGEBOX, NEAREST_ITEM_PICKING, NEAREST_POINT_PICKING, OVERVIEW_ACTION_NAME, PAN_ACTION_NAME, PICKING_MODE, REFRESH_DATA, SESSION_ID_PREFIX, STATE_URL, STYLE_SHEET, STYLE_SHEETS, TYPE, UPDATE_INTERVAL, X_COLUMN_MAPPING, X_PAN_ALLOWED, X_ZOOM_ALLOWED, X_ZOOM_FACTOR, Y_COLUMN_MAPPING, Y_PAN_ALLOWED, Y_ZOOM_ALLOWED, Y_ZOOM_FACTOR, ZOOM_ACTION_NAME
AFTER_HANDLER, BASETEXTDIRECTION, BEFORE_HANDLER, BUTTON_GROUP_ID, BUTTON_TYPE, CHARTS_BUNDLE, CHARTS_MESSAGE_BUNDLE, CORE_BUNDLE, CORE_MESSAGE_BUNDLE, CURSOR, DATA, DECODED_PROPERTY, DEFAULT_LINE_COLOR, DELETION_ALLOWED, DIAGRAMMER_BUNDLE, DIAGRAMMER_MESSAGE_BUNDLE, ENABLED, EVENT_TYPE, FILL_ON, FORCE_UPDATE_PROPERTIES, FRAMEWORK_BUNDLE, FRAMEWORK_MESSAGE_BUNDLE, GANTT_BUNDLE, GANTT_MESSAGE_BUNDLE, HEIGHT, IMAGE, IMAGE_MODE, INFO_PROVIDER_MB, INT_NOT_DEFINED, INTERACTORS, INTERCEPT_INTERACTOR, ITEM_DISABLED_STYLE_CLASS, ITEM_HIGHLIGHTED_STYLE_CLASS, ITEM_STYLE_CLASS, LINE_COLOR, LINE_WIDTH, MAPS_BUNDLE, MAPS_MESSAGE_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, PROGRESSIVE_ZOOM, PROJECT, RENDER, RESOURCES_PATH, RESOURCES_PATH_PREFIX, ROLLOVER_IMAGE, SCROLL_BAR, SELECTED, SELECTED_IMAGE, SERVICE_FORWARD, SERVICE_FORWARD_INT, SERVLET, SERVLET_CLASS, SERVLET_URL, STYLE, STYLE_CLASS, TGO_BUNDLE, TGO_MESSAGE_BUNDLE, TITLE, TOGGLE, VALUE, VIEW, VIEW_ID, WIDTH
Constructor and Description |
---|
IlvFacesChartServletSupport()
Constructs an
IlvFacesChartServletSupport . |
Modifier and Type | Method and Description |
---|---|
void |
addOverviewAction()
Add a default server side overview action.
|
void |
addPanAction()
Add a default server side pan action.
|
void |
addSelectAction()
Adds a default server side selection action.
|
void |
addZoomAction()
Add a default server side zoom action.
|
protected IlvChart |
createChart()
Creates the chart instance that will generate the view to display.
|
protected IlvLegend |
createLegend()
Creates the chart legend instance.
|
protected IlvPopupMenuServletSupport |
createPopupMenuSupport()
Creates a new instance of pop-up menu servlet support.
|
protected BufferedImage |
generateImageCT(IlvServletRequestParameters params,
IlvChart chart,
String compName,
int width,
int height)
Generates the requested image.
|
protected IlvChart |
getChart(IlvServletRequestParameters params)
Returns the chart instance that will generate the view to display.
|
protected jakarta.faces.context.FacesContext |
getFacesContext(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response)
Returns an artificial faces context to retrieve value bindings, or
null if no faces context is attached to
this thread. |
protected jakarta.faces.context.FacesContext |
getFacesContext(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response,
boolean forceCreation)
Returns an artificial faces context to retrieve value bindings.
|
protected IlvIMapDefinition |
getIMapDefinition(IlvServletRequestParameters params,
IlvChart chart)
Returns the
IlvIMapDefinition used by the
IlvImageMapBuilder to generate the image map tags. |
protected IlvLegend |
getLegend(IlvServletRequestParameters params)
Returns the chart legend instance to display.
|
protected IlvMenuFactory |
getMenuFactory(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response)
Retrieves or creates the menu factory used in this pop-up menu request.
|
protected IlvChart |
getOverview(jakarta.servlet.http.HttpServletRequest req)
Returns the chart overview instance from the session.
|
protected IlvChart |
getOverview(jakarta.servlet.http.HttpSession session,
String id)
Returns the chart overview instance from the session.
|
protected IlvChart |
getOverviewChart(IlvServletRequestParameters params)
Returns the chart overview instance to display.
|
boolean |
handleRequest(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response)
This method overrides the
handleRequest method of the
IlvChartServletSupport . |
protected boolean |
isSessionExpired(jakarta.servlet.http.HttpServletRequest request)
Returns
true if the session has expired between two requests. |
void |
setDataSource(jakarta.servlet.http.HttpServletRequest request,
String source)
Sets the specified data source to the chart.
|
void |
setLegendLayout(jakarta.servlet.http.HttpServletRequest request,
String layout)
Sets the legend layout of the legend view.
|
void |
setProject(jakarta.servlet.http.HttpServletRequest request,
String project)
Sets the project passed as parameter.
|
void |
setStyleSheet(jakarta.servlet.http.HttpServletRequest request,
String styleSheet)
Apply a stylesheet
|
void |
setStyleSheets(jakarta.servlet.http.HttpServletRequest request,
String styleSheets)
Apply the stylesheets
|
additionalBinaryCapabilities, additionalOverviewBinaryCapabilities, additionalOverviewTextCapabilities, additionalTextCapabilities, addServerAction, createImageMapBuilder, executeAction, generateImageAWT, generateMapAreaTags, getAdditionalCapabilities, getAdditionalOverviewCapabilities, getConfigParameters, getContext, getHitmapSupport, getImageEncoder, getPopupMenuSupport, getRequestedVisibleWindow, getServlet, isPopupEnabled, isVerbose, prepareChart, prepareOverviewChart, prepareVisibleWindow, removeServerAction, setConfigParameters, setImageEncoder, setPopupEnabled, setServlet, toChartArea, toChartArea, toRefComp, toRefComp
doGetScriptMessage, getParameterValidationListener, getScriptMessageSupport, setParameterValidationListener
public IlvFacesChartServletSupport()
IlvFacesChartServletSupport
. This constructor
registers an IlvZoomAction
, an IlvPanAction
and an IlvOverviewAction
.protected jakarta.faces.context.FacesContext getFacesContext(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
null
if no faces context is attached to
this thread.request
- The HTTP request.response
- The HTTP response.null
.protected jakarta.faces.context.FacesContext getFacesContext(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, boolean forceCreation)
request
- The HTTP request.response
- The HTTP response.forceCreation
- Force creation of faces context even if FacesContext.getCurrentInstance()
does not return nulll
.null
.protected IlvIMapDefinition getIMapDefinition(IlvServletRequestParameters params, IlvChart chart)
IlvIMapDefinition
used by the
IlvImageMapBuilder
to generate the image map tags.
The default implementation returns null
, meaning an empty
image map.protected IlvPopupMenuServletSupport createPopupMenuSupport()
createPopupMenuSupport
in class IlvChartServletSupport
public void addSelectAction()
IlvFacesChartServletSupport
at construction time. This method calls addServerAction(IlvFacesChartSelectAction.ACTION_NAME, new IlvFacesChartSelectAction());
.public void addZoomAction()
IlvFacesChartServletSupport
at construction time. This
method calls
addServerAction(ZOOM_ACTION_NAME, new IlvZoomAction())
public void addPanAction()
IlvFacesChartServletSupport
at construction time. This
method calls
addServerAction(PAN_ACTION_NAME, new IlvPanAction())
public void addOverviewAction()
IlvFacesChartServletSupport
at construction time. This
method calls
addServerAction(OVERVIEW_ACTION_NAME, new IlvOverviewAction())
protected IlvMenuFactory getMenuFactory(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException
request
- The http request.response
- The http response.jakarta.servlet.ServletException
public boolean handleRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException
handleRequest
method of the
IlvChartServletSupport
.handleRequest
in class IlvChartServletSupport
request
- The current HTTP request.response
- The HTTP response.true
if a recognized request was handled successfully
or false
if the request type was not recognized.
The recognized request types are IlvChartServletSupport.IMAGE_REQUEST
,
IlvChartServletSupport.IMAGEMAP_REQUEST
and IlvChartServletSupport.CAPABILITIES_REQUEST
. An exception
is thrown if a recognized request is not handled successfully.IOException
- If an input or output error is detected when the
servlet handles the request.jakarta.servlet.ServletException
- If the request could not be handled.protected IlvChart createChart()
protected IlvChart getChart(IlvServletRequestParameters params) throws jakarta.servlet.ServletException
getChart
in class IlvChartServletSupport
params
- The request parameters.jakarta.servlet.ServletException
protected IlvChart getOverviewChart(IlvServletRequestParameters params) throws jakarta.servlet.ServletException
getOverviewChart
in class IlvChartServletSupport
params
- The request parameters.jakarta.servlet.ServletException
protected IlvLegend getLegend(IlvServletRequestParameters params) throws jakarta.servlet.ServletException
getLegend
in class IlvChartServletSupport
params
- The request parameters.jakarta.servlet.ServletException
protected IlvLegend createLegend()
protected IlvChart getOverview(jakarta.servlet.http.HttpServletRequest req)
req
- The http servlet request.protected IlvChart getOverview(jakarta.servlet.http.HttpSession session, String id)
session
- The HTTP session.id
- The ID of the chart overview to retrieve.public void setStyleSheets(jakarta.servlet.http.HttpServletRequest request, String styleSheets)
request
- The HTTP request.styleSheets
- The stylesheets to apply.public void setStyleSheet(jakarta.servlet.http.HttpServletRequest request, String styleSheet)
request
- The HTTP request.styleSheet
- The stylesheet to apply.public void setDataSource(jakarta.servlet.http.HttpServletRequest request, String source)
request
- The HTTP requestsource
- The data source ID.public void setProject(jakarta.servlet.http.HttpServletRequest request, String project)
request
- The http request.project
- The project URL.public void setLegendLayout(jakarta.servlet.http.HttpServletRequest request, String layout)
request
- The HTTP request.layout
- The desired layout. Valid values are "vertical"
or "horizontal"
protected boolean isSessionExpired(jakarta.servlet.http.HttpServletRequest request)
true
if the session has expired between two requests.request
- The HTTP request.protected BufferedImage generateImageCT(IlvServletRequestParameters params, IlvChart chart, String compName, int width, int height) throws jakarta.servlet.ServletException
generateImageCT
in class IlvChartServletSupport
params
- The parameters parsed from the request.chart
- The chart to be displayed.compName
- The name of the component of the chart that shall be displayed.width
- The requested width of the image.height
- The requested height of the image.jakarta.servlet.ServletException
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.