[Chameleon] Manage WMS Servers widget shows "cache_mlt" errors,r esults in no WMS data layers

Eijnden, B. van den (Bart) b.vdeijnden at agi.rws.minvenw.nl
Mon May 8 01:59:20 EDT 2006


Hi Jacob,

do I get it correctly that these lines of code are only executed if:

1) the Chameleon php module cannot be found/loaded
2) the wmsparse utility cannot be found

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.

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.

Jennifer, if you are interested, we use the following PHP script to generate
the dbf files automatically from a | separated textfile of: servername|URL

<?php

define( 'COMMON', '/data/geoservices/apps/chameleon/htdocs/common/' );
define("LAYER_STYLE", true);
$szDataDir = '/data/geoservices/apps/mapviewer/data/';
$szWMSParse = COMMON.'wmsparse/linux/wmsparse';
$szFile= '/data/geoservices/apps/geoservices/config/wmsbrowser.txt';
include_once('/data/geoservices/apps/chameleon/htdocs/common/phpwms/manage_s
ervers.php');

// use curl for http communication
$_SESSION['HTTPClientType'] == 1;

$oServerManager = new ServerManager( $szDataDir, $szWMSParse );

// read file and for every line add entry to server manager
$fp = fopen($szFile, 'r');
$i = 0;
while (!feof ($fp))
{
  $line = fgets($fp, 4096);
  // format is Name|URL
  $array = explode('|', $line);
  echo "+ $array[0] => $array[1]";
  if (trim($array[0]) != "")
  {
    $oServerManager->add($array[1], $array[0], $i);
  }
  $i++;
}
fclose ($fp);
?>

Best regards,
Bart

-----Oorspronkelijk bericht-----
Van: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org]Namens Delfos, Jacob
Verzonden: maandag 8 mei 2006 2:45
Aan: Bart van den Eijnden (OSGIS)
CC: chameleon at lists.maptools.org
Onderwerp: RE: [Chameleon] Manage WMS Servers widget shows "cache_mlt"
errors,results in no WMS data layers


Hi Bart,

I'm not familiar with that extension. I guess this extension makes use
of the fields added in dbf.php?

To prevent changing the DBF structure from what it currently is, can I
suggest the following changes to server_data_manager.php instead?

Line 1807, after:
$rec_new = array( $nLayerID, $nServerID, $szName, $szTitle, $szSRS);

Add this line:
$rec_new = array_merge($rec_new, array("","",""));  // values for
mdu_type,mdu_fmt,mdu_url

Change line 1813, from:

$rec_new = array_merge($rec_new, array($ll_minx, $ll_miny, $ll_maxx,
$ll_maxy, $bb_id));

To

$rec_new = array_merge($rec_new, array($ll_minx, $ll_miny, $ll_maxx,
$ll_maxy, "","", $bb_id));
// fill blanks for missing minscale and maxscale


These lines mean the DBF stays the same, but the record added to it has
blanks for the field for which values are not added. I don't think this
would cause any problems for anyone, as currently the code tries to add
an invalid record to the DBF, with too few fields. It appears to work
for me.

Jennifer, if this causes incompatability with your old DBF, maybe you
could edit your DBF by adding fields to it, so it can be used with the
new structure. 

Regards,

Jacob



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.
************************************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20060508/cba6e1a0/attachment-0001.html


More information about the Chameleon mailing list