1 /*****************************************************************************
2  * $Id$
3  *
4  * Project:  MapServer
5  * Purpose:  OGC Web Services (WMS, WFS, WCS) support function definitions
6  * Author:   Daniel Morissette, DM Solutions Group (morissette@dmsolutions.ca)
7  *
8  ******************************************************************************
9  * Copyright (c) 1996-2005 Regents of the University of Minnesota.
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining a
12  * copy of this software and associated documentation files (the "Software"),
13  * to deal in the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  * and/or sell copies of the Software, and to permit persons to whom the
16  * Software is furnished to do so, subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be included in
19  * all copies of this Software or works derived from this Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  ****************************************************************************/
29 
30 
31 #ifndef MAPOWS_H
32 #define MAPOWS_H
33 
34 #include "maphttp.h"
35 #include <time.h>
36 
37 /* This is the URL to the official OGC Schema Repository. We use it by
38  * default for OGC services unless the ows_schemas_lcoation web metadata
39  * is set in the mapfile.
40  */
41 #define OWS_DEFAULT_SCHEMAS_LOCATION   "http://schemas.opengis.net"
42 
43 #if defined USE_LIBXML2 && defined USE_WFS_SVR
44 #include<libxml/tree.h>
45 #endif
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 
52 /*====================================================================
53  *   mapows.c
54  *====================================================================*/
55 
56 typedef struct {
57   char *pszVersion;
58   char *pszUpdateSequence;
59   char *pszRequest;
60   char *pszService;
61   char *pszTypeName;
62   char *pszFilter;
63   char *pszFilterLanguage;
64   char *pszGeometryName;
65   int nMaxFeatures;
66   char *pszBbox; /* only used with a Get Request */
67   char *pszOutputFormat;
68   char *pszFeatureId;
69   char *pszSrs;
70   char *pszResultType;
71   char *pszPropertyName;
72   int nStartIndex;
73   char *pszAcceptVersions;
74   char *pszSections;
75   char *pszSortBy; /* Not implemented yet */
76   char *pszLanguage; /* Inspire extension */
77   char *pszValueReference; /* For GetValueReference */
78   char *pszStoredQueryId; /* For DescribeStoredQueries */
79   int   countGetFeatureById; /* Number of urn:ogc:def:query:OGC-WFS::GetFeatureById GetFeature requests */
80   int   bHasPostStoredQuery; /* TRUE if a XML GetFeature StoredQuery is present */
81 } wfsParamsObj;
82 
83 /*
84  * sosParamsObj
85  * Used to preprocess SOS request parameters
86  *
87  */
88 
89 typedef struct {
90   char *pszVersion;
91   char *pszAcceptVersions;
92   char *pszUpdateSequence;
93   char *pszRequest;
94   char *pszService;
95   char *pszOutputFormat;
96   char *pszSensorId;
97   char *pszProcedure;
98   char *pszOffering;
99   char *pszObservedProperty;
100   char *pszEventTime;
101   char *pszResult;
102   char *pszResponseFormat;
103   char *pszResultModel;
104   char *pszResponseMode;
105   char *pszBBox;
106   char *pszFeatureOfInterest;
107   char *pszSrsName;
108 } sosParamsObj;
109 
110 /* wmsParamsObj
111  *
112  * Used to preprocess WMS request parameters and combine layers that can
113  * be comined in a GetMap request.
114  */
115 typedef  struct {
116   char        *onlineresource;
117   hashTableObj *params;
118   int          numparams;
119   char         *httpcookiedata;
120 } wmsParamsObj;
121 
122 /* metadataParamsObj: Represent a metadata specific request with its enabled layers */
123 typedef struct {
124   char *pszRequest;
125   char *pszLayer;
126   char *pszOutputSchema;
127 } metadataParamsObj;
128 
129 /* owsRequestObj: Represent a OWS specific request with its enabled layers */
130 typedef struct {
131   int numlayers;
132   int numwmslayerargs;
133   int *enabled_layers;
134   int *layerwmsfilterindex;
135 
136   char *service;
137   char *version;
138   char *request;
139   void *document; /* xmlDocPtr or CPLXMLNode* */
140 } owsRequestObj;
141 
142 MS_DLL_EXPORT int msOWSDispatch(mapObj *map, cgiRequestObj *request, int ows_mode);
143 
144 MS_DLL_EXPORT const char * msOWSLookupMetadata(hashTableObj *metadata,
145     const char *namespaces, const char *name);
146 MS_DLL_EXPORT const char * msOWSLookupMetadataWithLanguage(hashTableObj *metadata,
147     const char *namespaces, const char *name, const char *validated_language);
148 MS_DLL_EXPORT const char * msOWSLookupMetadata2(hashTableObj *pri,
149     hashTableObj *sec,
150     const char *namespaces,
151     const char *name);
152 
153 void msOWSInitRequestObj(owsRequestObj *ows_request);
154 void msOWSClearRequestObj(owsRequestObj *ows_request);
155 
156 MS_DLL_EXPORT int msOWSRequestIsEnabled(mapObj *map, layerObj *layer,
157                                         const char *namespaces, const char *name, int check_all_layers);
158 MS_DLL_EXPORT void msOWSRequestLayersEnabled(mapObj *map, const char *namespaces,
159     const char *request, owsRequestObj *request_layers);
160 MS_DLL_EXPORT int msOWSParseRequestMetadata(const char *metadata, const char *request,
161     int *disabled);
162 
163 /* Constants for OWS Service version numbers */
164 #define OWS_0_1_2   0x000102
165 #define OWS_0_1_4   0x000104
166 #define OWS_0_1_6   0x000106
167 #define OWS_0_1_7   0x000107
168 #define OWS_1_0_0   0x010000
169 #define OWS_1_0_1   0x010001
170 #define OWS_1_0_6   0x010006
171 #define OWS_1_0_7   0x010007
172 #define OWS_1_0_8   0x010008
173 #define OWS_1_1_0   0x010100
174 #define OWS_1_1_1   0x010101
175 #define OWS_1_1_2   0x010102
176 #define OWS_1_3_0   0x010300
177 #define OWS_2_0_0   0x020000
178 #define OWS_2_0_1   0x020001
179 #define OWS_VERSION_MAXLEN   20  /* Buffer size for msOWSGetVersionString() */
180 #define OWS_VERSION_NOTSET    -1
181 #define OWS_VERSION_BADFORMAT -2
182 
183 MS_DLL_EXPORT int msOWSParseVersionString(const char *pszVersion);
184 MS_DLL_EXPORT const char *msOWSGetVersionString(int nVersion, char *pszBuffer);
185 
186 #if defined(USE_WMS_SVR) || defined (USE_WFS_SVR) || defined (USE_WCS_SVR) || defined(USE_SOS_SVR) || defined(USE_WMS_LYR) || defined(USE_WFS_LYR)
187 
188 MS_DLL_EXPORT int msOWSMakeAllLayersUnique(mapObj *map);
189 MS_DLL_EXPORT int msOWSNegotiateVersion(int requested_version, const int supported_versions[], int num_supported_versions);
190 MS_DLL_EXPORT char *msOWSTerminateOnlineResource(const char *src_url);
191 MS_DLL_EXPORT char *msOWSGetOnlineResource(mapObj *map, const char *namespaces, const char *metadata_name, cgiRequestObj *req);
192 MS_DLL_EXPORT char *msOWSGetOnlineResource2(mapObj *map, const char *namespaces, const char *metadata_name, cgiRequestObj *req, const char *validated_language);
193 MS_DLL_EXPORT const char *msOWSGetSchemasLocation(mapObj *map);
194 MS_DLL_EXPORT const char *msOWSGetInspireSchemasLocation(mapObj *map);
195 MS_DLL_EXPORT const char *msOWSGetLanguage(mapObj *map, const char *context);
196 MS_DLL_EXPORT char **msOWSGetLanguageList(mapObj *map, const char *namespaces, int *numitems);
197 MS_DLL_EXPORT char *msOWSGetLanguageFromList(mapObj *map, const char *namespaces, const char *requested_language);
198 MS_DLL_EXPORT char *msOWSLanguageNegotiation(mapObj *map, const char *namespaces, char **accept_languages, int num_accept_languages);
199 
200 
201 /* OWS_NOERR and OWS_WARN passed as action_if_not_found to printMetadata() */
202 #define OWS_NOERR   0
203 #define OWS_WARN    1
204 
205 /* OWS_WMS and OWS_WFS used for functions that differ in behavior between */
206 /* WMS and WFS services (e.g. msOWSPrintLatLonBoundingBox()) */
207 typedef enum
208 {
209     OWS_WMS = 1,
210     OWS_WFS = 2,
211     OWS_WCS = 3
212 } OWSServiceType;
213 
214 MS_DLL_EXPORT int msOWSPrintInspireCommonExtendedCapabilities(FILE *stream, mapObj *map, const char *namespaces,
215     int action_if_not_found, const char *tag_name, const char* tag_ns,
216     const char *validated_language, const OWSServiceType service);
217 int msOWSPrintInspireCommonMetadata(FILE *stream, mapObj *map, const char *namespaces,
218                                     int action_if_not_found, const OWSServiceType service);
219 int msOWSPrintInspireCommonLanguages(FILE *stream, mapObj *map, const char *namespaces,
220                                      int action_if_not_found, const char *validated_language);
221 
222 MS_DLL_EXPORT int msOWSPrintMetadata(FILE *stream, hashTableObj *metadata,
223                                      const char *namespaces, const char *name,
224                                      int action_if_not_found, const char *format,
225                                      const char *default_value);
226 int msOWSPrintEncodeMetadata(FILE *stream, hashTableObj *metadata,
227                              const char *namespaces, const char *name,
228                              int action_if_not_found,
229                              const char *format, const char *default_value) ;
230 int msOWSPrintEncodeMetadata2(FILE *stream, hashTableObj *metadata,
231                               const char *namespaces, const char *name,
232                               int action_if_not_found,
233                               const char *format, const char *default_value,
234                               const char *validated_language);
235 char *msOWSGetEncodeMetadata(hashTableObj *metadata,
236                              const char *namespaces, const char *name,
237                              const char *default_value);
238 
239 int msOWSPrintValidateMetadata(FILE *stream, hashTableObj *metadata,
240                                const char *namespaces, const char *name,
241                                int action_if_not_found,
242                                const char *format, const char *default_value);
243 int msOWSPrintGroupMetadata(FILE *stream, mapObj *map, char* pszGroupName,
244                             const char *namespaces, const char *name,
245                             int action_if_not_found,
246                             const char *format, const char *default_value);
247 int msOWSPrintGroupMetadata2(FILE *stream, mapObj *map, char* pszGroupName,
248                              const char *namespaces, const char *name,
249                              int action_if_not_found,
250                              const char *format, const char *default_value,
251                              const char *validated_language);
252 int msOWSPrintURLType(FILE *stream, hashTableObj *metadata,
253                       const char *namespaces, const char *name,
254                       int action_if_not_found, const char *tag_format,
255                       const char *tag_name, const char *type_format,
256                       const char *width_format, const char *height_format,
257                       const char *urlfrmt_format, const char *href_format,
258                       int type_is_mandatory, int width_is_mandatory,
259                       int height_is_mandatory, int format_is_mandatory,
260                       int href_is_mandatory, const char *default_type,
261                       const char *default_width, const char *default_height,
262                       const char *default_urlfrmt, const char *default_href,
263                       const char *tabspace);
264 int msOWSPrintParam(FILE *stream, const char *name, const char *value,
265                     int action_if_not_found, const char *format,
266                     const char *default_value);
267 int msOWSPrintEncodeParam(FILE *stream, const char *name, const char *value,
268                           int action_if_not_found, const char *format,
269                           const char *default_value);
270 int msOWSPrintMetadataList(FILE *stream, hashTableObj *metadata,
271                            const char *namespaces, const char *name,
272                            const char *startTag,
273                            const char *endTag, const char *itemFormat,
274                            const char *default_value);
275 int msOWSPrintEncodeMetadataList(FILE *stream, hashTableObj *metadata,
276                                  const char *namespaces, const char *name,
277                                  const char *startTag,
278                                  const char *endTag, const char *itemFormat,
279                                  const char *default_value);
280 int msOWSPrintEncodeParamList(FILE *stream, const char *name,
281                               const char *value, int action_if_not_found,
282                               char delimiter, const char *startTag,
283                               const char *endTag, const char *format,
284                               const char *default_value);
285 void msOWSProjectToWGS84(projectionObj *srcproj, rectObj *ext);
286 void msOWSPrintLatLonBoundingBox(FILE *stream, const char *tabspace,
287                                  rectObj *extent, projectionObj *srcproj,
288                                  projectionObj *wfsproj, OWSServiceType nService);
289 void msOWSPrintEX_GeographicBoundingBox(FILE *stream, const char *tabspace,
290                                         rectObj *extent, projectionObj *srcproj);
291 
292 void msOWSPrintBoundingBox(FILE *stream, const char *tabspace,
293                            rectObj *extent,
294                            projectionObj *srcproj,
295                            hashTableObj *layer_meta,
296                            hashTableObj *map_meta,
297                            const char *namespaces,
298                            int wms_version);
299 void msOWSPrintContactInfo( FILE *stream, const char *tabspace,
300                             int nVersion, hashTableObj *metadata,
301                             const char *namespaces  );
302 int msOWSGetLayerExtent(mapObj *map, layerObj *lp, const char *namespaces, rectObj *ext);
303 
304 int msOWSExecuteRequests(httpRequestObj *pasReqInfo, int numRequests,
305                          mapObj *map, int bCheckLocalCache);
306 
307 void msOWSProcessException(layerObj *lp, const char *pszFname,
308                            int nErrorCode, const char *pszFuncName);
309 char *msOWSBuildURLFilename(const char *pszPath, const char *pszURL,
310                             const char *pszExt);
311 void msOWSGetEPSGProj(projectionObj *proj, hashTableObj *metadata, const char *namespaces, int bReturnOnlyFirstOne, char **epsgProj);
312 char *msOWSGetProjURN(projectionObj *proj, hashTableObj *metadata, const char *namespaces, int bReturnOnlyFirstOne);
313 char *msOWSGetProjURI(projectionObj *proj, hashTableObj *metadata, const char *namespaces, int bReturnOnlyFirstOne);
314 
315 void msOWSGetDimensionInfo(layerObj *layer, const char *pszDimension,
316                            const char **pszDimUserValue,
317                            const char **pszDimUnits,
318                            const char **pszDimDefault,
319                            const char **pszDimNearValue,
320                            const char **pszDimUnitSymbol,
321                            const char **pszDimMultiValue);
322 
323 int msOWSNegotiateUpdateSequence(const char *requested_updateSequence, const char *updatesequence);
324 
325 outputFormatObj *msOwsIsOutputFormatValid(mapObj *map, const char *format, hashTableObj *metadata,
326     const char *namespaces, const char *name);
327 #endif /* #if any wxs service enabled */
328 
329 /*====================================================================
330  *   mapgml.c
331  *====================================================================*/
332 
333 typedef enum
334 {
335     OWS_GML2, /* 2.1.2 */
336     OWS_GML3, /* 3.1.1 */
337     OWS_GML32 /* 3.2.1 */
338 } OWSGMLVersion;
339 
340 #define OWS_WFS_FEATURE_COLLECTION_NAME "msFeatureCollection"
341 #define OWS_GML_DEFAULT_GEOMETRY_NAME "msGeometry"
342 #define OWS_GML_OCCUR_UNBOUNDED -1
343 
344 /* TODO, there must be a better way to generalize these lists of objects... */
345 
346 typedef struct {
347   char *name;     /* name of the item */
348   char *alias;    /* is the item aliased for presentation? (NULL if not) */
349   char *type;     /* raw type for this item (NULL for a "string") (TODO: should this be a lookup table instead?) */
350 #ifndef __cplusplus
351   char *template;  /* presentation string for this item, needs to be a complete XML tag */
352 #else
353   char *_template;  /* presentation string for this item, needs to be a complete XML tag */
354 #endif
355   int encode;     /* should the value be HTML encoded? Default is MS_TRUE */
356   int visible;    /* should this item be output, default is MS_FALSE */
357   int width;      /* field width, zero if unknown */
358   int precision;  /* field precision (decimal places), zero if unknown or N/A */
359   int outputByDefault; /* whether this should be output in a GetFeature without PropertyName. MS_TRUE by default, unless gml_default_items is specified and the item name is not in it */
360   int minOccurs;  /* 0 by default. Can be set to 1 by specifying item name in gml_mandatory_items */
361 } gmlItemObj;
362 
363 typedef struct {
364   gmlItemObj *items;
365   int numitems;
366 } gmlItemListObj;
367 
368 typedef struct {
369   char *name;     /* name of the constant */
370   char *type;     /* raw type for this item (NULL for a "string") */
371   char *value;    /* output value for this constant (output will look like: <name>value</name>) */
372 } gmlConstantObj;
373 
374 typedef struct {
375   gmlConstantObj *constants;
376   int numconstants;
377 } gmlConstantListObj;
378 
379 typedef struct {
380   char *name;     /* name of the geometry (type of GML property) */
381   char *type;     /* raw type for these geometries (point|multipoint|line|multiline|polygon|multipolygon */
382   int occurmin, occurmax;   /* number of occurances (default 0,1) */
383 } gmlGeometryObj;
384 
385 typedef struct {
386   gmlGeometryObj *geometries;
387   int numgeometries;
388 } gmlGeometryListObj;
389 
390 typedef struct {
391   char *name;     /* name of the group */
392   char **items;   /* list of items in the group */
393   int numitems;   /* number of items */
394   char *type;     /* name of the complex type */
395 } gmlGroupObj;
396 
397 typedef struct {
398   gmlGroupObj *groups;
399   int numgroups;
400 } gmlGroupListObj;
401 
402 typedef struct {
403   char *prefix;
404   char *uri;
405   char *schemalocation;
406 } gmlNamespaceObj;
407 
408 typedef struct {
409   gmlNamespaceObj *namespaces;
410   int numnamespaces;
411 } gmlNamespaceListObj;
412 
413 MS_DLL_EXPORT gmlItemListObj *msGMLGetItems(layerObj *layer, const char *metadata_namespaces);
414 MS_DLL_EXPORT void msGMLFreeItems(gmlItemListObj *itemList);
415 
416 #if defined(USE_WMS_SVR) || defined (USE_WFS_SVR)
417 
418 MS_DLL_EXPORT int msItemInGroups(const char *name, gmlGroupListObj *groupList);
419 MS_DLL_EXPORT gmlConstantListObj *msGMLGetConstants(layerObj *layer, const char *metadata_namespaces);
420 MS_DLL_EXPORT void msGMLFreeConstants(gmlConstantListObj *constantList);
421 MS_DLL_EXPORT gmlGeometryListObj *msGMLGetGeometries(layerObj *layer, const char *metadata_namespaces, int bWithDefaultGeom);
422 MS_DLL_EXPORT void msGMLFreeGeometries(gmlGeometryListObj *geometryList);
423 MS_DLL_EXPORT gmlGroupListObj *msGMLGetGroups(layerObj *layer, const char *metadata_namespaces);
424 MS_DLL_EXPORT void msGMLFreeGroups(gmlGroupListObj *groupList);
425 MS_DLL_EXPORT gmlNamespaceListObj *msGMLGetNamespaces(webObj *web, const char *metadata_namespaces);
426 MS_DLL_EXPORT void msGMLFreeNamespaces(gmlNamespaceListObj *namespaceList);
427 #endif
428 
429 /* export to fix bug 851 */
430 MS_DLL_EXPORT int msGMLWriteQuery(mapObj *map, char *filename, const char *namespaces);
431 
432 
433 #ifdef USE_WFS_SVR
434 
435 void msGMLWriteWFSBounds(mapObj *map, FILE *stream, const char *tab,
436                          OWSGMLVersion outputformat, int nWFSVersion, int bUseURN);
437 
438 MS_DLL_EXPORT int msGMLWriteWFSQuery(mapObj *map, FILE *stream, const char *wfs_namespace,
439                                      OWSGMLVersion outputformat, int nWFSVersion, int bUseURN,
440                                      int bGetPropertyValueRequest);
441 #endif
442 
443 
444 /*====================================================================
445  *   mapwms.c
446  *====================================================================*/
447 int msWMSDispatch(mapObj *map, cgiRequestObj *req, owsRequestObj *ows_request, int force_wms_mode);
448 MS_DLL_EXPORT int msWMSLoadGetMapParams(mapObj *map, int nVersion,
449                                         char **names, char **values, int numentries,
450                                         char *wms_exception_format, const char *wms_request, owsRequestObj *ows_request);
451 
452 
453 /*====================================================================
454  *   mapwmslayer.c
455  *====================================================================*/
456 
457 #define WMS_GETMAP         1
458 #define WMS_GETFEATUREINFO 2
459 #define WMS_GETLEGENDGRAPHIC 3
460 
461 int msInitWmsParamsObj(wmsParamsObj *wmsparams);
462 void msFreeWmsParamsObj(wmsParamsObj *wmsparams);
463 
464 int msPrepareWMSLayerRequest(int nLayerId, mapObj *map, layerObj *lp,
465                              int nRequestType, enum MS_CONNECTION_TYPE lastconnectiontype,
466                              wmsParamsObj *psLastWMSParams,
467                              int nClickX, int nClickY, int nFeatureCount, const char *pszInfoFormat,
468                              httpRequestObj *pasReqInfo, int *numRequests);
469 int msDrawWMSLayerLow(int nLayerId, httpRequestObj *pasReqInfo,
470                       int numRequests, mapObj *map, layerObj *lp,
471                       imageObj *img);
472 MS_DLL_EXPORT char *msWMSGetFeatureInfoURL(mapObj *map, layerObj *lp,
473     int nClickX, int nClickY, int nFeatureCount,
474     const char *pszInfoFormat);
475 int msWMSLayerExecuteRequest(mapObj *map, int nOWSLayers, int nClickX, int nClickY,
476                              int nFeatureCount, const char *pszInfoFormat, int type);
477 
478 /*====================================================================
479  *   mapmetadata.c
480  *====================================================================*/
481 metadataParamsObj *msMetadataCreateParamsObj(void);
482 void msMetadataFreeParamsObj(metadataParamsObj *metadataparams);
483 int msMetadataParseRequest(mapObj *map, cgiRequestObj *request, owsRequestObj *ows_request,
484                       metadataParamsObj *metadataparams);
485 int msMetadataDispatch(mapObj *map, cgiRequestObj *requestobj, owsRequestObj *ows_request);
486 void msMetadataSetGetMetadataURL(layerObj *lp, const char *url);
487 
488 /*====================================================================
489  *   mapwfs.c
490  *====================================================================*/
491 
492 MS_DLL_EXPORT int msWFSDispatch(mapObj *map, cgiRequestObj *requestobj,
493                                 owsRequestObj *ows_request, int force_wfs_mode);
494 int msWFSParseRequest(mapObj *map, cgiRequestObj *, owsRequestObj *ows_request,
495                       wfsParamsObj *, int force_wfs_mode);
496 wfsParamsObj *msWFSCreateParamsObj(void);
497 int msWFSHandleUpdateSequence(mapObj *map, wfsParamsObj *wfsparams, const char* pszFunction);
498 void msWFSFreeParamsObj(wfsParamsObj *wfsparams);
499 int msWFSIsLayerSupported(layerObj *lp);
500 int msWFSException(mapObj *map, const char *locator, const char *code,
501                    const char *version);
502 
503 #ifdef USE_WFS_SVR
504 const char *msWFSGetGeomElementName(mapObj *map, layerObj *lp);
505 
506 int msWFSException11(mapObj *map, const char *locator,
507                      const char *exceptionCode, const char *version);
508 int msWFSGetCapabilities11(mapObj *map, wfsParamsObj *wfsparams,
509                            cgiRequestObj *req, owsRequestObj *ows_request);
510 #ifdef USE_LIBXML2
511 xmlNodePtr msWFSDumpLayer11(mapObj *map, layerObj *lp, xmlNsPtr psNsOws,
512                             int nWFSVersion, const char* validate_language,
513                             char *script_url);
514 #endif
515 char *msWFSGetOutputFormatList(mapObj *map, layerObj *layer, int nWFSVersion);
516 
517 int msWFSException20(mapObj *map, const char *locator,
518                      const char *exceptionCode);
519 int msWFSGetCapabilities20(mapObj *map, wfsParamsObj *params,
520                            cgiRequestObj *req, owsRequestObj *ows_request);
521 int msWFSListStoredQueries20(mapObj *map, wfsParamsObj *params,
522                              cgiRequestObj *req, owsRequestObj *ows_request);
523 int msWFSDescribeStoredQueries20(mapObj *map, wfsParamsObj *params,
524                              cgiRequestObj *req, owsRequestObj *ows_request);
525 char* msWFSGetResolvedStoredQuery20(mapObj *map,
526                                     wfsParamsObj *wfsparams,
527                                     const char* id,
528                                     hashTableObj* hashTable);
529 
530 #endif
531 
532 /*====================================================================
533  *   mapwfslayer.c
534  *====================================================================*/
535 
536 int msPrepareWFSLayerRequest(int nLayerId, mapObj *map, layerObj *lp,
537                              httpRequestObj *pasReqInfo, int *numRequests);
538 void msWFSUpdateRequestInfo(layerObj *lp, httpRequestObj *pasReqInfo);
539 int msWFSLayerOpen(layerObj *lp,
540                    const char *pszGMLFilename, rectObj *defaultBBOX);
541 int msWFSLayerIsOpen(layerObj *lp);
542 int msWFSLayerInitItemInfo(layerObj *layer);
543 int msWFSLayerGetItems(layerObj *layer);
544 int msWFSLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery);
545 int msWFSLayerClose(layerObj *lp);
546 MS_DLL_EXPORT char *msWFSExecuteGetFeature(layerObj *lp);
547 
548 /*====================================================================
549  *   mapcontext.c
550  *====================================================================*/
551 
552 MS_DLL_EXPORT int msWriteMapContext(mapObj *map, FILE *stream);
553 MS_DLL_EXPORT int msSaveMapContext(mapObj *map, char *filename);
554 MS_DLL_EXPORT int msLoadMapContext(mapObj *map, char *filename, int unique_layer_names);
555 MS_DLL_EXPORT int msLoadMapContextURL(mapObj *map, char *urlfilename, int unique_layer_names);
556 
557 
558 /*====================================================================
559  *   mapwcs.c
560  *====================================================================*/
561 
562 int msWCSDispatch(mapObj *map, cgiRequestObj *requestobj, owsRequestObj *ows_request); /* only 1 public function */
563 
564 
565 
566 /*====================================================================
567  *   mapogsos.c
568  *====================================================================*/
569 
570 int msSOSDispatch(mapObj *map, cgiRequestObj *requestobj, owsRequestObj *ows_request); /* only 1 public function */
571 
572 #ifdef __cplusplus
573 } /* extern "C" */
574 #endif
575 
576 #endif /* MAPOWS_H */
577 
578