[mapserver-commits] r7804 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Jul 9 07:27:53 EDT 2008


Author: tomkralidis
Date: 2008-07-09 07:27:53 -0400 (Wed, 09 Jul 2008)
New Revision: 7804

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapogcsos.c
   trunk/mapserver/mapowscommon.c
   trunk/mapserver/mapowscommon.h
   trunk/mapserver/mapwcs11.c
   trunk/mapserver/mapwfs11.c
Log:
fix support for multiple namespaces (#2690)


Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-07-09 05:17:40 UTC (rev 7803)
+++ trunk/mapserver/HISTORY.TXT	2008-07-09 11:27:53 UTC (rev 7804)
@@ -13,6 +13,8 @@
 Current Version (SVN Trunk):
 ----------------------------
 
+- mapowscommon.c: fix support multiple namespaces (#2690)
+
 - Fix OGC simple filters on SDE layers (#2685)
 
 - wfs11 getcapabilities: correct memory corruption (#2686)

Modified: trunk/mapserver/mapogcsos.c
===================================================================
--- trunk/mapserver/mapogcsos.c	2008-07-09 05:17:40 UTC (rev 7803)
+++ trunk/mapserver/mapogcsos.c	2008-07-09 11:27:53 UTC (rev 7804)
@@ -1287,10 +1287,10 @@
     psTmpNode = xmlAddChild(psRootNode, xmlNewComment(BAD_CAST msGetVersion()));
 
     /*service identification*/
-    psTmpNode = xmlAddChild(psRootNode, msOWSCommonServiceIdentification(psNsOws, map, "SOS", pszSOSVersion));
+    psTmpNode = xmlAddChild(psRootNode, msOWSCommonServiceIdentification(psNsOws, map, "SOS", pszSOSVersion, "SO"));
 
     /*service provider*/
-    psTmpNode = xmlAddChild(psRootNode, msOWSCommonServiceProvider(psNsOws, psNsXLink, map));
+    psTmpNode = xmlAddChild(psRootNode, msOWSCommonServiceProvider(psNsOws, psNsXLink, map, "SO"));
 
     /*operation metadata */
 

Modified: trunk/mapserver/mapowscommon.c
===================================================================
--- trunk/mapserver/mapowscommon.c	2008-07-09 05:17:40 UTC (rev 7803)
+++ trunk/mapserver/mapowscommon.c	2008-07-09 11:27:53 UTC (rev 7804)
@@ -91,7 +91,7 @@
  *
  */
 
-xmlNodePtr msOWSCommonServiceIdentification(xmlNsPtr psNsOws, mapObj *map, const char *servicetype, const char *version) {
+xmlNodePtr msOWSCommonServiceIdentification(xmlNsPtr psNsOws, mapObj *map, const char *servicetype, const char *version, const char *namespaces) {
   const char *value    = NULL;
 
   xmlNodePtr   psRootNode = NULL;
@@ -106,7 +106,7 @@
 
   /* add child elements */
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "title");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "title");
 
   psNode = xmlNewChild(psRootNode, psNsOws, BAD_CAST "Title", BAD_CAST value);
 
@@ -114,7 +114,7 @@
     xmlAddSibling(psNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"ows_title\" missing for ows:Title"));
   }
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "abstract");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "abstract");
 
   psNode = xmlNewChild(psRootNode, psNsOws, BAD_CAST "Abstract", BAD_CAST value);
 
@@ -122,7 +122,7 @@
     xmlAddSibling(psNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"ows_abstract\" was missing for ows:Abstract"));
   }
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "keywordlist");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "keywordlist");
 
   if (value) {
     char **tokens = NULL;
@@ -151,7 +151,7 @@
 
   psNode = xmlNewChild(psRootNode, psNsOws, BAD_CAST "ServiceTypeVersion", BAD_CAST version);
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "fees");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "fees");
 
   psNode = xmlNewChild(psRootNode, psNsOws, BAD_CAST "Fees", BAD_CAST value);
 
@@ -159,7 +159,7 @@
     xmlAddSibling(psNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"ows_fees\" was missing for ows:Fees"));
   }
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "accessconstraints");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "accessconstraints");
 
   psNode = xmlNewChild(psRootNode, psNsOws, BAD_CAST "AccessConstraints", BAD_CAST value);
 
@@ -186,7 +186,7 @@
  */
 
 xmlNodePtr msOWSCommonServiceProvider(xmlNsPtr psNsOws, xmlNsPtr psNsXLink,
-                                      mapObj *map) {
+                                      mapObj *map, const char *namespaces) {
   const char *value = NULL;
 
   xmlNodePtr   psNode          = NULL;
@@ -202,7 +202,7 @@
 
   /* add child elements */
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "contactorganization");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "contactorganization");
 
   psNode = xmlNewChild(psRootNode, psNsOws, BAD_CAST "ProviderName", BAD_CAST value);
 
@@ -214,7 +214,7 @@
 
   xmlNewNsProp(psNode, psNsXLink, BAD_CAST "type", BAD_CAST "simple");
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFSCO", "service_onlineresource");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "service_onlineresource");
 
   xmlNewNsProp(psNode, psNsXLink, BAD_CAST "href", BAD_CAST value);
 
@@ -224,7 +224,7 @@
 
   psNode = xmlNewChild(psRootNode, psNsOws, BAD_CAST "ServiceContact", NULL);
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "contactperson");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "contactperson");
 
   psSubNode = xmlNewChild(psNode, psNsOws, BAD_CAST "IndividualName", BAD_CAST  value);
 
@@ -232,7 +232,7 @@
     xmlAddSibling(psSubNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"ows_contactperson\" was missing for ows:IndividualName"));
   }
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "contactposition");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "contactposition");
 
   psSubNode = xmlNewChild(psNode, psNsOws, BAD_CAST "PositionName", BAD_CAST value); 
 
@@ -244,7 +244,7 @@
 
   psSubSubNode = xmlNewChild(psSubNode, psNsOws, BAD_CAST "Phone", NULL);
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "contactvoicetelephone");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "contactvoicetelephone");
 
   psSubSubSubNode = xmlNewChild(psSubSubNode, psNsOws, BAD_CAST "Voice", BAD_CAST value);
 
@@ -252,7 +252,7 @@
     xmlAddSibling(psSubSubSubNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"ows_contactvoicetelephone\" was missing for ows:Voice"));
   }
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "contactfacsimiletelephone");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "contactfacsimiletelephone");
 
   psSubSubSubNode = xmlNewChild(psSubSubNode, psNsOws, BAD_CAST "Facsimile", BAD_CAST value);
 
@@ -262,7 +262,7 @@
 
   psSubSubNode = xmlNewChild(psSubNode, psNsOws, BAD_CAST "Address", NULL);
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "address");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "address");
 
   psSubSubSubNode = xmlNewChild(psSubSubNode, psNsOws, BAD_CAST "DeliveryPoint", BAD_CAST value);
 
@@ -270,7 +270,7 @@
     xmlAddSibling(psSubSubSubNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"ows_address\" was missing for ows:DeliveryPoint"));
   }
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "city");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "city");
 
   psSubSubSubNode = xmlNewChild(psSubSubNode, psNsOws, BAD_CAST "City", BAD_CAST value);
 
@@ -278,7 +278,7 @@
     xmlAddSibling(psSubSubSubNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"ows_city\" was missing for ows:City"));
   }
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "stateorprovince");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "stateorprovince");
 
   psSubSubSubNode = xmlNewChild(psSubSubNode, psNsOws, BAD_CAST "AdministrativeArea", BAD_CAST value);
 
@@ -286,7 +286,7 @@
     xmlAddSibling(psSubSubSubNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"ows_stateorprovince\" was missing for ows:AdministrativeArea"));
   }
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "postcode");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "postcode");
 
   psSubSubSubNode = xmlNewChild(psSubSubNode, psNsOws, BAD_CAST "PostalCode", BAD_CAST value);
 
@@ -294,7 +294,7 @@
     xmlAddSibling(psSubSubSubNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"ows_postcode\" was missing for ows:PostalCode"));
   }
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "country");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "country");
 
   psSubSubSubNode = xmlNewChild(psSubSubNode, psNsOws, BAD_CAST "Country", BAD_CAST value);
 
@@ -302,7 +302,7 @@
     xmlAddSibling(psSubSubSubNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"ows_country\" was missing for ows:Country"));
   }
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFSCO", "contactelectronicmailaddress");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "contactelectronicmailaddress");
 
   psSubSubSubNode = xmlNewChild(psSubSubNode, psNsOws, BAD_CAST "ElectronicMailAddress", BAD_CAST value);
 
@@ -314,7 +314,7 @@
 
   xmlNewNsProp(psSubSubNode, psNsXLink, BAD_CAST "type", BAD_CAST "simple");
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "service_onlineresource");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "service_onlineresource");
 
   xmlNewNsProp(psSubSubNode, psNsXLink, BAD_CAST "href", BAD_CAST value);
 
@@ -322,7 +322,7 @@
     xmlAddSibling(psSubSubNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"ows_service_onlineresource\" was missing for ows:OnlineResource/@xlink:href"));
   }
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "hoursofservice");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "hoursofservice");
 
   psSubSubNode = xmlNewChild(psSubNode, psNsOws, BAD_CAST "HoursOfService", BAD_CAST value);
 
@@ -330,7 +330,7 @@
     xmlAddSibling(psSubSubNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"ows_hoursofservice\" was missing for ows:HoursOfService"));
   }
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "contactinstructions");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "contactinstructions");
 
   psSubSubNode = xmlNewChild(psSubNode, psNsOws, BAD_CAST "ContactInstructions", BAD_CAST value);
 
@@ -338,7 +338,7 @@
     xmlAddSibling(psSubSubNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"ows_contactinstructions\" was missing for ows:ContactInstructions"));
   }
 
-  value = msOWSLookupMetadata(&(map->web.metadata), "MFCSO", "role");
+  value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "role");
 
   psSubNode = xmlNewChild(psNode, psNsOws, BAD_CAST "Role", BAD_CAST value);
 

Modified: trunk/mapserver/mapowscommon.h
===================================================================
--- trunk/mapserver/mapowscommon.h	2008-07-09 05:17:40 UTC (rev 7803)
+++ trunk/mapserver/mapowscommon.h	2008-07-09 11:27:53 UTC (rev 7804)
@@ -72,9 +72,9 @@
 
 int msOWSCommonNegotiateVersion(int requested_version, int supported_versions[], int num_supported_versions);
 
-xmlNodePtr msOWSCommonServiceIdentification(xmlNsPtr psNsOws, mapObj *map, const char *servicetype, const char *version);
+xmlNodePtr msOWSCommonServiceIdentification(xmlNsPtr psNsOws, mapObj *map, const char *servicetype, const char *version, const char *namespaces);
 
-xmlNodePtr msOWSCommonServiceProvider(xmlNsPtr psNsOws, xmlNsPtr psXLinkNs, mapObj *map);
+xmlNodePtr msOWSCommonServiceProvider(xmlNsPtr psNsOws, xmlNsPtr psXLinkNs, mapObj *map, const char *namespaces);
 
 xmlNodePtr msOWSCommonOperationsMetadata(xmlNsPtr psNsOws);
 

Modified: trunk/mapserver/mapwcs11.c
===================================================================
--- trunk/mapserver/mapwcs11.c	2008-07-09 05:17:40 UTC (rev 7803)
+++ trunk/mapserver/mapwcs11.c	2008-07-09 11:27:53 UTC (rev 7804)
@@ -439,11 +439,11 @@
 /* -------------------------------------------------------------------- */
 
     psTmpNode = xmlAddChild(psRootNode, msOWSCommonServiceIdentification(
-                                psOwsNs, map, "OGC WCS", params->version));
+                                psOwsNs, map, "OGC WCS", params->version, "CO"));
 
     /*service provider*/
     psTmpNode = xmlAddChild(psRootNode, msOWSCommonServiceProvider(
-                                psOwsNs, psXLinkNs, map));
+                                psOwsNs, psXLinkNs, map, "CO"));
 
     /*operation metadata */
     if ((script_url=msOWSGetOnlineResource(map, "COM", "onlineresource", req)) == NULL 

Modified: trunk/mapserver/mapwfs11.c
===================================================================
--- trunk/mapserver/mapwfs11.c	2008-07-09 05:17:40 UTC (rev 7803)
+++ trunk/mapserver/mapwfs11.c	2008-07-09 11:27:53 UTC (rev 7804)
@@ -278,11 +278,11 @@
 /* -------------------------------------------------------------------- */
 
     psTmpNode = xmlAddChild(psRootNode, 
-                            msOWSCommonServiceIdentification(psNsOws, map, "OGC WFS", params->pszVersion));
+                            msOWSCommonServiceIdentification(psNsOws, map, "OGC WFS", params->pszVersion, "FO"));
 
     /*service provider*/
     psTmpNode = xmlAddChild(psRootNode, msOWSCommonServiceProvider(
-                                psNsOws, psNsXLink, map));
+                                psNsOws, psNsXLink, map, "FO"));
 
     /*operation metadata */
     if ((script_url=msOWSGetOnlineResource(map, "FO", "onlineresource", req)) == NULL 



More information about the mapserver-commits mailing list