it.eng.spagobi.geo.action
Class GeoAction

java.lang.Object
  extended by it.eng.spago.dispatching.service.DefaultRequestContext
      extended by it.eng.spago.dispatching.service.DefaultHttpRequestContext
          extended by it.eng.spago.dispatching.action.AbstractHttpAction
              extended by it.eng.spagobi.geo.action.GeoAction
All Implemented Interfaces:
it.eng.spago.dispatching.action.ActionIFace, it.eng.spago.dispatching.service.HttpRequestContextIFace, it.eng.spago.dispatching.service.RequestContextIFace, it.eng.spago.dispatching.service.ServiceIFace, it.eng.spago.init.InitializerIFace, java.io.Serializable

public class GeoAction
extends it.eng.spago.dispatching.action.AbstractHttpAction

Spago Action which executes the map producing request

See Also:
Serialized Form

Constructor Summary
GeoAction()
           
 
Method Summary
private  boolean checkOutputFormat(java.lang.String outputFormat)
          Checks if the output format requested is allowed
static void flushFromInputStreamToOutputStream(java.io.InputStream is, java.io.OutputStream os, boolean closeStreams)
          Given an InputStream as input flushs the content into an OutputStream and then close the input and output stream.
private  java.lang.String getContentType(java.lang.String outFormat)
          Returns the right content type for the output format
private  void sendError(javax.servlet.ServletOutputStream out)
          sends an error message to the client
 void service(it.eng.spago.base.SourceBean serviceRequest, it.eng.spago.base.SourceBean serviceResponse)
          Method called automatically by Spago framework when the action is invoked.
 
Methods inherited from class it.eng.spago.dispatching.action.AbstractHttpAction
getActionName, getConfig, init, setActionName
 
Methods inherited from class it.eng.spago.dispatching.service.DefaultHttpRequestContext
freezeHttpResponse, getHttpRequest, getHttpResponse, getServletConfig, isHttpResponseFreezed, setRequestContext, unfreezeHttpResponse
 
Methods inherited from class it.eng.spago.dispatching.service.DefaultRequestContext
getErrorHandler, getRequestContainer, getResponseContainer, getServiceRequest, getServiceResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.eng.spago.dispatching.service.RequestContextIFace
getErrorHandler, getRequestContainer, getResponseContainer, getServiceRequest, getServiceResponse
 

Constructor Detail

GeoAction

public GeoAction()
Method Detail

service

public void service(it.eng.spago.base.SourceBean serviceRequest,
                    it.eng.spago.base.SourceBean serviceResponse)
             throws java.lang.Exception
Method called automatically by Spago framework when the action is invoked. The method search into the request two parameters The template xml message must have the following structure <MAP name="logical name of the map"> <DATAMART_PROVIDER connection_name=" name of one pool defined into data_access.xml " query=" the query that obtains data " column_id=" the name of a column of the resultset which is related to the id attribute of the svg tags " column_value=" the name of a column of the resultset which contains the value related to the svg element "/> <CONFIGURATION> <!-- x,y: position of the first element of the legend --> <LEGEND x=" " y=" " width=" " height=" " style=" svg style properties "> <TITLE description=" title " style=" svg style properties "/> <!-- ordered by threshold --> <LEVELS> <LEVEL threshold="0" style="svg style properties"> <TEXT description="Less then 1.000" style="svg style properties" /> </LEVEL> <LEVEL threshold="1000" style="svg style properties"> <TEXT description="Da 1.000 a 2.000" style="svg style properties" /> </LEVEL> ...... </LEVELS> </LEGEND> </CONFIGURATION> </MAP> The query attribute can contain some parameters. Each parameter must be specified with the sintax ${parameter_name} During the execution the parameter sintax is substituted with the value ot the same-name parameter send into request. If the request doesn't contain any parameter with name equal to the one of the query the rendering is not performed

Parameters:
serviceRequest - the Spago request SourceBean
serviceResponse - the Spago response SourceBean
Throws:
java.lang.Exception

sendError

private void sendError(javax.servlet.ServletOutputStream out)
sends an error message to the client

Parameters:
out - The servlet output stream

checkOutputFormat

private boolean checkOutputFormat(java.lang.String outputFormat)
Checks if the output format requested is allowed

Parameters:
outputFormat - The code string of the output format
Returns:
true if the output format is allowed, false otherwise

getContentType

private java.lang.String getContentType(java.lang.String outFormat)
Returns the right content type for the output format

Parameters:
outputFormat - The code string of the output format
Returns:
the string code of the content type for the output format

flushFromInputStreamToOutputStream

public static void flushFromInputStreamToOutputStream(java.io.InputStream is,
                                                      java.io.OutputStream os,
                                                      boolean closeStreams)
Given an InputStream as input flushs the content into an OutputStream and then close the input and output stream.

Parameters:
is - The input stream
os - The output stream
closeStreams, - if true close both stream