As David stated, the INCLUDE keyword does not have to be a full mapserver object, it can be any valid mapserver keywords.
-- thomas On Fri, Apr 29, 2011 at 16:49, Nicolas BOUTET <[email protected]> wrote: > Thank you David, > > > > Yes, using INCLUDE should be a good solution. But as I know in MapServer > 5.6, CONNECTION is a parameter of my LAYER objects, and not an object > itself. So I cannot have a CONNECTION object declared in a separate map > file… And I prefer to not have to duplicate the layers in different map > files. > > > > Nicolas > > > > > > De : Fawcett, David (MPCA) [mailto:[email protected]] > > Envoyé : vendredi 29 avril 2011 16:37 > À : [email protected]; [email protected] > Objet : RE: [mapserver-users] Parameterized MapFile using CGI variable > > > > One potential way to do it would be with the use of ‘include’s. > > > > http://mapserver.org/mapfile/Include.html > > > > The primary mapfile wouldn’t have a connection object, but it would contain: > > > > INCLUDE “connect_info.map” > > > > Then on each machine, you would have a different version of connect_info.map > that contained the correct connection object for that machine. > > > > This wouldn’t give you the flexibility of changing it through the CGI > interface, but would allow you to use the same exact mapfile on both > machines. > > > > David. > > > > From: [email protected] > [mailto:[email protected]] On Behalf Of Nicolas BOUTET > Sent: Friday, April 29, 2011 8:57 AM > To: [email protected] > Subject: [mapserver-users] Parameterized MapFile using CGI variable > > > > Dear All, > > > > I have 2 MapServer servers. One for Production use, and the other for > Validation use. > > The MAP files placed on those servers are similar except that each server > has a different Oracle database as datasource. > > For now, I have some different CONNECTION values depending if the map file > is on the Production or on the Validation server. So finally I must have > different MAP files. > > > > Is there a way to have exactly the same map files on the 2 servers, and to > use a variable to parameterize the CONNECTION. > > > > For example, I would like to set the CONNECTION of my layers to > “%ORACLECONNECTIONSTRING%” and to set a CGI Environment variable named > ORACLECONNECTIONSTRING to the correct value on each server. > > > > Nicolas > > > > _______________________________________________ > mapserver-users mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > _______________________________________________ mapserver-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapserver-users
