I've committed the changes to the code and documentation to support these default values.<br>I've also added this support to shp2img, so that mapfiles with these default values can be tested from the command line.<br>
in order to use strncmp rather than strstr, the metadata keyword for these parameters is<br><br>'default_keyword' 'value'<br><br>to get the default value of %keyword%<br><br>let me know if problems arise from these changes.<br>
<br>regards,<br><br>thomas<br><br clear="all"><a href="http://www.camptocamp.com">www.camptocamp.com</a><br>+33 5 16 57 01 02<br>
<br><br><div class="gmail_quote">On Sun, Aug 2, 2009 at 16:00, Steve Lime <span dir="ltr"><<a href="mailto:Steve.Lime@dnr.state.mn.us">Steve.Lime@dnr.state.mn.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yeah, that would work, great suggestion. Feel free to add. I'd rather have multiple people<br>
work on code sections anyway. More eyes the better!<br>
<br>
Steve<br>
<br>
>>> Thomas Bonfort <<a href="mailto:thomas.bonfort@camptocamp.com">thomas.bonfort@camptocamp.com</a>> 08/01/09 3:21 AM >>><br>
<div><div></div><div class="h5">looking at the code, it seems like we could loop through metadata<br>
%key%_default_value entries to replace the value after having<br>
processed the url key/values, thus populating the strings with a<br>
default value if the entry was not found in the url.<br>
<br>
does this seem reasonable? if so I can take this, unless if Steve<br>
wants to keep the hand on that part of the code.<br>
<br>
cheers,<br>
<br>
thomas<br>
<br>
<a href="http://www.camptocamp.com" target="_blank">www.camptocamp.com</a><br>
+33 4 79 26 57 97<br>
<br>
<br>
<br>
On Wed, Jul 29, 2009 at 18:38, Steve Lime<<a href="mailto:Steve.Lime@dnr.state.mn.us">Steve.Lime@dnr.state.mn.us</a>> wrote:<br>
> Problem is that it's the presence of a parameter in the URL that causes the code to<br>
> check if something needs overloaded. So, for each url variable 'key' we look for %key%<br>
> in supported places and also apply validation (if supplied).<br>
><br>
> To do this we'd need to be able to define a list of supported keys and work through<br>
> that instead of the entire list passed as part of a request. With that it would be easy<br>
> to define a default somehow, likely through metadata.<br>
><br>
> Steve<br>
><br>
>>>> On 7/29/2009 at 10:52 AM, in message <<a href="mailto:4A70705A.2090403@mapgears.com">4A70705A.2090403@mapgears.com</a>>, Daniel<br>
> Morissette <<a href="mailto:dmorissette@mapgears.com">dmorissette@mapgears.com</a>> wrote:<br>
>> Thomas Bonfort wrote:<br>
>>><br>
>>> I very often use url overloading with the %key% syntax in my mapfile<br>
>>> as I find it's a powerful means of building custom maps. The problem<br>
>>> with the current implementation is that the mapfile more often than<br>
>>> less becomes unparsable if the url doesn't contain the key=value<br>
>>> parameter.<br>
>>><br>
>>> Would it be complicated to modify the parser so that the mapfile can<br>
>>> contain a default value for %key%, that would be applied if the url<br>
>>> does not contain the "key" parameter?<br>
>>><br>
>><br>
>> I have encountered that problem as well and think this would be a<br>
>> valuable addition.<br>
>><br>
>> Perhaps it could be as simple as looking up the %key% value in metadata<br>
>> if it is not present in the URL?<br>
>><br>
>> Daniel<br>
>> --<br>
>> Daniel Morissette<br>
>> <a href="http://www.mapgears.com/" target="_blank">http://www.mapgears.com/</a><br>
>> _______________________________________________<br>
>> mapserver-dev mailing list<br>
>> <a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
><br>
> _______________________________________________<br>
> mapserver-dev mailing list<br>
> <a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
><br>
_______________________________________________<br>
mapserver-dev mailing list<br>
<a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
<br>
</div></div></blockquote></div><br>