<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.24">
<TITLE>[Chameleon] Manage WMS Servers widget shows "cache_mlt" errors,results in no WMS data layers</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Hi Jacob,</FONT>
</P>
<P><FONT SIZE=2>do I get it correctly that these lines of code are only executed if:</FONT>
</P>
<P><FONT SIZE=2>1) the Chameleon php module cannot be found/loaded</FONT>
<BR><FONT SIZE=2>2) the wmsparse utility cannot be found</FONT>
</P>
<P><FONT SIZE=2>so then the code reverts to the slow parsing of WMS capabilities in PHP? I think this was never adapted for the scale/metadataURL enhancement. I have no problem with your change then.</FONT></P>
<P><FONT SIZE=2>For us this is never a use case, since we used to use 2) for the parsing, but now use 1). The Chameleon PHP extension is present in chameleon/ext in CVS, and does the same job as wmsparse, but because of security it does not use CGI but a PHP module.</FONT></P>
<P><FONT SIZE=2>Jennifer, if you are interested, we use the following PHP script to generate the dbf files automatically from a | separated textfile of: servername|URL</FONT></P>
<P><FONT SIZE=2><?php</FONT>
</P>
<P><FONT SIZE=2>define( 'COMMON', '/data/geoservices/apps/chameleon/htdocs/common/' );</FONT>
<BR><FONT SIZE=2>define("LAYER_STYLE", true);</FONT>
<BR><FONT SIZE=2>$szDataDir = '/data/geoservices/apps/mapviewer/data/';</FONT>
<BR><FONT SIZE=2>$szWMSParse = COMMON.'wmsparse/linux/wmsparse';</FONT>
<BR><FONT SIZE=2>$szFile= '/data/geoservices/apps/geoservices/config/wmsbrowser.txt';</FONT>
<BR><FONT SIZE=2>include_once('/data/geoservices/apps/chameleon/htdocs/common/phpwms/manage_servers.php');</FONT>
</P>
<P><FONT SIZE=2>// use curl for http communication</FONT>
<BR><FONT SIZE=2>$_SESSION['HTTPClientType'] == 1;</FONT>
</P>
<P><FONT SIZE=2>$oServerManager = new ServerManager( $szDataDir, $szWMSParse );</FONT>
</P>
<P><FONT SIZE=2>// read file and for every line add entry to server manager</FONT>
<BR><FONT SIZE=2>$fp = fopen($szFile, 'r');</FONT>
<BR><FONT SIZE=2>$i = 0;</FONT>
<BR><FONT SIZE=2>while (!feof ($fp))</FONT>
<BR><FONT SIZE=2>{</FONT>
<BR><FONT SIZE=2> $line = fgets($fp, 4096);</FONT>
<BR><FONT SIZE=2> // format is Name|URL</FONT>
<BR><FONT SIZE=2> $array = explode('|', $line);</FONT>
<BR><FONT SIZE=2> echo "+ $array[0] => $array[1]";</FONT>
<BR><FONT SIZE=2> if (trim($array[0]) != "")</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2> $oServerManager->add($array[1], $array[0], $i);</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> $i++;</FONT>
<BR><FONT SIZE=2>}</FONT>
<BR><FONT SIZE=2>fclose ($fp);</FONT>
<BR><FONT SIZE=2>?></FONT>
</P>
<P><FONT SIZE=2>Best regards,</FONT>
<BR><FONT SIZE=2>Bart</FONT>
</P>
<P><FONT SIZE=2>-----Oorspronkelijk bericht-----</FONT>
<BR><FONT SIZE=2>Van: chameleon-bounces@lists.maptools.org</FONT>
<BR><FONT SIZE=2>[<A HREF="mailto:chameleon-bounces@lists.maptools.org">mailto:chameleon-bounces@lists.maptools.org</A>]Namens Delfos, Jacob</FONT>
<BR><FONT SIZE=2>Verzonden: maandag 8 mei 2006 2:45</FONT>
<BR><FONT SIZE=2>Aan: Bart van den Eijnden (OSGIS)</FONT>
<BR><FONT SIZE=2>CC: chameleon@lists.maptools.org</FONT>
<BR><FONT SIZE=2>Onderwerp: RE: [Chameleon] Manage WMS Servers widget shows "cache_mlt"</FONT>
<BR><FONT SIZE=2>errors,results in no WMS data layers</FONT>
</P>
<BR>
<P><FONT SIZE=2>Hi Bart,</FONT>
</P>
<P><FONT SIZE=2>I'm not familiar with that extension. I guess this extension makes use</FONT>
<BR><FONT SIZE=2>of the fields added in dbf.php?</FONT>
</P>
<P><FONT SIZE=2>To prevent changing the DBF structure from what it currently is, can I</FONT>
<BR><FONT SIZE=2>suggest the following changes to server_data_manager.php instead?</FONT>
</P>
<P><FONT SIZE=2>Line 1807, after:</FONT>
<BR><FONT SIZE=2>$rec_new = array( $nLayerID, $nServerID, $szName, $szTitle, $szSRS);</FONT>
</P>
<P><FONT SIZE=2>Add this line:</FONT>
<BR><FONT SIZE=2>$rec_new = array_merge($rec_new, array("","","")); // values for</FONT>
<BR><FONT SIZE=2>mdu_type,mdu_fmt,mdu_url</FONT>
</P>
<P><FONT SIZE=2>Change line 1813, from:</FONT>
</P>
<P><FONT SIZE=2>$rec_new = array_merge($rec_new, array($ll_minx, $ll_miny, $ll_maxx,</FONT>
<BR><FONT SIZE=2>$ll_maxy, $bb_id));</FONT>
</P>
<P><FONT SIZE=2>To</FONT>
</P>
<P><FONT SIZE=2>$rec_new = array_merge($rec_new, array($ll_minx, $ll_miny, $ll_maxx,</FONT>
<BR><FONT SIZE=2>$ll_maxy, "","", $bb_id));</FONT>
<BR><FONT SIZE=2>// fill blanks for missing minscale and maxscale</FONT>
</P>
<BR>
<P><FONT SIZE=2>These lines mean the DBF stays the same, but the record added to it has</FONT>
<BR><FONT SIZE=2>blanks for the field for which values are not added. I don't think this</FONT>
<BR><FONT SIZE=2>would cause any problems for anyone, as currently the code tries to add</FONT>
<BR><FONT SIZE=2>an invalid record to the DBF, with too few fields. It appears to work</FONT>
<BR><FONT SIZE=2>for me.</FONT>
</P>
<P><FONT SIZE=2>Jennifer, if this causes incompatability with your old DBF, maybe you</FONT>
<BR><FONT SIZE=2>could edit your DBF by adding fields to it, so it can be used with the</FONT>
<BR><FONT SIZE=2>new structure. </FONT>
</P>
<P><FONT SIZE=2>Regards,</FONT>
</P>
<P><FONT SIZE=2>Jacob</FONT>
</P>
<BR>
Disclaimer
************************************************************************
Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te
informeren. Wij adviseren u om bij twijfel over de juistheid of de
volledigheid van de mail contact met afzender op te nemen.
This message shall not constitute any rights or obligations.
This message is intended solely for the addressee.
If you have received this message in error, please delete it and
notify the sender immediately. When in doubt whether this message
is correct or complete, please contact the sender.
************************************************************************
<BR>
</BODY>
</HTML>