[Mapbender-commits] r4306 -
branches/mifan_dev/mapbender/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Sun Jul 5 15:06:49 EDT 2009
Author: mifan
Date: 2009-07-05 15:06:49 -0400 (Sun, 05 Jul 2009)
New Revision: 4306
Modified:
branches/mifan_dev/mapbender/http/classes/class_csw.php
Log:
loading cat
Modified: branches/mifan_dev/mapbender/http/classes/class_csw.php
===================================================================
--- branches/mifan_dev/mapbender/http/classes/class_csw.php 2009-07-05 06:54:15 UTC (rev 4305)
+++ branches/mifan_dev/mapbender/http/classes/class_csw.php 2009-07-05 19:06:49 UTC (rev 4306)
@@ -87,6 +87,7 @@
if(!$data){
$this->cat_status = false;
+ echo "Error1";
return false;
}
else {
@@ -120,21 +121,29 @@
foreach($value_array as $element){
//Version
+
echo "Print:";
+ print_r($element);
+ /*
print_r ($element);
echo "\n";
+ */
if((mb_strtoupper($element[tag]) == "CSW:CAPABILITIES" OR mb_strtoupper($element[tag]) == "CAPABILITIES") && $element[type] == "open"){
$this->cat_version = $element[attributes][version];
}
+
//Title
if((mb_strtoupper($element[tag]) == "OWS:TITLE" OR mb_strtoupper($element[tag]) == "TITLE") && $element[level] == '3'){
$this->cat_title = $this->stripEndlineAndCarriageReturn($element[value]);
}
+
//Abstract
+
if((mb_strtoupper($element[tag]) == "OWS:ABSTRACT" OR mb_strtoupper($element[tag]) == "ABSTRACT") && $element[level] == '3'){
$this->cat_abstract = $this->stripEndlineAndCarriageReturn($element[value]);
}
+
//fees
if(mb_strtolower($element[tag]) == "ows:fees" OR mb_strtolower($element[tag]) == "fees"){
$this->fees = $element[value];
@@ -178,14 +187,13 @@
}
//Store array of keywords
- if(mb_strtolower($element[tag]) == "ows:keyword" OR mb_strtolower($element[tag]) == "keyword"){
+ if(mb_strtolower($element[tag]) == "OWS:KEYWORD" OR mb_strtolower($element[tag]) == "KEYWORD"){
$this->keywords[count($this->keywords)] = $element[value];
}
+
}
- echo $this->cat_abstract;
-
//Success/Failure
if(!$this->cat_title || $this->cat_title == ""){
$this->cat_status = false;
@@ -197,6 +205,7 @@
$e = new mb_notice("class_csw: createCatObjFromXML: CSW " . $url . " has been loaded successfully.");
return true;
}
+
}
/**
@@ -265,8 +274,19 @@
echo "<hr>";
echo "<hr>";
}
+
}
+ /**
+ * Function to handle whitespace and carriage returns
+ * Inspired by WMS code
+ * @param $string
+ * @return unknown_type
+ */
+ function stripEndlineAndCarriageReturn($string) {
+ return preg_replace("/\n/", "", preg_replace("/\r/", " ", $string));
+ }
+
}
?>
\ No newline at end of file
More information about the Mapbender_commits
mailing list