[mapserver-commits] r11939 - sandbox/inspire_soc2011/mapserver
svn at osgeo.org
svn at osgeo.org
Fri Jul 15 01:45:32 EDT 2011
Author: stefanl
Date: 2011-07-14 22:45:32 -0700 (Thu, 14 Jul 2011)
New Revision: 11939
Modified:
sandbox/inspire_soc2011/mapserver/mapows.c
sandbox/inspire_soc2011/mapserver/mapows.h
sandbox/inspire_soc2011/mapserver/mapwms.c
Log:
inspire view service metadata support (scenario1+2)
Modified: sandbox/inspire_soc2011/mapserver/mapows.c
===================================================================
--- sandbox/inspire_soc2011/mapserver/mapows.c 2011-07-14 14:00:50 UTC (rev 11938)
+++ sandbox/inspire_soc2011/mapserver/mapows.c 2011-07-15 05:45:32 UTC (rev 11939)
@@ -1085,13 +1085,13 @@
const char *namespaces, const char *name,
int action_if_not_found,
const char *format, const char *default_value,
- const char *language)
+ const char *validated_language)
{
const char *value;
char * pszEncodedValue=NULL;
int status = MS_NOERR;
- if((value = msOWSLookupMetadataWithLanguage(metadata, namespaces, name, language)))
+ if((value = msOWSLookupMetadataWithLanguage(metadata, namespaces, name, validated_language)))
{
pszEncodedValue = msEncodeHTMLEntities(value);
msIO_fprintf(stream, format, pszEncodedValue);
@@ -1101,7 +1101,7 @@
{
if (action_if_not_found == OWS_WARN)
{
- msIO_fprintf(stream, "<!-- WARNING: Mandatory metadata '%s%s%s%s' was missing in this context. -->\n", (namespaces?"..._":""), name, (language?"_":""), (language?language:""));
+ msIO_fprintf(stream, "<!-- WARNING: Mandatory metadata '%s%s%s%s' was missing in this context. -->\n", (namespaces?"..._":""), name, (validated_language?"_":""), (validated_language?validated_language:""));
status = action_if_not_found;
}
@@ -1192,11 +1192,25 @@
** If a default value is provided and metadata is absent then the
** default will be used.
*/
+int msOWSPrintGroupMetadata(FILE *stream, mapObj *map, char* pszGroupName,
+ const char *namespaces, const char *name,
+ int action_if_not_found,
+ const char *format, const char *default_value)
+{
+ return msOWSPrintGroupMetadata2(stream, map, pszGroupName, namespaces, name, action_if_not_found, format, default_value, NULL);
+}
-int msOWSPrintGroupMetadata(FILE *stream, mapObj *map, char* pszGroupName,
+/*
+** msOWSPrintGroupMetadata2()
+**
+** Attempt to output a capability item in the requested language.
+** Fallback using no language parameter.
+*/
+int msOWSPrintGroupMetadata2(FILE *stream, mapObj *map, char* pszGroupName,
const char *namespaces, const char *name,
int action_if_not_found,
- const char *format, const char *default_value)
+ const char *format, const char *default_value,
+ const char *validated_language)
{
const char *value;
char *encoded;
@@ -1207,7 +1221,7 @@
{
if (GET_LAYER(map, i)->group && (strcmp(GET_LAYER(map, i)->group, pszGroupName) == 0) && &(GET_LAYER(map, i)->metadata))
{
- if((value = msOWSLookupMetadata(&(GET_LAYER(map, i)->metadata), namespaces, name)))
+ if((value = msOWSLookupMetadataWithLanguage(&(GET_LAYER(map, i)->metadata), namespaces, name, validated_language)))
{
encoded = msEncodeHTMLEntities(value);
msIO_fprintf(stream, format, encoded);
Modified: sandbox/inspire_soc2011/mapserver/mapows.h
===================================================================
--- sandbox/inspire_soc2011/mapserver/mapows.h 2011-07-14 14:00:50 UTC (rev 11938)
+++ sandbox/inspire_soc2011/mapserver/mapows.h 2011-07-15 05:45:32 UTC (rev 11939)
@@ -205,6 +205,11 @@
const char *namespaces, const char *name,
int action_if_not_found,
const char *format, const char *default_value);
+int msOWSPrintGroupMetadata2(FILE *stream, mapObj *map, char* pszGroupName,
+ const char *namespaces, const char *name,
+ int action_if_not_found,
+ const char *format, const char *default_value,
+ const char *validated_language);
int msOWSPrintURLType(FILE *stream, hashTableObj *metadata,
const char *namespaces, const char *name,
int action_if_not_found, const char *tag_format,
Modified: sandbox/inspire_soc2011/mapserver/mapwms.c
===================================================================
--- sandbox/inspire_soc2011/mapserver/mapwms.c 2011-07-14 14:00:50 UTC (rev 11938)
+++ sandbox/inspire_soc2011/mapserver/mapwms.c 2011-07-15 05:45:32 UTC (rev 11939)
@@ -2731,12 +2731,12 @@
lp->group);
msOWSPrintEncodeParam(stdout, "GROUP.NAME", lp->group,
OWS_NOERR, " <Name>%s</Name>\n", NULL);
- msOWSPrintGroupMetadata(stdout, map, lp->group,
+ msOWSPrintGroupMetadata2(stdout, map, lp->group,
"MO", "GROUP_TITLE", OWS_WARN,
- " <Title>%s</Title>\n", lp->group);
- msOWSPrintGroupMetadata(stdout, map, lp->group,
+ " <Title>%s</Title>\n", lp->group, validated_language);
+ msOWSPrintGroupMetadata2(stdout, map, lp->group,
"MO", "GROUP_ABSTRACT", OWS_NOERR,
- " <Abstract>%s</Abstract>\n", lp->group);
+ " <Abstract>%s</Abstract>\n", lp->group, validated_language);
/*build a getlegendgraphicurl*/
if( script_url_encoded)
More information about the mapserver-commits
mailing list