[mapguide-commits] r5031 - trunk/MgDev/Web/src/HttpHandler
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Jul 15 01:12:06 EDT 2010
Author: liuar
Date: 2010-07-15 05:12:06 +0000 (Thu, 15 Jul 2010)
New Revision: 5031
Modified:
trunk/MgDev/Web/src/HttpHandler/OgcWmsException.cpp
trunk/MgDev/Web/src/HttpHandler/OgcWmsException.h
trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp
Log:
Ticket #1392 OGC WMS 1.3.0 Support
In this submission:
In OGC 06-042 WMS 1.3.0 specification:
The mandatory INFO_FORMAT parameter indicates what format to use when returning the feature information. So, the parameter INFO_FORMAT becomes a mandatory parameter in WMS 1.3.0 If the INFO_FORMAT is missing from the request parameters, an exception with code "MissingInfoFormat" will be thrown.
NOTE: There's no specified error code defined in the specification when the INFO_FORMAT missed.
Implementation:
1. Define a new exception code as MissingInfoFormat and relevant exception message to notify the client.
2. Update the bool MgOgcWmsServer::ValidateGetFeatureInfoParameters() to validate the Info_Format parameter.
Modified: trunk/MgDev/Web/src/HttpHandler/OgcWmsException.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/OgcWmsException.cpp 2010-07-15 04:08:24 UTC (rev 5030)
+++ trunk/MgDev/Web/src/HttpHandler/OgcWmsException.cpp 2010-07-15 05:12:06 UTC (rev 5031)
@@ -36,6 +36,7 @@
CPSZ MgOgcWmsException::kpszOperationNotSupported = _("OperationNotSupported");
CPSZ MgOgcWmsException::kpszMissingBoundingBox = _("MissingBoundingBox");
CPSZ MgOgcWmsException::kpszInvalidBoundingBox = _("InvalidBoundingBox");
+CPSZ MgOgcWmsException::kpszMissingInfoFormat = _("MissingInfoFormat");
// A catch-all for the innards being really unhealthy!
CPSZ MgOgcException::kpszInternalError = _("InternalError");
Modified: trunk/MgDev/Web/src/HttpHandler/OgcWmsException.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/OgcWmsException.h 2010-07-15 04:08:24 UTC (rev 5030)
+++ trunk/MgDev/Web/src/HttpHandler/OgcWmsException.h 2010-07-15 05:12:06 UTC (rev 5031)
@@ -73,6 +73,7 @@
static CPSZ kpszOperationNotSupported;
static CPSZ kpszMissingBoundingBox;
static CPSZ kpszInvalidBoundingBox;
+ static CPSZ kpszMissingInfoFormat;
};
#endif//_OgcWmsException_h
Modified: trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp 2010-07-15 04:08:24 UTC (rev 5030)
+++ trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp 2010-07-15 05:12:06 UTC (rev 5031)
@@ -85,6 +85,7 @@
CPSZ kpszExceptionMessageInvalidBoundingBox = _("The bounding box for the map must be specified using four numerical values in the order: minX,minY,maxX,maxY. (Found BBOX=&Request.bbox;)"); // Localize
CPSZ kpszExceptionMessageInvalidImageFormat = _("The request uses an unsupported image format. (Found FORMAT=&Request.format;)"); // Localize
CPSZ kpszExceptionMessageMissingImageFormat = _("The request must contain a FORMAT parameter to specify the required image format."); // Localize
+CPSZ kpszExceptionMessageMissingInfoFormat = _("The request must contain an INFO_FORMAT parameter to specify the format of feature information (MIME type)."); // Localize
// END LOCALIZATION
CPSZ kpszPiEnumLayers = _("EnumLayers");
@@ -618,6 +619,22 @@
bool bValid = ValidateMapParameters(queryableLayers);
if(bValid)
{
+ // INFO_FORMAT becomes a mandatory parameter since WMS1.3.0
+ STRING sVersion = RequestParameter(kpszQueryStringVersion);
+ // Note: lexical comparison, not numerical one;
+ if(!sVersion.empty() && sVersion >= _("1.3.0"))
+ {
+ CPSZ pszFormat = RequestParameter(kpszQueryStringInfoFormat);
+ if(pszFormat == NULL)
+ {
+ ServiceExceptionReportResponse(MgOgcWmsException(MgOgcWmsException::kpszMissingInfoFormat,
+ kpszExceptionMessageMissingInfoFormat));
+ bValid = false;
+ }
+ }
+ }
+ if(bValid)
+ {
// Make sure we have a query point specified by I and J parameters
CPSZ iCoordString = RequestParameter(kpszQueryStringICoord);
CPSZ jCoordString = RequestParameter(kpszQueryStringJCoord);
More information about the mapguide-commits
mailing list