[mapserver-commits] r13207 - in sandbox/inspire_soc2011: mapserver
msautotest/wxs
svn at osgeo.org
svn at osgeo.org
Wed Mar 7 06:52:10 EST 2012
Author: schpidi
Date: 2012-03-07 03:52:10 -0800 (Wed, 07 Mar 2012)
New Revision: 13207
Modified:
sandbox/inspire_soc2011/mapserver/mapows.c
sandbox/inspire_soc2011/mapserver/mapows.h
sandbox/inspire_soc2011/mapserver/mapwms.c
sandbox/inspire_soc2011/msautotest/wxs/wms_inspire.map
sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario1.map
sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario2.map
Log:
Updating metadata name from inspire_languages to languages in inspire sandbox.
Modified: sandbox/inspire_soc2011/mapserver/mapows.c
===================================================================
--- sandbox/inspire_soc2011/mapserver/mapows.c 2012-03-06 21:15:39 UTC (rev 13206)
+++ sandbox/inspire_soc2011/mapserver/mapows.c 2012-03-07 11:52:10 UTC (rev 13207)
@@ -995,62 +995,53 @@
return language;
}
-/* msOWSGetInspireLanguageList
+/* msOWSGetLanguageList
**
-** Returns the list of INSPIRE languages that this service supports
+** Returns the list of languages that this service supports
**
-** Use value of "inspire_languages" metadata (comma-separated list),
-** or NULL if not set
+** Use value of "languages" metadata (comma-separated list), or NULL if not set
**
** Returns a malloced char** of length numitems which must be freed
** by the caller, or NULL (with numitems = 0)
*/
-char **msOWSGetInspireLanguageList(mapObj *map, const char *namespaces, int *numitems) {
+char **msOWSGetLanguageList(mapObj *map, const char *namespaces, int *numitems) {
- const char *inspire_languages = NULL;
+ const char *languages = NULL;
- if (!msOWSLookupMetadata(&(map->web.metadata), "MO", "inspire_capabilities")) {
- *numitems = 0;
- return NULL;
- }
-
- inspire_languages = msOWSLookupMetadata(&(map->web.metadata), namespaces, "inspire_languages");
- if (inspire_languages && strlen(inspire_languages) > 0) {
- return msStringSplit(inspire_languages, ',', numitems);
+ languages = msOWSLookupMetadata(&(map->web.metadata), namespaces, "languages");
+ if (languages && strlen(languages) > 0) {
+ return msStringSplit(languages, ',', numitems);
} else {
*numitems = 0;
return NULL;
}
}
-/* msOWSGetInspireLanguage
+/* msOWSGetLanguageFromList
**
-** Returns an INSPIRE languae according to the language requested
-** by the client
+** Returns a language according to the language requested by the client
**
-** If the requested language is in the inspire_languages metadata then
-** use it, otherwise ignore the request and use the defaul language,
-** which is the first entry the metadata list. Calling
-** with a NULL requested_langauge therefore returns this default language.
+** If the requested language is in the languages metadata then use it,
+** otherwise ignore it and use the defaul language, which is the first entry in
+** the languages metadata list. Calling with a NULL requested_langauge
+** therefore returns this default language. If the language metadata list is
+** not defined then the language is set to NULL.
**
-** If the metadata list is not defined then we assume that this is a
-** non-INSPIRE service and the language is therefore NULL
-**
** Returns a malloced char* which must be freed by the caller, or NULL
*/
-char *msOWSGetInspireLanguage(mapObj *map, const char *namespaces, const char *requested_language) {
+char *msOWSGetLanguageFromList(mapObj *map, const char *namespaces, const char *requested_language) {
int num_items = 0;
- char **inspire_languages = msOWSGetInspireLanguageList(map, namespaces, &num_items);
+ char **languages = msOWSGetLanguageList(map, namespaces, &num_items);
char *language = NULL;
- if( inspire_languages && num_items > 0 ) {
- if ( !requested_language || !msStringInArray( requested_language, inspire_languages, num_items) ) {
- language = msStrdup(inspire_languages[0]);
+ if( languages && num_items > 0 ) {
+ if ( !requested_language || !msStringInArray( requested_language, languages, num_items) ) {
+ language = msStrdup(languages[0]);
} else {
language = msStrdup(requested_language);
}
}
- msFreeCharArray(inspire_languages, num_items);
+ msFreeCharArray(languages, num_items);
return language;
}
@@ -1160,7 +1151,7 @@
char *buffer = NULL; /* temp variable for malloced strings that will need freeing */
int status = MS_NOERR;
- char *default_language = msOWSGetInspireLanguage(map, namespaces, NULL);
+ char *default_language = msOWSGetLanguageFromList(map, namespaces, NULL);
if(validated_language && default_language)
{
@@ -1169,7 +1160,7 @@
"</inspire_common:Language></inspire_common:DefaultLanguage>\n",
buffer = msEncodeHTMLEntities(default_language));
msFree(buffer);
- msOWSPrintEncodeMetadataList(stream, &(map->web.metadata), namespaces, "inspire_languages", NULL, NULL,
+ msOWSPrintEncodeMetadataList(stream, &(map->web.metadata), namespaces, "languages", NULL, NULL,
" <inspire_common:SupportedLanguage><inspire_common:Language>%s"
"</inspire_common:Language></inspire_common:SupportedLanguage>\n", msStringConcatenate(default_language, "_exclude"));
msIO_fprintf(stream, " </inspire_common:SupportedLanguages>\n");
@@ -1178,7 +1169,7 @@
} else {
status = action_if_not_found;
if (OWS_WARN == action_if_not_found) {
- msIO_fprintf(stream, "<!-- WARNING: Mandatory metadata '%s%s' was missing in this context. -->\n", (namespaces?"..._":""), "inspire_languages");
+ msIO_fprintf(stream, "<!-- WARNING: Mandatory metadata '%s%s' was missing in this context. -->\n", (namespaces?"..._":""), "languages");
}
}
Modified: sandbox/inspire_soc2011/mapserver/mapows.h
===================================================================
--- sandbox/inspire_soc2011/mapserver/mapows.h 2012-03-06 21:15:39 UTC (rev 13206)
+++ sandbox/inspire_soc2011/mapserver/mapows.h 2012-03-07 11:52:10 UTC (rev 13207)
@@ -163,8 +163,8 @@
MS_DLL_EXPORT char *msOWSGetOnlineResource2(mapObj *map, const char *namespaces, const char *metadata_name, cgiRequestObj *req, const char *validated_language);
MS_DLL_EXPORT const char *msOWSGetSchemasLocation(mapObj *map);
MS_DLL_EXPORT const char *msOWSGetLanguage(mapObj *map, const char *context);
-MS_DLL_EXPORT char **msOWSGetInspireLanguageList(mapObj *map, const char *namespaces, int *numitems);
-MS_DLL_EXPORT char *msOWSGetInspireLanguage(mapObj *map, const char *namespaces, const char *requested_language);
+MS_DLL_EXPORT char **msOWSGetLanguageList(mapObj *map, const char *namespaces, int *numitems);
+MS_DLL_EXPORT char *msOWSGetLanguageFromList(mapObj *map, const char *namespaces, const char *requested_language);
/* OWS_NOERR and OWS_WARN passed as action_if_not_found to printMetadata() */
Modified: sandbox/inspire_soc2011/mapserver/mapwms.c
===================================================================
--- sandbox/inspire_soc2011/mapserver/mapwms.c 2012-03-06 21:15:39 UTC (rev 13206)
+++ sandbox/inspire_soc2011/mapserver/mapwms.c 2012-03-07 11:52:10 UTC (rev 13207)
@@ -3026,7 +3026,7 @@
nVersion = OWS_1_3_0;
/* This function owns validated_language, so remember to free it later*/
- validated_language = msOWSGetInspireLanguage(map, "MO", requested_language);
+ validated_language = msOWSGetLanguageFromList(map, "MO", requested_language);
if (validated_language != NULL)
{
@@ -5427,7 +5427,7 @@
}
/* This function owns validated_language, so remember to free it later*/
- validated_language = msOWSGetInspireLanguage(map, "MO", language);
+ validated_language = msOWSGetLanguageFromList(map, "MO", language);
if (validated_language != NULL)
{
for(i=0; i<map->numlayers; i++)
Modified: sandbox/inspire_soc2011/msautotest/wxs/wms_inspire.map
===================================================================
--- sandbox/inspire_soc2011/msautotest/wxs/wms_inspire.map 2012-03-06 21:15:39 UTC (rev 13206)
+++ sandbox/inspire_soc2011/msautotest/wxs/wms_inspire.map 2012-03-07 11:52:10 UTC (rev 13207)
@@ -149,7 +149,7 @@
METADATA
"wms_inspire_capabilities" "url" #enables inspire using scenario 1
- "wms_inspire_languages" "ger,eng" #first default, values according ISO 639-2/B
+ "wms_languages" "ger,eng" #first default, values according ISO 639-2/B
"wms_inspire_metadataurl_href" "http://www.geodaten-mv.de/soapServices/CSWStartup?service=CSW&version=2.0.2&request=GetRecordById&outputSchema=http://www.isotc211.org/2005/gmd&ElementSetName=full&Id=4d5f1402-5b2b-43ec-949f-92d125179318"
"wms_inspire_metadataurl_format" "application/vnd.ogc.csw.capabilities.response_xml"
"wms_keywordlist_ISO_items" "infoMapAccessService" #value according "classification of spatial data services"
Modified: sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario1.map
===================================================================
--- sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario1.map 2012-03-06 21:15:39 UTC (rev 13206)
+++ sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario1.map 2012-03-07 11:52:10 UTC (rev 13207)
@@ -71,7 +71,7 @@
METADATA
"wms_inspire_capabilities" "url" #enables inspire using scenario 1
- "wms_inspire_languages" "eng,ger" #first default, values according ISO 639-2/B
+ "wms_languages" "eng,ger" #first default, values according ISO 639-2/B
"wms_inspire_metadataurl_href" "http://inspire.service/metadata"
"wms_inspire_metadataurl_format" "application/vnd.ogc.csw.capabilities.response_xml"
"wms_keywordlist_ISO_items" "infoMapAccessService" #value according "classification of spatial data services"
Modified: sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario2.map
===================================================================
--- sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario2.map 2012-03-06 21:15:39 UTC (rev 13206)
+++ sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario2.map 2012-03-07 11:52:10 UTC (rev 13207)
@@ -71,7 +71,7 @@
METADATA
"wms_inspire_capabilities" "embed" #enables inspire using scenario 2
- "wms_inspire_languages" "eng,ger" #first default, values according ISO 639-2/B
+ "wms_languages" "eng,ger" #first default, values according ISO 639-2/B
"wms_inspire_temporal_reference" "2011-09-19" #date of last revision, value according YYYY-MM-DD
"wms_inspire_mpoc_name" "mympocname" #point of contact
"wms_inspire_mpoc_email" "mympoc at e.mail" #point of contact
More information about the mapserver-commits
mailing list