[mapserver-commits] r7344 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Sun Feb 3 14:33:08 EST 2008
Author: tomkralidis
Date: 2008-02-03 14:33:08 -0500 (Sun, 03 Feb 2008)
New Revision: 7344
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/mapogcsos.c
trunk/mapserver/mapwcs.c
trunk/mapserver/mapwcs11.c
trunk/mapserver/mapwfs.c
trunk/mapserver/mapwms.c
Log:
output updateSequence if set (#2384)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2008-02-03 15:17:17 UTC (rev 7343)
+++ trunk/mapserver/HISTORY.TXT 2008-02-03 19:33:08 UTC (rev 7344)
@@ -13,6 +13,8 @@
Current Version (5.1-dev, SVN trunk):
-------------------------------------
+- OWS: output Capabilities XML updateSequence if set (#2384)
+
- mapwcs.c: better handling of REQUEST parameter (#2490)
- mapwcs.c: point to correct exception schema (#2481)
Modified: trunk/mapserver/mapogcsos.c
===================================================================
--- trunk/mapserver/mapogcsos.c 2008-02-03 15:17:17 UTC (rev 7343)
+++ trunk/mapserver/mapogcsos.c 2008-02-03 19:33:08 UTC (rev 7344)
@@ -1145,7 +1145,7 @@
/* */
/* getCapabilities request handler. */
/************************************************************************/
-int msSOSGetCapabilities(mapObj *map, char *pszVersion, cgiRequestObj *req) {
+int msSOSGetCapabilities(mapObj *map, sosParamsObj *sosparams, cgiRequestObj *req) {
xmlDocPtr psDoc = NULL; /* document pointer */
xmlNodePtr psRootNode, psMainNode, psNode;
xmlNodePtr psOfferingNode;
@@ -1222,8 +1222,11 @@
/*version fixed for now*/
xmlNewProp(psRootNode, BAD_CAST "version", BAD_CAST pszSOSVersion);
- //xmlNewProp(psRootNode, BAD_CAST "updateSequence", BAD_CAST "1234567890");
+ value = msOWSLookupMetadata(&(map->web.metadata), "SO", "updatesequence");
+ if (value)
+ xmlNewProp(psRootNode, BAD_CAST "updateSequence", BAD_CAST value);
+
/*schema fixed*/
schemalocation = msEncodeHTMLEntities( msOWSGetSchemasLocation(map) );
xsi_schemaLocation = strdup(pszSOSNamespaceUri);
@@ -2489,7 +2492,7 @@
}
if (strcasecmp(paramsObj->pszRequest, "GetCapabilities") == 0) {
- returnvalue = msSOSGetCapabilities(map, paramsObj->pszVersion, req);
+ returnvalue = msSOSGetCapabilities(map, paramsObj, req);
msSOSFreeParamsObj(paramsObj);
free(paramsObj);
paramsObj = NULL;
Modified: trunk/mapserver/mapwcs.c
===================================================================
--- trunk/mapserver/mapwcs.c 2008-02-03 15:17:17 UTC (rev 7343)
+++ trunk/mapserver/mapwcs.c 2008-02-03 19:33:08 UTC (rev 7344)
@@ -703,6 +703,7 @@
int tmpInt = 0;
int wcsSupportedVersions[] = {OWS_1_1_1, OWS_1_1_0, OWS_1_0_0};
int wcsNumSupportedVersions = 3;
+ const char *updatesequence=NULL;
/* if version is not passed/set, set it to 1.1.1, this will trigger
msOWSNegotiateVersion to handle accordingly
@@ -742,16 +743,21 @@
/* print common capability elements */
/* TODO: DocType? */
+ updatesequence = msOWSLookupMetadata(&(map->web.metadata), "CO", "updatesequence");
+
+ if (!updatesequence)
+ updatesequence = strdup("0");
+
msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), NULL, "wcs_encoding", OWS_NOERR, "<?xml version='1.0' encoding=\"%s\" standalone=\"no\" ?>\n", "ISO-8859-1");
if(!params->section || (params->section && strcasecmp(params->section, "/") == 0)) msIO_printf("<WCS_Capabilities\n"
" version=\"%s\" \n"
- " updateSequence=\"0\" \n"
+ " updateSequence=\"%s\" \n"
" xmlns=\"http://www.opengis.net/wcs\" \n"
" xmlns:xlink=\"http://www.w3.org/1999/xlink\" \n"
" xmlns:gml=\"http://www.opengis.net/gml\" \n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
- " xsi:schemaLocation=\"http://www.opengis.net/wcs %s/wcs/%s/wcsCapabilities.xsd\">\n", params->version, msOWSGetSchemasLocation(map), params->version);
+ " xsi:schemaLocation=\"http://www.opengis.net/wcs %s/wcs/%s/wcsCapabilities.xsd\">\n", params->version, updatesequence, msOWSGetSchemasLocation(map), params->version);
/* print the various capability sections */
if(!params->section || strcasecmp(params->section, "/WCS_Capabilities/Service") == 0)
Modified: trunk/mapserver/mapwcs11.c
===================================================================
--- trunk/mapserver/mapwcs11.c 2008-02-03 15:17:17 UTC (rev 7343)
+++ trunk/mapserver/mapwcs11.c 2008-02-03 19:33:08 UTC (rev 7344)
@@ -304,6 +304,7 @@
xmlNodePtr psRootNode, psMainNode, psNode;
xmlNodePtr psTmpNode;
char *identifier_list = NULL, *format_list = NULL;
+ const char *updatesequence=NULL;
xmlNsPtr psOwsNs, psXLinkNs;
char *script_url=NULL, *script_url_encoded=NULL;
@@ -354,6 +355,11 @@
xmlNewProp(psRootNode, BAD_CAST "version", BAD_CAST params->version );
+ updatesequence = msOWSLookupMetadata(&(map->web.metadata), "CO", "updatesequence");
+
+ if (updatesequence)
+ xmlNewProp(psRootNode, BAD_CAST "updateSequence", BAD_CAST updatesequence);
+
/* -------------------------------------------------------------------- */
/* Service metadata. */
/* -------------------------------------------------------------------- */
Modified: trunk/mapserver/mapwfs.c
===================================================================
--- trunk/mapserver/mapwfs.c 2008-02-03 15:17:17 UTC (rev 7343)
+++ trunk/mapserver/mapwfs.c 2008-02-03 19:33:08 UTC (rev 7344)
@@ -288,6 +288,7 @@
int msWFSGetCapabilities(mapObj *map, const char *wmtver, cgiRequestObj *req)
{
char *script_url=NULL, *script_url_encoded;
+ const char *updatesequence=NULL;
int i;
/* Decide which version we're going to return... only 1.0.0 for now */
@@ -300,6 +301,12 @@
return msWFSException(map, wmtver);
}
+ updatesequence = msOWSLookupMetadata(&(map->web.metadata), "FO", "updatesequence");
+
+ if (!updatesequence)
+ updatesequence = strdup("0");
+
+
msIO_printf("Content-type: text/xml%c%c",10,10);
msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), "FO", "encoding", OWS_NOERR,
@@ -308,12 +315,12 @@
msIO_printf("<WFS_Capabilities \n"
" version=\"%s\" \n"
- " updateSequence=\"0\" \n"
+ " updateSequence=\"%s\" \n"
" xmlns=\"http://www.opengis.net/wfs\" \n"
" xmlns:ogc=\"http://www.opengis.net/ogc\" \n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
" xsi:schemaLocation=\"http://www.opengis.net/wfs %s/wfs/%s/WFS-capabilities.xsd\">\n",
- wmtver,
+ wmtver, updatesequence,
msOWSGetSchemasLocation(map), wmtver);
/* Report MapServer Version Information */
Modified: trunk/mapserver/mapwms.c
===================================================================
--- trunk/mapserver/mapwms.c 2008-02-03 15:17:17 UTC (rev 7343)
+++ trunk/mapserver/mapwms.c 2008-02-03 19:33:08 UTC (rev 7344)
@@ -1602,6 +1602,7 @@
const char *pszMimeType=NULL;
char szVersionBuf[OWS_VERSION_MAXLEN];
char *schemalocation = NULL;
+ const char *updatesequence=NULL;
schemalocation = msEncodeHTMLEntities( msOWSGetSchemasLocation(map) );
@@ -1662,9 +1663,16 @@
msIO_printf(" ]> <!-- end of DOCTYPE declaration -->\n\n");
- msIO_printf("<WMT_MS_Capabilities version=\"%s\">\n",
+ msIO_printf("<WMT_MS_Capabilities version=\"%s\"",
msOWSGetVersionString(nVersion, szVersionBuf));
+ updatesequence = msOWSLookupMetadata(&(map->web.metadata), "MO", "updatesequence");
+
+ if (updatesequence)
+ msIO_printf(" updateSequence=\"%s\"",updatesequence);
+
+ msIO_printf(">\n",updatesequence);
+
/* Report MapServer Version Information */
msIO_printf("\n<!-- %s -->\n\n", msGetVersion());
More information about the mapserver-commits
mailing list