Java Doc for GetMapKvpReader.java in  » GIS » GeoServer » org » vfny » geoserver » wms » requests » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoServer » org.vfny.geoserver.wms.requests 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.vfny.geoserver.wms.requests.WmsKvpRequestReader
   org.vfny.geoserver.wms.requests.GetMapKvpReader

All known Subclasses:   org.vfny.geoserver.wms.requests.GetKMLReflectKvpReader,
GetMapKvpReader
public class GetMapKvpReader extends WmsKvpRequestReader (Code)
Builds a GetMapRequest object given by a set of CGI parameters supplied in the constructor.

Mandatory parameters:

  • LAYERS layer names, as exposed by the capabilities document, to compose a map with, in the order they may appear, being the first layer the one at the bottom of the layer stack and the last one the one at the top.
  • STYLES list of named styles known by this server and applicable to the requested layers. It can be empty or contain exactly as many style names as layers was requested, in which case empty strings could be used to denote that the default layer style should be used. (exaple: LAYERS=buildings,roads,railroads&STYLES=,centerline,. This example says create a map with roads layer using its default style, roads with "centerline" style, and railroads with its default style.
  • BBOX Area of interest for which to contruct the map image, in the Coordinate Reference System given by the SRS parameter.
  • FORMAT MIME type of the resulting map, must be one of the advertised in the capabilities document.
  • WIDTH desired map witdth in output units (pixels). UNITS support should be added to the spec, and UNITS and DPI parameters added.
  • HEIGHT desired map height in output units (pixels). UNITS support should be added to the spec, and UNITS and DPI parameters added.

Optional parameters:

  • SRS
  • TRANSPARENT boolean indicatin wether to create a map with transparent background or not (if transparency is supported by the requested output format).
  • EXCEPTIONS MIME type of the exception report.
  • BGCOLOR map background color, in 0xRRGGBB format.
  • SLD client supplies a URL for a remote SLD document through this parameter. This parameter takes precedence over STYLES. If present, replaces the LAYERS and STYLES parameters, since they're defined in the remote document itself. The document send by this way will be used in "literal" or "library" mode, see explanation bellow.
  • SLD_BODY client spplies the SLD document itself through this parameter, properly encoded for an HTTP query string. This parameter takes precendence over STYLES and SLD. If present, replaces the LAYERS and STYLES parameters, since they're defined in the inline document itself. The document send by this way will be used in "literal" or "library" mode, see explanation bellow.

As defined by the Styled Layer Descriptor specification, version 1.0.0, the SLD document supplied by the SLD or SLD_BODY parameter can be used in "literal" or "library" mode, depending on whether the LAYERS= parameter is present.

Here is the explanation from the spec, section 6.4, page 10: "the SLD can also be used in one of two different modes depending on whether the LAYERS parameter is present in the request. If it is not present, then all layers identified in the SLD document are rendered with all defined styles, which is equivalent to the XML-POST method of usage. If the LAYERS parameter is present, then only the layers identified by that parameter are rendered and the SLD is used as a style library . "


author:
   Gabriel Roldan, Axios Engineering
author:
   Simone Giannecchini, GeoSolutions
version:
   $Id: GetMapKvpReader.java 7749 2007-11-13 20:52:54Z jdeolive $



Constructor Summary
public  GetMapKvpReader(Map kvpPairs, WMService service)
     Creates a new GetMapKvpReader object.

Method Summary
public static  voidaddStyles(GetMapRequest request, MapLayerInfo currLayer, StyledLayer layer, List layers, List styles)
     the correct thing to do its grab the style from styledLayers[i] inside the styledLayers[i] will either be : a) nothing - in which case grab the layer's default style b) a set of: i) NameStyle -- grab it from the pre-loaded styles ii)UserStyle -- grab it from the sld the user uploaded NOTE: we're going to get a set of layer->style pairs for (b).
public  voidfilterBaseMap(Map layers, Map styles)
     Filters the layers and styles if the user specified "layers=basemap".
public static  CoverageInfofindCoverageLayer(GetMapRequest request, String layerName)
    
public static  FeatureTypeInfofindFeatureLayer(GetMapRequest request, String layerName)
    
public static  StylefindStyle(GetMapRequest request, String currStyleName)
    
static  StringfixURL(String url)
     URLEncoder.encode does not respect the RFC 2396, so we rolled our own little encoder.
public  RequestgetRequest(HttpServletRequest httpRequest)
     Produces a GetMapRequest instance by parsing the GetMap mandatory, optional and custom parameters.
public static  voidinitializeInlineFeatureLayer(GetMapRequest getMapRequest, UserLayer ul, MapLayerInfo currLayer)
     Method to initialize a user layer which contains inline features.
public  booleanisStylesRquired()
    
protected  EnvelopeparseBbox(String bboxParam)
    
protected  voidparseFilterParam(GetMapRequest request)
    
public static  ListparseLayerGroup(String layerGroup)
     Parses a list of layers in a layer grouping.
Parameters:
  layerGroup - The layer group.
protected  voidparseLayersAndStyles(GetMapRequest request)
    
protected  MapLayerInfo[]parseLayersParam(GetMapRequest request)
     Parses the requested layers given by the LAYERS request parameter and looks up their corresponding FeatureTypeInfo objects in the server.
public  voidparseMandatoryParameters(GetMapRequest request, boolean parseStylesLayers)
    
public  voidparseOptionalParameters(GetMapRequest request)
    
protected  voidparseSldBodyParam(GetMapRequest request)
     Takes the SLD_BODY parameter value and parses it to a geotools' StyledLayerDescriptor, then takes the layers and styles to use in the map composition from there.
protected  voidparseSldParam(GetMapRequest request)
    
protected  ListparseStylesParam(GetMapRequest request, MapLayerInfo[] layers)
     Parses the list of style names requested for each requested layer and looks up the actual Style objects, which are returned in an ordered list.

A client _may_ request teh default Style using a null value (as in "STYLES=").

public  voidsetStylesRequired(boolean parseStyles)
    


Constructor Detail
GetMapKvpReader
public GetMapKvpReader(Map kvpPairs, WMService service)(Code)
Creates a new GetMapKvpReader object.
Parameters:
  kvpPairs - Key Values pairs of the request
Parameters:
  service - The service handling the request




Method Detail
addStyles
public static void addStyles(GetMapRequest request, MapLayerInfo currLayer, StyledLayer layer, List layers, List styles) throws WmsException(Code)
the correct thing to do its grab the style from styledLayers[i] inside the styledLayers[i] will either be : a) nothing - in which case grab the layer's default style b) a set of: i) NameStyle -- grab it from the pre-loaded styles ii)UserStyle -- grab it from the sld the user uploaded NOTE: we're going to get a set of layer->style pairs for (b). these are added to layers,styles NOTE: we also handle some featuretypeconstraints
Parameters:
  request -
Parameters:
  currLayer -
Parameters:
  layer -
Parameters:
  layers -
Parameters:
  styles -



filterBaseMap
public void filterBaseMap(Map layers, Map styles)(Code)
Filters the layers and styles if the user specified "layers=basemap".
Parameters:
  layers -
Parameters:
  styles -



findCoverageLayer
public static CoverageInfo findCoverageLayer(GetMapRequest request, String layerName) throws WmsException(Code)



findFeatureLayer
public static FeatureTypeInfo findFeatureLayer(GetMapRequest request, String layerName) throws WmsException(Code)
DOCUMENT ME!
Parameters:
  request -
Parameters:
  layerName -
throws:
  WmsException - DOCUMENT ME!



findStyle
public static Style findStyle(GetMapRequest request, String currStyleName)(Code)
DOCUMENT ME!
Parameters:
  request -
Parameters:
  currStyleName - the configured style named currStyleName ornull if such a style does not exists on thisserver.



fixURL
static String fixURL(String url)(Code)
URLEncoder.encode does not respect the RFC 2396, so we rolled our own little encoder. It's not complete, but should work in most cases
Parameters:
  url -



getRequest
public Request getRequest(HttpServletRequest httpRequest) throws ServiceException(Code)
Produces a GetMapRequest instance by parsing the GetMap mandatory, optional and custom parameters.
Parameters:
  httpRequest - the servlet request who's application object holds the serverconfiguration a GetMapRequest completely setted up upon theparameters passed to this reader
throws:
  ServiceException - DOCUMENT ME!



initializeInlineFeatureLayer
public static void initializeInlineFeatureLayer(GetMapRequest getMapRequest, UserLayer ul, MapLayerInfo currLayer) throws Exception(Code)
Method to initialize a user layer which contains inline features.
Parameters:
  request - The request
Parameters:
  mapLayer - The map layer.
throws:
  Exception -



isStylesRquired
public boolean isStylesRquired()(Code)
DOCUMENT ME! DOCUMENT ME!



parseBbox
protected Envelope parseBbox(String bboxParam) throws WmsException(Code)



parseFilterParam
protected void parseFilterParam(GetMapRequest request) throws WmsException(Code)
Gets a sequence of url encoded filters and parses them into Filter objects that will be set into the request object
Parameters:
  request -
throws:
  WmsException -



parseLayerGroup
public static List parseLayerGroup(String layerGroup)(Code)
Parses a list of layers in a layer grouping.
Parameters:
  layerGroup - The layer group. List of String.



parseLayersAndStyles
protected void parseLayersAndStyles(GetMapRequest request) throws WmsException(Code)
DOCUMENT ME!
Parameters:
  request - DOCUMENT ME!
throws:
  WmsException - DOCUMENT ME!



parseLayersParam
protected MapLayerInfo[] parseLayersParam(GetMapRequest request) throws WmsException(Code)
Parses the requested layers given by the LAYERS request parameter and looks up their corresponding FeatureTypeInfo objects in the server.
Parameters:
  request -
throws:
  WmsException -



parseMandatoryParameters
public void parseMandatoryParameters(GetMapRequest request, boolean parseStylesLayers) throws WmsException(Code)
Parses the mandatory GetMap request parameters:

Mandatory parameters:

  • LAYERS
  • STYLES ommited if SLD or SLD_BODY parameters are supplied
  • BBOX
  • FORMAT
  • WIDTH
  • HEIGHT


Parameters:
  request - DOCUMENT ME!
throws:
  WmsException - DOCUMENT ME!



parseOptionalParameters
public void parseOptionalParameters(GetMapRequest request) throws WmsException(Code)
Parses the optional parameters:
  • SRS
  • TRANSPARENT
  • EXCEPTIONS
  • BGCOLOR

Parameters:
  request - DOCUMENT ME!
throws:
  WmsException - DOCUMENT ME!



parseSldBodyParam
protected void parseSldBodyParam(GetMapRequest request) throws WmsException(Code)
Takes the SLD_BODY parameter value and parses it to a geotools' StyledLayerDescriptor, then takes the layers and styles to use in the map composition from there.
Parameters:
  request - DOCUMENT ME!
throws:
  WmsException - DOCUMENT ME!



parseSldParam
protected void parseSldParam(GetMapRequest request) throws WmsException(Code)
DOCUMENT ME!
Parameters:
  request - DOCUMENT ME!
throws:
  WmsException - DOCUMENT ME!



parseStylesParam
protected List parseStylesParam(GetMapRequest request, MapLayerInfo[] layers) throws WmsException(Code)
Parses the list of style names requested for each requested layer and looks up the actual Style objects, which are returned in an ordered list.

A client _may_ request teh default Style using a null value (as in "STYLES="). If several layers are requested with a mixture of named and default styles, the STYLES parameter includes null values between commas (as in "STYLES=style1,,style2,,"). If all layers are to be shown using the default style, either the form "STYLES=" or "STYLES=,,," is valid.


Parameters:
  request - DOCUMENT ME!
Parameters:
  layers - the requested feature types a full List of the style names requested for therequiered layers with no null style names.
throws:
  WmsException - if some of the requested styles does not exist or its numberif greater than zero and distinct of the number of requestedlayers



setStylesRequired
public void setStylesRequired(boolean parseStyles)(Code)
Sets wether the STYLES parameter must be parsed
Parameters:
  parseStyles -



Methods inherited from org.vfny.geoserver.wms.requests.WmsKvpRequestReader
protected String getRequestVersion()(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.