I am new to mapserver world, so as you read this, remember I have no idea what I am talking about  :)<br><br>I was thinking about this problem last week, my idea was to look at passing a reference to a parsing script, that outputs a mapfile.<br>
<br>so instead of this<br><a href="http://localhost/cgi-bin/mapserv?client_id=123&amp;mode=map&amp;map=/path/to/mapfile.map&amp;." target="_blank">http://localhost/cgi-bin/mapserv?client_id=123&amp;mode=map&amp;map=/path/to/mapfile.map&amp;.</a>..<br>
you would pass this url<br><a href="http://localhost/cgi-bin/mapserv?client_id=123&amp;mode=map&amp;map=/path/to/mapfile.map&amp;." target="_blank">http://localhost/cgi-bin/mapserv?client_id=123&amp;mode=map&amp;map=/path/to/mapfilescript&amp;.</a>..<br>
<br>So the only change to mapserver would be to kindly ask it to pass variables when getting a mapfile.  eg<br>/path/to/mapfilescript&amp;client_id=123&amp;mode=map&amp;bbox=........ etc<br><br>Then the custom parsing script could do lots of things, like search and replace $client_id with &quot;123&quot;  or include other files etc.  It could also build an entire mapfile from scratch, pull stuff from a DB, cache common requests and I guess lots more.<br>
<br>As I said I have no idea if this is plausible, or if it would impact on speed to much etc<br><br clear="all">Matt  :)<br><br><br><div class="gmail_quote">On Tue, Oct 4, 2011 at 8:10 AM, Bob Basques <span dir="ltr">&lt;<a href="mailto:Bob.Basques@ci.stpaul.mn.us">Bob.Basques@ci.stpaul.mn.us</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
  

  
  <div style="margin-left:4px;line-height:normal;font-style:normal;margin-bottom:1px;font-size:12pt;margin-top:4px;font-family:Comic Sans MS;font-weight:normal;font-variant:normal;margin-right:4px">
    <p style="margin-top:0;margin-bottom:0">
      <font face="Comic Sans MS" size="3">All,</font>    </p>
<br>      
    <p style="margin-top:0;margin-bottom:0">
      <font face="Comic Sans MS" size="3">I did submit a request very similar to the idea of passing in a MAPFILE as a mapserv parameter a few years back. As I recall there was some discussion about the idea, and there were also the same sorts of reservations about it then, especially the KISS part.  In very early uses of MapServer, we used our own wrapper around it to provide this type of functionality, but it ended up too cumbersome to maintain along with different versions of MapServ as they came along, so we let the idea go.  It really needs to be passed through MapServer to be a viable option IMO.  Otherwise you need to support to many pieces of things to make things very portable.</font>    </p>

<br>      
    <p style="margin-top:0;margin-bottom:0">
      <font face="Comic Sans MS" size="3">I thought the recent introduction of the browse mode using a OpenLayers template might resurrect the idea to some degree, but that didn&#39;t happen either.  I suggested a template passing mechanism for that for example, why restrict to just Openlayers, got some discussion going on it, but that was all.</font>    </p>

<br>      
    <p style="margin-top:0;margin-bottom:0">
      <font face="Comic Sans MS" size="3">I think it will come about at some point, certainly more folks wanting it now than when I first started asking the question  :c)  .</font>    </p>
<br>      
    <p style="margin-top:0;margin-bottom:0">
      <font face="Comic Sans MS" size="3">bobb</font>    </p><div><div></div><div class="h5">
<br>      
    <p style="margin-top:0;margin-bottom:0">
      <br>
      <br>
      &gt;&gt;&gt; Stephen Woodbridge &lt;<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>&gt; wrote:<br>    </p>
    <table style="margin-left:15px;margin-bottom:0;font-size:1em;margin-top:0;margin-right:0" bgcolor="#f3f3f3" border="0">
      <tbody><tr>
        <td>
          <div style="border-left:solid 1px #050505;padding-left:7px">
            <p style="margin-top:0;margin-bottom:0">
              Robert,<br><br>All good questions!<br><br>Here are some thoughts on this.<br><br>1. we all ready have the CGI parameter substitution, but it does require<br>reading the mapfile to get its validation parameters.<br>
<br>2. we already support includes<br><br>3. you would have to read some of the mapfile to get the connection<br>parameters to access the parameters from a database<br><br>4. I like the idea of getting the mapfile from the database, but I think<br>
if I were to go that route, why would I not keep the whole map file in<br>the database? it would be easy to store it as fragments and parameters<br>and do the substitution all in the database and just return a text blob<br>
as a mapfile for mapserver to parse. In Postgresql it would be easy to<br>write a few stored procedures to help manage this and implement it on<br>the database side of things.<br><br>5. Follow the KISS principal. Keep is simple, make the approach<br>
incremental based on the existing code as much as possible<br><br>-Steve W<br><br>On 10/3/2011 3:59 PM, reholl wrote:<br>&gt; I really like the idea of pulling mapfile resources from RDBMS and URL.<br>&gt; For the URL, I don&#39;t think the communications part poses much of a<br>
&gt; challenge, as the cURL stuff used in the OWS client can be repackaged. I<br>&gt; did that once to make a mapserv CONNECTIONTYPE as a SOAP client. I can<br>&gt; certainly picture a somewhat generalized mechanism: &quot;fill ANY mapfile<br>
&gt; value from some outside resource that delivers a construct of the proper<br>&gt; form/type.&quot; These resources might be chained or arranged in branches.<br>&gt; (Does this begin to stray into WPS territory..?) Anything of this<br>
&gt; complexity poses a risk to performance and readability. There&#39;s<br>&gt; definitely something to be said for the everything-is-right-here aspect<br>&gt; of the mapfile. Does mapserv configuration becomes less &#39;file&#39; and more<br>
&gt; &#39;system.&#39; and with what new maintenance headaches? Or another way to<br>&gt; view it: mapfile syntax becomes a de facto programming language, and we<br>&gt; already have mapscript in numerous flavors. What&#39;s the tipping point for<br>
&gt; &quot;let&#39;s move this complexity into core mapserver&quot;? Given all these<br>&gt; caveats, I&#39;d love to explore this further... Robert Hollingsworth<br>&gt;<br>&gt;     blammo wrote:<br>&gt;     All, Would adding in INCLUDEs from a URL be pushing it too much, as<br>
&gt;     in: INCLUDE &quot;<a href="http://Myserver.com/cgi-bin/myscript.pl" target="_blank">http://Myserver.com/cgi-bin/myscript.pl</a>&quot; Could pass in<br>&gt;     parameters like so . . . INCLUDE<br>&gt;     &quot;<a href="http://Myserver.com/cgi-bin/myscript.pl?A=first" target="_blank">http://Myserver.com/cgi-bin/myscript.pl?A=first</a> thing&amp;b=second<br>
&gt;     thing&amp;c=third thing . . .&quot; bobb &gt;&gt;&gt; &quot;Smith, Michael ERDC-CRREL-NH&quot;<br>&gt;     &lt;[hidden email] &lt;/user/SendEmail.jtp?type=node&amp;node=6856380&amp;i=0&gt;&gt;<br>&gt;     wrote: There is an RFC to have includes come from non-file<br>
&gt;     connections (databases). It would be another option<br>&gt;     <a href="http://mapserver.org/development/rfc/ms-rfc-74.html" target="_blank">http://mapserver.org/development/rfc/ms-rfc-74.html</a> Mike -- Michael<br>
&gt;     Smith Remote Sensing/GIS Center US Army Corps of Engineers On<br>&gt;     10/3/11 2:51 PM, &quot;Stephen Woodbridge&quot; &lt;[hidden email]<br>&gt;     &lt;/user/SendEmail.jtp?type=node&amp;node=6856380&amp;i=1&gt;&gt; wrote: &gt;One idea<br>
&gt;     regarding this that you might want to consider is the ability &gt;to<br>&gt;     put all the named parameters in an include file, then be able to<br>&gt;      &gt;include that file via a CGI parameter. So it might look like this:<br>
&gt;      &gt; &gt;<br>&gt;<br>&gt;<br>&gt; View this message in context: Re: Feature wish: Internal mapfile<br>&gt; variables<br>&gt; &lt;<a href="http://osgeo-org.1803224.n2.nabble.com/Feature-wish-Internal-mapfile-variables-tp6853853p6856380.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/Feature-wish-Internal-mapfile-variables-tp6853853p6856380.html</a>&gt;<br>
&gt; Sent from the Mapserver - User mailing list archive<br>&gt; &lt;<a href="http://osgeo-org.1803224.n2.nabble.com/Mapserver-User-f1969211.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/Mapserver-User-f1969211.html</a>&gt; at<br>
&gt; Nabble.com.<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; mapserver-users mailing list<br>&gt; <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br><br>_______________________________________________<br>mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>

            </p>
          </div>
        </td>
      </tr>
    </tbody></table>
  </div></div></div>


<br>_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br></blockquote></div><br>