com.yworks.yfiles.server.tiles.servlet
Class QueryServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.yworks.yfiles.server.tiles.servlet.BaseServlet
com.yworks.yfiles.server.tiles.servlet.QueryServlet
- All Implemented Interfaces:
- Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
- public class QueryServlet
- extends BaseServlet
This servlet serves information for interacting with a graph. Information on the bounds of the graph elements can be
requested, which enables client side hit tests. Information on the nesting structure of a graph with group and
folder nodes can be requested, which is used by the client side hierarchy manager.
Note that the information provided for "getViewInfo" requests is the same as the information for "getElementBounds"
in the TileServlet. Both use the GraphInfoProvider
.
- See Also:
- Serialized Form
Method Summary |
protected void |
handleGetRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
answers "GET" requests of kind "getWorldBounds", "getViewInfo" and "getHierarchyInfo". |
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, handlePostRequest, 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 |
QueryServlet
public QueryServlet()
handleGetRequest
protected void handleGetRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
- answers "GET" requests of kind "getWorldBounds", "getViewInfo" and "getHierarchyInfo".
"getWorldBounds" returns the world bounds as an enclosing rectangle for a given graph in JSON format.
"getViewInfo" returns hit test information for a given graph in JSON format.
"getHierarchyInfo" returns hierarchy information for a given graph in JSON format.
All kinds of requests have a mandatory parameter "path" describing the graph for the request.
"getWorldBounds" and "getHierarchyInfo" have no further parameters.
"getViewInfo" uses the mandatory parameters "x", "y", "width", "height" and "types".
- "x" and "y" are doubles specifying the upper left corner of the rectangular area for which to obtain
element bounds in world units
- "width" and "height" are doubles specifying the width and height of the rectangular area for which to obtain
element bounds in world units
- "types" is an integer specifying the kinds of elements for which to get information. Nodes are specified
by 1, edges by 2, node labels by 4 and edge labels by 8. Combinations are specified by ORing these values
together.
- Overrides:
handleGetRequest
in class BaseServlet
- Parameters:
request
- the current requestresponse
- the answer to the client
- Throws:
javax.servlet.ServletException
IOException
Copyright © 2006-2013 yWorks GmbH. All rights reserved