[mapserver-commits] r8567 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Feb 17 17:09:07 EST 2009


Author: tomkralidis
Date: 2009-02-17 17:09:07 -0500 (Tue, 17 Feb 2009)
New Revision: 8567

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapwms.c
Log:
add GetSchemaExtension to WMS to support GetStyles in Capabilities XML (#473)



Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2009-02-17 15:30:51 UTC (rev 8566)
+++ trunk/mapserver/HISTORY.TXT	2009-02-17 22:09:07 UTC (rev 8567)
@@ -12,6 +12,8 @@
 Current Version (5.3-dev, SVN trunk):
 ------------------------------------
 
+- add GetSchemaExtension to WMS to support GetStyles in Capabilities XML (#473)
+
 - move xlink declaration to root of WMS 1.3.0 DescribeLayerResponse
 
 - Fixed a scalebar rounding problem causing to draw zero scalebar width (#2890)

Modified: trunk/mapserver/mapwms.c
===================================================================
--- trunk/mapserver/mapwms.c	2009-02-17 15:30:51 UTC (rev 8566)
+++ trunk/mapserver/mapwms.c	2009-02-17 22:09:07 UTC (rev 8567)
@@ -1960,9 +1960,11 @@
       msIO_printf("  xmlns=\"http://www.opengis.net/wms\""
                   "   xmlns:sld=\"http://www.opengis.net/sld\""
                   "   xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
+                  "   xmlns:ms=\"http://mapserver.gis.umn.edu/mapserver\""
                   "   xsi:schemaLocation=\"http://www.opengis.net/wms %s/wms/%s/capabilities_1_3_0.xsd "
-                  " http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd\"",
-         msOWSGetSchemasLocation(map), msOWSGetVersionString(nVersion, szVersionBuf));
+                  " http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd "
+                  " http://mapserver.gis.umn.edu/mapserver %sservice=WMS&version=1.3.0&request=GetSchemaExtension\"",
+         msOWSGetSchemasLocation(map), msOWSGetVersionString(nVersion, szVersionBuf), script_url_encoded);
   }
 
   msIO_printf(">\n");
@@ -2134,6 +2136,7 @@
     if (nVersion >= OWS_1_1_1) {
         
         if (nVersion == OWS_1_3_0)
+        {
           msWMSPrintRequestCap(nVersion, "sld:GetLegendGraphic", script_url_encoded,
                     mime_list[0], mime_list[1], mime_list[2], mime_list[3],
                     mime_list[4], mime_list[5], mime_list[6], mime_list[7],
@@ -2141,6 +2144,8 @@
                     mime_list[12], mime_list[13], mime_list[14], mime_list[15],
                     mime_list[16], mime_list[17], mime_list[18], mime_list[19],
                     NULL );
+          msWMSPrintRequestCap(nVersion, "ms:GetStyles", script_url_encoded, "text/xml", NULL);
+        }
         else 
         {
             msWMSPrintRequestCap(nVersion, "GetLegendGraphic", script_url_encoded,
@@ -3357,7 +3362,28 @@
     return(MS_SUCCESS);
 }
 
+int msWMSGetSchemaExtension(mapObj *map) 
+{
+    char *schemalocation = NULL;
 
+    schemalocation = msEncodeHTMLEntities(msOWSGetSchemasLocation(map));
+
+    msIO_printf("Content-type: text/xml\n\n");
+
+    msOWSPrintEncodeMetadata(stdout, &(map->web.metadata),
+                            "MO", "encoding", OWS_NOERR,
+                            "<?xml version='1.0' encoding=\"%s\"?>\n",
+                            "ISO-8859-1");
+    msIO_printf("<schema xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:wms=\"http://www.opengis.net/wms\" xmlns:ms=\"http://mapserver.gis.umn.edu/mapserver\" targetNamespace=\"http://mapserver.gis.umn.edu/mapserver\" elementFormDefault=\"qualified\" version=\"1.0.0\">\n");
+    msIO_printf("  <import namespace=\"http://www.opengis.net/wms\" schemaLocation=\"%s/wms/1.3.0/capabilities_1_3_0.xsd\"/>\n", schemalocation);
+    msIO_printf("  <element name=\"GetStyles\" type=\"wms:OperationType\" substitutionGroup=\"wms:_ExtendedOperation\"/>\n");
+    msIO_printf("</schema>");
+
+    free(schemalocation);
+
+    return(MS_SUCCESS);
+}
+
 #endif /* USE_WMS_SVR */
 
 
@@ -3529,6 +3555,9 @@
   if (strcasecmp(request, "GetStyles") == 0)
     return msWMSGetStyles(map, nVersion, req->ParamNames, req->ParamValues, req->NumParams);
 
+  else if (request && strcasecmp(request, "GetSchemaExtension") == 0)
+    return msWMSGetSchemaExtension(map);
+
   /* getMap parameters are used by both getMap and getFeatureInfo */
   if (strcasecmp(request, "map") == 0 || strcasecmp(request, "GetMap") == 0 ||
       strcasecmp(request, "feature_info") == 0 || strcasecmp(request, "GetFeatureInfo") == 0 || strcasecmp(request, "DescribeLayer") == 0)



More information about the mapserver-commits mailing list