[mapserver-dev] default values when using url overloading

Steve Lime Steve.Lime at dnr.state.mn.us
Sun Aug 2 10:00:07 EDT 2009


Yeah, that would work, great suggestion. Feel free to add. I'd rather have multiple people
work on code sections anyway. More eyes the better!

Steve

>>> Thomas Bonfort <thomas.bonfort at camptocamp.com> 08/01/09 3:21 AM >>>
looking at the code, it seems like we could loop through metadata
%key%_default_value entries to replace the value after having
processed the url key/values, thus populating the strings with a
default value if the entry was not found in the url.

does this seem reasonable? if so I can take this, unless if Steve
wants to keep the hand on that part of the code.

cheers,

thomas

www.camptocamp.com
+33 4 79 26 57 97



On Wed, Jul 29, 2009 at 18:38, Steve Lime<Steve.Lime at dnr.state.mn.us> wrote:
> Problem is that it's the presence of a parameter in the URL that causes the code to
> check if something needs overloaded. So, for each url variable 'key' we look for %key%
> in supported places and also apply validation (if supplied).
>
> To do this we'd need to be able to define a list of supported keys and work through
> that instead of the entire list passed as part of a request. With that it would be easy
> to define a default somehow, likely through metadata.
>
> Steve
>
>>>> On 7/29/2009 at 10:52 AM, in message <4A70705A.2090403 at mapgears.com>, Daniel
> Morissette <dmorissette at mapgears.com> wrote:
>> Thomas Bonfort wrote:
>>>
>>> I very often use url overloading with the %key% syntax in my mapfile
>>> as I find it's a powerful means of building custom maps. The problem
>>> with the current implementation is that the mapfile more often than
>>> less becomes unparsable if the url doesn't contain the key=value
>>> parameter.
>>>
>>> Would it be complicated to modify the parser so that the mapfile can
>>> contain a default value for %key%, that would be applied if the url
>>> does not contain the "key" parameter?
>>>
>>
>> I have encountered that problem as well and think this would be a
>> valuable addition.
>>
>> Perhaps it could be as simple as looking up the %key% value in metadata
>> if it is not present in the URL?
>>
>> Daniel
>> --
>> Daniel Morissette
>> http://www.mapgears.com/
>> _______________________________________________
>> mapserver-dev mailing list
>> mapserver-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>
_______________________________________________
mapserver-dev mailing list
mapserver-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-dev



More information about the mapserver-dev mailing list