com.yworks.yfiles.server.svg
Class SVGServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.yworks.yfiles.server.tiles.servlet.BaseServlet
              extended bycom.yworks.yfiles.server.svg.SVGServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class SVGServlet
extends BaseServlet

This Servlet serves a graph as SVG.

See Also:
Serialized Form

Field Summary
static int DEFAULT_SVG_BORDER
           
 
Fields inherited from class com.yworks.yfiles.server.tiles.servlet.BaseServlet
EDGE_DESCRIPTION_KEY, EDGE_URL_KEY, NODE_DESCRIPTION_KEY, NODE_URL_KEY
 
Constructor Summary
SVGServlet()
           
 
Method Summary
protected  void configureRewriteRenderer(SVGGraph2DRewriteRenderer renderer, SVGRenderContext ctx)
          Registers the SVGIdRewriteGraphVisitor if there is a prefix.
protected  yext.svg.io.SVGIOHandler createSVGIOHandler()
          Creates a new SVGIOHandler.
protected  void handleGetRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Returns the requested graph in svg format.
protected  void handlePostRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Redirects to SVGServlet.handleGetRequest.
 
Methods inherited from class com.yworks.yfiles.server.tiles.servlet.BaseServlet
addViewConfigurator, cachedGraphs, cacheGraph, doGet, doPost, getEdgeDescription, getEdgeURL, getForId, getGraph, getGraphBounds, getGraphContentBounds, getId, getId, getId, getId, getNodeDescription, getNodeURL, getReadWriteLock, getSessionMonitor, getViewConfigurators, getWriter, hasDescriptions, hasURLs, init, initialize, isUseJSONPrefixing, lookupId, lookupId, lookupId, lookupId, newGraph, readLock, registerLicense, removeViewConfigurator, setEdgeDescription, setEdgeURL, setNodeDescription, setNodeURL, uncacheGraph, unlockRead, unlockWrite, updateEdgePaths, validateIds, writeContentBounds, writeLock, writeWorldBounds
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, 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
 

Field Detail

DEFAULT_SVG_BORDER

public static final int DEFAULT_SVG_BORDER
See Also:
Constant Field Values
Constructor Detail

SVGServlet

public SVGServlet()
Method Detail

handleGetRequest

protected void handleGetRequest(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
                         throws javax.servlet.ServletException,
                                IOException
Returns the requested graph in svg format. Supports the following request parameters:
path: String (required)
The name of the cached graph.
border: int (optional)
The border width of the graph.
prefix: String (optional)
The prefix of generated SVG-IDs.
If the requested graph could not be found, the response will be a 404 error.

Overrides:
handleGetRequest in class BaseServlet
Parameters:
request - The request
response - The response
Throws:
javax.servlet.ServletException
IOException

configureRewriteRenderer

protected void configureRewriteRenderer(SVGGraph2DRewriteRenderer renderer,
                                        SVGRenderContext ctx)
Registers the SVGIdRewriteGraphVisitor if there is a prefix. Can be overriden to further customize the generated SVG.

Parameters:
renderer - The renderer
ctx - The context

createSVGIOHandler

protected yext.svg.io.SVGIOHandler createSVGIOHandler()
Creates a new SVGIOHandler.

Returns:
The new SVGIOHandler

handlePostRequest

protected void handlePostRequest(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
                          throws javax.servlet.ServletException,
                                 IOException
Redirects to SVGServlet.handleGetRequest.

Overrides:
handlePostRequest in class BaseServlet
Parameters:
request - The request
response - The response
Throws:
javax.servlet.ServletException
IOException


Copyright © 2006-2013 yWorks GmbH. All rights reserved