[mapserver-commits] r9300 - in trunk: docs/de/ogc docs/en/ogc mapserver msautotest/wxs msautotest/wxs/expected

svn at osgeo.org svn at osgeo.org
Mon Sep 14 18:12:43 EDT 2009


Author: tomkralidis
Date: 2009-09-14 18:12:42 -0400 (Mon, 14 Sep 2009)
New Revision: 9300

Modified:
   trunk/docs/de/ogc/wms_server.txt
   trunk/docs/en/ogc/wms_server.txt
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapwms.c
   trunk/msautotest/wxs/expected/wms_cap.xml
   trunk/msautotest/wxs/expected/wms_cap130.xml
   trunk/msautotest/wxs/expected/wms_caps_updatesequence.xml
   trunk/msautotest/wxs/wms_simple.map
Log:
Add WMS root Layer metadata support (#3121)


Modified: trunk/docs/de/ogc/wms_server.txt
===================================================================
--- trunk/docs/de/ogc/wms_server.txt	2009-09-14 21:20:29 UTC (rev 9299)
+++ trunk/docs/de/ogc/wms_server.txt	2009-09-14 22:12:42 UTC (rev 9300)
@@ -852,6 +852,27 @@
 - *WMS TAG Name:* Title (WMS1.1.1, sect. 7.1.4.1)
 - *Description:* (Required) A human-readable name for this Layer.      
 
+**wms_rootlayer_title**
+
+- *WMS TAG Name:* Title (WMS1.1.1, sect. 7.1.4.1)
+- *Description:* (Optional) Same as wms_title, applied to the root Layer
+  element.
+  If not set, then wms_title will be used.
+
+**wms_rootlayer_abstract**
+
+- *WMS TAG Name:* Abstract (WMS1.1.1, sect. 7.1.4.2)
+- *Description:* (Optional) Same as wms_abstract, applied to the root Layer
+  element.
+  If not set, then wms_abstract will be used.
+
+**wms_rootlayer_keywordlist**
+
+- *WMS TAG Name:* KeywordList (WMS1.1.1, sect. 7.1.4.2)
+- *Description:* (Optional) Same as wms_keywordlist, applied to the root Layer
+  element.
+  If not set, then wms_keywordlist will be used.
+
 Layer Object Metadata
 ---------------------
 

Modified: trunk/docs/en/ogc/wms_server.txt
===================================================================
--- trunk/docs/en/ogc/wms_server.txt	2009-09-14 21:20:29 UTC (rev 9299)
+++ trunk/docs/en/ogc/wms_server.txt	2009-09-14 22:12:42 UTC (rev 9300)
@@ -859,6 +859,24 @@
 - *WMS TAG Name:* Title (WMS1.1.1, sect. 7.1.4.1)
 - *Description:* (Required) A human-readable name for this Layer.      
 
+**wms_rootlayer_title**
+
+- *WMS TAG Name:* Title (WMS1.1.1, sect. 7.1.4.1)
+- *Description:* (Optional) Same as wms_title, applied to the root Layer element.
+  If not set, then wms_title will be used.
+  
+**wms_rootlayer_abstract**
+
+- *WMS TAG Name:* Abstract (WMS1.1.1, sect. 7.1.4.2)
+- *Description:* (Optional) Same as wms_abstract, applied to the root Layer element.
+  If not set, then wms_abstract will be used.
+
+**wms_rootlayer_keywordlist**
+
+- *WMS TAG Name:* KeywordList (WMS1.1.1, sect. 7.1.4.2)
+- *Description:* (Optional) Same as wms_keywordlist, applied to the root Layer element.
+  If not set, then wms_keywordlist will be used.
+
 Layer Object Metadata
 ---------------------
 

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2009-09-14 21:20:29 UTC (rev 9299)
+++ trunk/mapserver/HISTORY.TXT	2009-09-14 22:12:42 UTC (rev 9300)
@@ -14,6 +14,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Add WMS root Layer metadata support (#3121)
+
 - Fixed build problem of PHP/Mapscript when php is compiled with gd as
   a shared extension (#3117)
 

Modified: trunk/mapserver/mapwms.c
===================================================================
--- trunk/mapserver/mapwms.c	2009-09-14 21:20:29 UTC (rev 9299)
+++ trunk/mapserver/mapwms.c	2009-09-14 22:12:42 UTC (rev 9300)
@@ -1888,6 +1888,7 @@
   char *schemalocation = NULL;
   const char *updatesequence=NULL;
   const char *sldenabled=NULL;
+  char *pszTmp=NULL;
   int i;
 
   updatesequence = msOWSLookupMetadata(&(map->web.metadata), "MO", "updatesequence");
@@ -2233,9 +2234,46 @@
                  map->name);
   msOWSPrintEncodeParam(stdout, "MAP.NAME", map->name, OWS_NOERR,
                         "    <Name>%s</Name>\n", NULL);
-  msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), "MO", "title",
-                           OWS_WARN, "    <Title>%s</Title>\n", map->name);
 
+  if (msOWSLookupMetadata(&(map->web.metadata), "MO", "rootlayer_title"))
+    msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), "MO", "rootlayer_title", OWS_WARN, "    <Title>%s</Title>\n", map->name);
+
+  else 
+    msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), "MO", "title", OWS_WARN, "    <Title>%s</Title>\n", map->name);
+
+  if (msOWSLookupMetadata(&(map->web.metadata), "MO", "rootlayer_abstract"))
+    msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), "MO", "rootlayer_abstract", OWS_NOERR, "    <Abstract>%s</Abstract>\n", map->name);
+  else
+    msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), "MO", "abstract", OWS_NOERR, "    <Abstract>%s</Abstract>\n", map->name);
+
+
+  if (msOWSLookupMetadata(&(map->web.metadata), "MO", "rootlayer_keywordlist"))
+    pszTmp = strdup("rootlayer_keywordlist");
+   else
+    pszTmp = strdup("keywordlist");
+
+  if (nVersion == OWS_1_0_0)
+  {
+     /* <Keywords> in V 1.0.0 */
+     /* The 1.0.0 spec doesn't specify which delimiter to use so let's use spaces */
+     msOWSPrintEncodeMetadataList(stdout, &(map->web.metadata), "MO",
+                                  pszTmp,
+                                  "    <Keywords>",
+                                  "    </Keywords>\n",
+                                  "%s ", NULL);
+  }
+  else
+  {
+     /* <KeywordList><Keyword> ... in V1.0.6+ */
+     msOWSPrintEncodeMetadataList(stdout, &(map->web.metadata), "MO",
+                                  pszTmp,
+                                  "    <KeywordList>\n",
+                                  "    </KeywordList>\n",
+                                  "     <Keyword>%s</Keyword>\n", NULL);
+  }
+
+  msFree(pszTmp);
+
   /* According to normative comments in the 1.0.7 DTD, the root layer's SRS tag */
   /* is REQUIRED.  It also suggests that we use an empty SRS element if there */
   /* is no common SRS. */

Modified: trunk/msautotest/wxs/expected/wms_cap.xml
===================================================================
--- trunk/msautotest/wxs/expected/wms_cap.xml	2009-09-14 21:20:29 UTC (rev 9299)
+++ trunk/msautotest/wxs/expected/wms_cap.xml	2009-09-14 22:12:42 UTC (rev 9300)
@@ -116,7 +116,12 @@
   <UserDefinedSymbolization SupportSLD="1" UserLayer="0" UserStyle="1" RemoteWFS="0"/>
   <Layer>
     <Name>WMS_TEST</Name>
-    <Title>Test simple wms</Title>
+    <Title>My Layers</Title>
+    <Abstract>These are my layers</Abstract>
+    <KeywordList>
+     <Keyword>layers</Keyword>
+     <Keyword>list</Keyword>
+    </KeywordList>
     <SRS>EPSG:42304</SRS>
     <SRS>EPSG:42101</SRS>
     <SRS>EPSG:4269</SRS>

Modified: trunk/msautotest/wxs/expected/wms_cap130.xml
===================================================================
--- trunk/msautotest/wxs/expected/wms_cap130.xml	2009-09-14 21:20:29 UTC (rev 9299)
+++ trunk/msautotest/wxs/expected/wms_cap130.xml	2009-09-14 22:12:42 UTC (rev 9300)
@@ -112,7 +112,12 @@
   <sld:UserDefinedSymbolization SupportSLD="1" UserLayer="0" UserStyle="1" RemoteWFS="0" InlineFeature="0" RemoteWCS="0"/>
   <Layer>
     <Name>WMS_TEST</Name>
-    <Title>Test simple wms</Title>
+    <Title>My Layers</Title>
+    <Abstract>These are my layers</Abstract>
+    <KeywordList>
+     <Keyword>layers</Keyword>
+     <Keyword>list</Keyword>
+    </KeywordList>
     <CRS>EPSG:42304</CRS>
     <CRS>EPSG:42101</CRS>
     <CRS>EPSG:4269</CRS>

Modified: trunk/msautotest/wxs/expected/wms_caps_updatesequence.xml
===================================================================
--- trunk/msautotest/wxs/expected/wms_caps_updatesequence.xml	2009-09-14 21:20:29 UTC (rev 9299)
+++ trunk/msautotest/wxs/expected/wms_caps_updatesequence.xml	2009-09-14 22:12:42 UTC (rev 9300)
@@ -116,7 +116,12 @@
   <UserDefinedSymbolization SupportSLD="1" UserLayer="0" UserStyle="1" RemoteWFS="0"/>
   <Layer>
     <Name>WMS_TEST</Name>
-    <Title>Test simple wms</Title>
+    <Title>My Layers</Title>
+    <Abstract>These are my layers</Abstract>
+    <KeywordList>
+     <Keyword>layers</Keyword>
+     <Keyword>list</Keyword>
+    </KeywordList>
     <SRS>EPSG:42304</SRS>
     <SRS>EPSG:42101</SRS>
     <SRS>EPSG:4269</SRS>

Modified: trunk/msautotest/wxs/wms_simple.map
===================================================================
--- trunk/msautotest/wxs/wms_simple.map	2009-09-14 21:20:29 UTC (rev 9299)
+++ trunk/msautotest/wxs/wms_simple.map	2009-09-14 22:12:42 UTC (rev 9300)
@@ -105,6 +105,10 @@
     "ows_contactperson" "Tom Kralidis"
     "ows_contactorganization" "MapServer"
     "ows_contactposition" "self"
+
+    "ows_rootlayer_title" "My Layers"
+    "ows_rootlayer_abstract" "These are my layers"
+    "ows_rootlayer_keywordlist" "layers,list"
   END
 END
 



More information about the mapserver-commits mailing list