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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jul 15 08:45:15 EDT 2009


Author: mifan
Date: 2009-07-15 08:45:12 -0400 (Wed, 15 Jul 2009)
New Revision: 4359

Modified:
   branches/mifan_dev/mapbender/http/classes/class_csw.php
Log:
trying to handle get,post and soap values for operations....phew!

Modified: branches/mifan_dev/mapbender/http/classes/class_csw.php
===================================================================
--- branches/mifan_dev/mapbender/http/classes/class_csw.php	2009-07-15 11:44:06 UTC (rev 4358)
+++ branches/mifan_dev/mapbender/http/classes/class_csw.php	2009-07-15 12:45:12 UTC (rev 4359)
@@ -108,6 +108,8 @@
 		
 		//operational vars
 		$op_type=null; //get-capabilities, getrecords ...
+		$op_sub_type=null; //get,post,....
+		$op_constraint=false;
 		
 		$this->cat_getcapabilities_doc = $data;
 		$this->cat_upload_url = $url;
@@ -131,16 +133,9 @@
 		xml_parser_free($parser);
 		
 		foreach($value_array as $element){
-			//Version
+			//Version 2.0.2
+			//@todo: handle other profiles
 			
-			/*			
-			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];
 			}
@@ -203,31 +198,65 @@
 				$this->keywords[count($this->keywords)] = $element[value];
 			}
 			
+
+			
 			//Handle operational elements
 			//Open operational element
 			if((mb_strtoupper($element[tag]) == "OWS:OPERATION" OR mb_strtoupper($element[tag]) == "OPERATION") && $element[type] == "open"){
 				$op_type = $element[attributes][name];
 			}
 			
+			//Handle GET
+			if(($op_type!=null) && (mb_strtoupper($element[tag]) == "OWS:GET" OR mb_strtoupper($element[tag]) == "GET")){
+				//$this->cat_op_getcapabilities = $element[attributes]["xlink:href"];
+				$this->cat_op_values[mb_strtolower($op_type)]['get']['dflt']=$element[attributes]["xlink:href"];
+			}
+			
+			//Handle POST
+			if(($op_type!=null) && (mb_strtoupper($element[tag]) == "OWS:POST" OR mb_strtoupper($element[tag]) == "POST")){
+				//$this->cat_op_getcapabilities = $element[attributes]["xlink:href"];
+				$this->cat_op_values[mb_strtolower($op_type)]['post']['dflt']=$element[attributes]["xlink:href"];
+				$op_sub_type='post';
+			}
+			
+			//Handle Constraint
+			if(($op_type!=null) && (mb_strtoupper($element[tag]) == "OWS:CONSTRAINT" OR mb_strtoupper($element[tag]) == "CONSTRAINT")){
+				$op_constraint=$element[attributes]["name"];
+			}
+			
+			// Handle POST Constraint
+			if(($op_type!=null) && (mb_strtolower($op_constraint)=='postencoding') && (mb_strtoupper($element[tag]) == "OWS:VALUE" OR mb_strtoupper($element[tag]) == "VALUE")){
+				//$this->cat_op_getcapabilities = $element[attributes]["xlink:href"];
+				$this->cat_op_values[mb_strtolower($op_type)]['post'][mb_strtolower($element[value])]=$this->cat_op_values[mb_strtolower($op_type)]['post']['dflt'];
+				//Assume one value per constraint
+				$op_constraint=null;
+			}
+			
+			/*
 			//GETCAPABILITIES
 			if((mb_strtoupper($op_type)=='GETCAPABILITIES') &&   (mb_strtoupper($element[tag]) == "OWS:GET" OR mb_strtoupper($element[tag]) == "GET")){
 				$this->cat_op_getcapabilities = $element[attributes]["xlink:href"];
+				$this->cat_op_values['getcapabilities_get']=$element[attributes]["xlink:href"];
 			}
 			
 			//GETRECORDS
 			if((mb_strtoupper($op_type)=='GETRECORDS') &&   (mb_strtoupper($element[tag]) == "OWS:GET" OR mb_strtoupper($element[tag]) == "GET")){
 				$this->cat_op_getrecords = $element[attributes]["xlink:href"];
+				$this->cat_op_values['getrecords_get']=$element[attributes]["xlink:href"];
 			}
 			
 			//GETRECORDS
 			if((mb_strtoupper($op_type)=='GETRECORDBYID') &&   (mb_strtoupper($element[tag]) == "OWS:GET" OR mb_strtoupper($element[tag]) == "GET")){
 				$this->cat_op_getrecordbyid = $element[attributes]["xlink:href"];
+				$this->cat_op_values['getrecordbyid_get']=$element[attributes]["xlink:href"];
 			}
 			
 			//DESCRIBERECORD
-			if((mb_strtoupper($op_type)=='GETRECORDS') &&   (mb_strtoupper($element[tag]) == "OWS:GET" OR mb_strtoupper($element[tag]) == "GET")){
+			if((mb_strtoupper($op_type)=='DESCRIBERECORDS') &&   (mb_strtoupper($element[tag]) == "OWS:GET" OR mb_strtoupper($element[tag]) == "GET")){
 				$this->cat_op_describerecord = $element[attributes]["xlink:href"];
+				$this->cat_op_values['getcapabilities_get']=$element[attributes]["xlink:href"];
 			}
+			*/
 			
 			//Close operational element
 			if((mb_strtoupper($element[tag]) == "OWS:OPERATION" OR mb_strtoupper($element[tag]) == "OPERATION") && $element[type] == "close"){
@@ -311,6 +340,19 @@
 			db_rollback();	
 		}
 		
+		//CAT_OP_CONF
+		//getcapabilities_get
+		$sql = " INSERT INTO cat_op_conf(fk_cat_id, param_name, param_value) " ;
+    	$sql .= " VALUES ($1, $2, $3)";
+    	$v = array($cat_insert_id,'get_capabilities_get','');
+		$t = array('i','s','s');
+		$res = db_prep_query($sql,$v,$t);
+		if(!$res){
+			db_rollback();	
+		}
+		
+		
+		
 		//Commit Changes
 		db_commit();
 		



More information about the Mapbender_commits mailing list