|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet org.deegree.enterprise.servlet.ChartServlet
public class ChartServlet
A Servlet that gets an http GET request, with the de.latlon.charts parameters and it generates
and returns a BufferedImage based on these parameters. The request should look as follows:
http://www.someserver.com/servletname?
chart=ChartType& ( Mandatory )
title=string&
legend=boolean& ( default = true )
width=int& ( Mandatory )
height=int& ( Mandatory )
xAxis=string&
yAxis=string&
tooltips=boolean& ( default = false )
lblType Determines in PieChart what the legend and the tool tip to be. You can
either show the data key, value or both. Possible values for this parameter are:
Key, Value and KeyValue ( default = Key )
orientation=direction& ( default = vertical )
format=image_format& ( Mandatory )
value=value ( Mandatory )
The keys are the following
I) Chart Type: Available chart Types are:
1- Pie
2- Pie3D
3- Bar
4- Bar3D
5- Line
6- Line3D
7- XYBar
8- XYLine
II) title: Title of the generated image
II) legend: true/false to show/hide the legend of the categories/rows
III) width: Width of the generated image
IV) height: Height of the generated image
V) xAxis Title of the
X Axis Title of xAxis
VI) yAxis Title of the Y Axis
VII) tooltips Show/hide tool tips
VIII)orientation vertical/horizontal. the orientation of the chart
IX) format format of the output image, ex: image/png and image/jpeg
X) type There is actually no parameter called type.
It only indicates the more parameters that carry the actual values for the chart.
They can have different three different formats. but only one format type shall be used
per request. The values can be given as normal key value pairs as follows:
Format 1: &CDU=34&SPD=36&Gruene=11 - In this format the key has only one value
- This type can only be used together with the chart type: Pie, Pie3D, Bar, Line and Line3D
Format 2: &CDU=23,25,21,26&SPD=42,23,33,36
- In this format multiple values per keys can be given - Either comma or white spaces can be
used as separators(white spaces are of course encoded in case of a Http Get request)
- This type can only be used together with the chart type: Bar, Line and ine3D
Format 3: &CDU=1970,23;1974,44;1978,43&SPD=1970,23;1974,44;1978,43
- In this format the key has multiple value, in which each value is a tuple that contains in
turn two tokens representing x and y of a cartesian point. This format is
used to create cartesian de.latlon.charts
- comma and white spacescan be used as separators between tokens, i.e. between x and y,
while semi colon shall be used as a separator between tupels.
- This type can only be used together with XYLine (and later with XYBar)
Constructor Summary | |
---|---|
ChartServlet()
|
Method Summary | |
---|---|
protected java.awt.image.BufferedImage |
buildChart(java.lang.String chart,
java.lang.String title,
java.lang.String legend,
java.lang.String width,
java.lang.String height,
java.lang.String xAxis,
java.lang.String yAxis,
java.lang.String tooltips,
java.lang.String orientation,
java.lang.String lblType,
java.lang.String imagetype,
java.util.Map<java.lang.String,java.lang.String> params,
ChartConfig chartConfigs)
Takes in all the needed parameters and a queued map containing the values of the chart and returns a BufferedImage with the chart |
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected void |
goToErrorPage(javax.servlet.http.HttpServletResponse response)
Creates a buffered image that contains an error label. |
void |
init()
|
protected QueuedMap<java.lang.String,java.lang.String> |
initAndValidateParams(javax.servlet.http.HttpServletRequest request)
Init and validate params does what its name say. |
protected QueuedMap<java.lang.String,java.lang.String> |
InitNValidateParams(javax.servlet.http.HttpServletRequest request)
Deprecated. due to a typo this method is deprecated. Use initAndValidateParams(HttpServletRequest)
instead. |
protected void |
performAction(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected void |
PerformAction(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Deprecated. due to a typo this method is deprecated. Use performAction(HttpServletRequest, HttpServletResponse) instead. |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChartServlet()
Method Detail |
---|
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doGet
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException
@Deprecated protected void PerformAction(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
performAction(HttpServletRequest, HttpServletResponse)
instead.
request
- response
- protected void performAction(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
request
- response
- @Deprecated protected QueuedMap<java.lang.String,java.lang.String> InitNValidateParams(javax.servlet.http.HttpServletRequest request) throws IncorrectFormatException
initAndValidateParams(HttpServletRequest)
instead.
request
-
IncorrectFormatException
protected QueuedMap<java.lang.String,java.lang.String> initAndValidateParams(javax.servlet.http.HttpServletRequest request) throws IncorrectFormatException
request
-
IncorrectFormatException
protected void goToErrorPage(javax.servlet.http.HttpServletResponse response)
response
- protected java.awt.image.BufferedImage buildChart(java.lang.String chart, java.lang.String title, java.lang.String legend, java.lang.String width, java.lang.String height, java.lang.String xAxis, java.lang.String yAxis, java.lang.String tooltips, java.lang.String orientation, java.lang.String lblType, java.lang.String imagetype, java.util.Map<java.lang.String,java.lang.String> params, ChartConfig chartConfigs) throws IncorrectFormatException
chart
- title
- legend
- width
- height
- xAxis
- yAxis
- tooltips
- orientation
- lblType
- imagetype
- params
- chartConfigs
- to configure the output chart, or null to use the default ChartConfig
IncorrectFormatException
|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org