Source Code Cross Referenced for GetFeatureInfoDelegate.java in  » GIS » GeoServer » org » vfny » geoserver » wms » responses » featureInfo » 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.responses.featureInfo 
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.responses.featureInfo;
006:
007:        import java.util.List;
008:
009:        import org.opengis.filter.Filter;
010:        import org.vfny.geoserver.Request;
011:        import org.vfny.geoserver.Response;
012:        import org.vfny.geoserver.ServiceException;
013:        import org.vfny.geoserver.global.MapLayerInfo;
014:        import org.vfny.geoserver.global.Service;
015:        import org.vfny.geoserver.wms.WmsException;
016:        import org.vfny.geoserver.wms.requests.GetFeatureInfoRequest;
017:
018:        /**
019:         * Base class for GetFeatureInfo delegates responsible of creating
020:         * GetFeatureInfo responses in different formats.
021:         *
022:         * <p>
023:         * Subclasses should implement one or more output formats, wich will be
024:         * returned in a list of mime type strings in
025:         * <code>getSupportedFormats</code>. For example, a subclass can be created to
026:         * write one of the following output formats:
027:         *
028:         * <ul>
029:         * <li>
030:         * text/plain
031:         * </li>
032:         * <li>
033:         * text/html
034:         * </li>
035:         * </ul>
036:         * </p>
037:         *
038:         * <p>
039:         * This abstract class takes care of executing the request in the sense of
040:         * taking the GetFeatureInfo request parameters such as query_layers, bbox, x,
041:         * y, etc., create the gt2 query objects for each featuretype and executing
042:         * it. This process leads to a set of FeatureResults objects and its metadata,
043:         * wich will be given to the <code>execute(FeatureTypeInfo[] ,
044:         * FeatureResults[])</code> method, that a subclass should implement as a
045:         * matter of setting up any resource/state it needs to later encoding.
046:         * </p>
047:         *
048:         * <p>
049:         * So, it should be enough to a subclass to implement the following methods in
050:         * order to produce the requested output format:
051:         *
052:         * <ul>
053:         * <li>
054:         * execute(FeatureTypeInfo[], FeatureResults[], int, int)
055:         * </li>
056:         * <li>
057:         * canProduce(String mapFormat)
058:         * </li>
059:         * <li>
060:         * getSupportedFormats()
061:         * </li>
062:         * <li>
063:         * writeTo(OutputStream)
064:         * </li>
065:         * </ul>
066:         * </p>
067:         *
068:         * @author Gabriel Roldan, Axios Engineering
069:         * @author Chris Holmes
070:         * @version $Id: GetFeatureInfoDelegate.java 8418 2008-02-18 14:47:17Z aaime $
071:         */
072:        public abstract class GetFeatureInfoDelegate implements  Response {
073:            /** DOCUMENT ME!  */
074:            private GetFeatureInfoRequest request;
075:
076:            /**
077:             * Creates a new GetMapDelegate object.
078:             */
079:            public GetFeatureInfoDelegate() {
080:            }
081:
082:            /**
083:             * Executes a Request, which must be a GetMapRequest.  Any other will cause
084:             * a class cast exception.
085:             *
086:             * @param request A valid GetMapRequest.
087:             *
088:             * @throws ServiceException If the request can not be executed.
089:             */
090:            public void execute(Request request) throws ServiceException {
091:                execute((GetFeatureInfoRequest) request);
092:            }
093:
094:            /**
095:             * Executes a GetFeatureInfo request.  Builds the proper objects from the
096:             * request names.
097:             *
098:             * @param request A valid GetMapRequest.
099:             *
100:             * @throws WmsException If anything goes wrong.
101:             */
102:            protected void execute(GetFeatureInfoRequest request)
103:                    throws WmsException {
104:                this .request = request;
105:
106:                //use the layer of the QUERY_LAYERS parameter, not the LAYERS one
107:                MapLayerInfo[] layers = request.getQueryLayers();
108:
109:                List filterList = request.getGetMapRequest().getFilter();
110:                Filter[] filters;
111:
112:                if (filterList != null) {
113:                    filters = (Filter[]) filterList
114:                            .toArray(new Filter[filterList.size()]);
115:                } else {
116:                    filters = new Filter[layers.length];
117:                }
118:
119:                int x = request.getXPixel();
120:                int y = request.getYPixel();
121:                execute(layers, filters, x, y);
122:            }
123:
124:            /**
125:             * DOCUMENT ME!
126:             *
127:             * @param gs DOCUMENT ME!
128:             */
129:            public void abort(Service gs) {
130:            }
131:
132:            /**
133:             * Execute method for concrete children to implement.  Each param is an
134:             * array in the order things should be processed.
135:             *
136:             * @param requestedLayers Array of config information of the FeatureTypes
137:             *        to be processed.
138:             * @param queries Matching array of layer definition filters
139:             * @param x the X coordinate in pixels where the identification must be
140:             *        done relative to the image dimensions
141:             * @param y the Y coordinate in pixels where the identification must be
142:             *        done relative to the image dimensions
143:             *
144:             * @throws WmsException For any problems executing.
145:             */
146:            protected abstract void execute(MapLayerInfo[] requestedLayers,
147:                    Filter[] filters, int x, int y) throws WmsException;
148:
149:            /**
150:             * Gets the map request.  Used by delegate children to find out more
151:             * information about the request.
152:             *
153:             * @return The request to be processed.
154:             */
155:            protected GetFeatureInfoRequest getRequest() {
156:                return this .request;
157:            }
158:
159:            /**
160:             * Evaluates if this GetFeatureInfo producer can generate the map format
161:             * specified by <code>mapFormat</code>, where <code>mapFormat</code> is
162:             * the MIME type of the requested response.
163:             *
164:             * @param mapFormat the MIME type of the output map format requiered
165:             *
166:             * @return true if class can produce a map in the passed format
167:             */
168:            public boolean canProduce(String mapFormat) {
169:                return getSupportedFormats().contains(mapFormat);
170:            }
171:
172:            /**
173:             * Gets A list of the formats this delegate supports.
174:             *
175:             * @return A list of strings of the formats supported.
176:             */
177:            public abstract List getSupportedFormats();
178:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.