[Mapbender-commits] r4070 - branches/mifan_dev/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jun 22 11:55:18 EDT 2009


Author: mifan
Date: 2009-06-22 11:55:17 -0400 (Mon, 22 Jun 2009)
New Revision: 4070

Modified:
   branches/mifan_dev/mapbender/http/classes/class_csw.php
Log:
xml parsing in cat class

Modified: branches/mifan_dev/mapbender/http/classes/class_csw.php
===================================================================
--- branches/mifan_dev/mapbender/http/classes/class_csw.php	2009-06-22 13:58:26 UTC (rev 4069)
+++ branches/mifan_dev/mapbender/http/classes/class_csw.php	2009-06-22 15:55:17 UTC (rev 4070)
@@ -39,6 +39,7 @@
 	var $cat_op_describerecord;
 	var $cat_getcapabilities_doc;
 	
+	var $cat_upload_url;
 	var $fees;
 	var $accessconstraints;
 	var $contactperson;
@@ -58,6 +59,9 @@
 	var $catowner;
 	var $cattimestamp;
 	
+	//store catalog retrieval status
+	var $cat_status;
+	
 	function csw(){
 		
 	}
@@ -80,6 +84,36 @@
 		//import connector
 		$x = new connector($url);
 		$data = $x->file;
+		
+		if(!$data){
+			$this->cat_status = false;
+			return false;
+		}
+		else {
+			$this->wms_status = true;
+		}
+		
+		//arrays to hold xml struct values and index
+		$value_array = null;
+		$index_array = null;
+		
+		$this->cat_getcapabilities_doc = $data;
+		$this->cat_upload_url = $url;
+		$this->cat_id="";//Auto-assing catalog id
+		
+		$parser = xml_parser_create("");
+		xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
+		xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1);
+		xml_parser_set_option($parser,XML_OPTION_TARGET_ENCODING,CHARSET);
+		xml_parse_into_struct($parser,$data,$value_array,$index_array);
+		
+		$code = xml_get_error_code($parser);
+		if ($code) {
+			$line = xml_get_current_line_number($parser); 
+			$mb_exception = new mb_exception(xml_error_string($code) .  " in line " . $line);
+		}
+		
+		xml_parser_free($parser);
 	}
 	
 	/**
@@ -99,7 +133,9 @@
 	 */
 	public function setCatObjToDB($gui)
 	{
-		
+		global $con;
+		db_begin();
+		$sql = "INSERT INTO cat ()"
 	}
 	
 }



More information about the Mapbender_commits mailing list