Source Code Cross Referenced for GetKMLReflectKvpReader.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 Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org.  All rights reserved.
002:         * This code is licensed under the GPL 2.0 license, availible at the root
003:         * application directory.
004:         */
005:        package org.vfny.geoserver.wms.requests;
006:
007:        import com.vividsolutions.jts.geom.Envelope;
008:        import org.vfny.geoserver.global.FeatureTypeInfo;
009:        import org.vfny.geoserver.global.MapLayerInfo;
010:        import org.vfny.geoserver.wms.WmsException;
011:        import org.vfny.geoserver.wms.servlets.WMService;
012:        import java.util.List;
013:        import java.util.Map;
014:        import java.util.logging.Logger;
015:
016:        /**
017:         * GetKMLReflectKvpReader:
018:         *
019:         * This class is a refinement of GetMapKvpReader. It just moves some
020:         * of the mandatory parameters to "optional" parameters. This is to allow
021:         * the kml reflector (KMLReflector) to accept brief/simple requests and it
022:         * will fill in the rest of the information.
023:         *
024:         * @author Brent Owens
025:         *
026:         */
027:        public class GetKMLReflectKvpReader extends GetMapKvpReader {
028:            private static final Logger LOGGER = org.geotools.util.logging.Logging
029:                    .getLogger("org.vfny.geoserver.requests.readers.wms");
030:
031:            public GetKMLReflectKvpReader(Map kvpPairs, WMService service) {
032:                super (kvpPairs, service);
033:                setStylesRequired(false);
034:            }
035:
036:            /**
037:             * Optional parameters are:
038:             * width
039:             * height
040:             * format
041:             */
042:            public void parseOptionalParameters(GetMapRequest request)
043:                    throws WmsException {
044:                super .parseOptionalParameters(request);
045:
046:                // pulled out some of the mandatory params from superclass and made them optional:
047:                if (keyExists("WIDTH") && keyExists("HEIGHT")) {
048:                    try {
049:                        int width = Integer.parseInt(getValue("WIDTH"));
050:                        int height = Integer.parseInt(getValue("HEIGHT"));
051:                        request.setWidth(width);
052:                        request.setHeight(height);
053:                    } catch (NumberFormatException ex) {
054:                        throw new WmsException(
055:                                "WIDTH and HEIGHT incorrectly specified, they must be integers");
056:                    }
057:                }
058:
059:                // FORMAT parameter, this might be KML, KMZ, or an image
060:                if (keyExists("FORMAT")) {
061:                    String format = getValue("FORMAT");
062:                    request.setFormat(format);
063:                }
064:            }
065:
066:            /**
067:             * Mandatory parameters are 'bbox' and 'layers'. Styles are optional, but they
068:             * are parsed at the same time as layers.
069:             */
070:            public void parseMandatoryParameters(GetMapRequest request,
071:                    boolean parseStylesLayers) throws WmsException {
072:                Envelope bbox = parseBbox(getValue("BBOX"));
073:                request.setBbox(bbox);
074:
075:                //let styles and layers parsing for the end to give more trivial parameters 
076:                //a chance to fail before incurring in retrieving the SLD or SLD_BODY
077:                if (parseStylesLayers) {
078:                    parseLayersAndStyles(request);
079:                }
080:            }
081:
082:            /**
083:             * Changed from the parent class to allow for missing style parameter.
084:             * The parameter is optional now.
085:             */
086:            protected void parseLayersAndStyles(GetMapRequest request)
087:                    throws WmsException {
088:                String sldParam = getValue("SLD");
089:                String sldBodyParam = getValue("SLD_BODY");
090:
091:                if (sldBodyParam != null) {
092:                    LOGGER.fine("Getting layers and styles from SLD_BODY");
093:                    parseSldBodyParam(request);
094:                } else if (sldParam != null) {
095:                    LOGGER.fine("Getting layers and styles from reomte SLD");
096:                    parseSldParam(request);
097:                } else {
098:                    MapLayerInfo[] featureTypes = parseLayersParam(request);
099:                    List styles = null;
100:                    request.setLayers(featureTypes);
101:
102:                    if (isStylesRquired()) {
103:                        styles = parseStylesParam(request, featureTypes);
104:                        request.setStyles(styles);
105:                    } else {
106:                        if (keyExists("STYLES")) {
107:                            styles = parseStylesParam(request, featureTypes);
108:                            request.setStyles(styles);
109:                        }
110:                    }
111:                }
112:            }
113:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.