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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jul 20 04:36:01 EDT 2009


Author: mifan
Date: 2009-07-20 04:36:01 -0400 (Mon, 20 Jul 2009)
New Revision: 4385

Modified:
   branches/mifan_dev/mapbender/http/classes/class_csw.php
Log:
storing multiple op values

Modified: branches/mifan_dev/mapbender/http/classes/class_csw.php
===================================================================
--- branches/mifan_dev/mapbender/http/classes/class_csw.php	2009-07-20 08:31:46 UTC (rev 4384)
+++ branches/mifan_dev/mapbender/http/classes/class_csw.php	2009-07-20 08:36:01 UTC (rev 4385)
@@ -265,6 +265,8 @@
 			
 		}
 		
+		print('op_Val:  ');
+		print_r($this->cat_op_values);
 		//Success/Failure
 		if(!$this->cat_title || $this->cat_title == ""){
 			$this->cat_status = false;
@@ -277,6 +279,8 @@
 			return true;
 		}
 		
+		
+		
 	}
 	
 	/**
@@ -303,23 +307,21 @@
 		
 		# INSERT INTO TABLE cat - auto insert cat_id
 		$sql = "INSERT INTO cat( ";
-        $sql .= "cat_version, cat_title, cat_abstract, cat_op_getcapabilities, "; 
-        $sql .= "cat_op_describerecord, cat_op_getrecords, cat_op_getrecordbyid, "; 
+        $sql .= "cat_version, cat_title, cat_abstract, ";  
         $sql .= "cat_upload_url, fees, accessconstraints, providername, providersite, "; 
         $sql .= "individualname, positionname, voice, facsimile, deliverypoint, "; 
         $sql .= "city, administrativearea, postalcode, country, electronicmailaddress, "; 
         $sql .= "cat_getcapabilities_doc, cat_owner, cat_timestamp) ";
     	$sql .= "VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25)";
     	
-		$v = array($this->cat_version,$this->cat_title,$this->cat_abstract,$this->cat_op_getcapabilities,
-			$this->cat_op_describerecord,$this->cat_op_getrecords,$this->cat_op_getrecordbyid,
+		$v = array($this->cat_version,$this->cat_title,$this->cat_abstract,
 			$this->cat_upload_url,$this->fees,$this->accessconstraints,$this->providername,$this->providersite,
 			$this->contactperson, $this->contactposition, $this->contactvoicetelephone,$this->contactfacsimiletelephone,$this->delivery,
 			$this->city,$this->address,$this->postcode,$this->country,$this->contactelectronicmailaddress,
 			$admin->char_encode($this->cat_getcapabilities_doc),
 			$_SESSION['mb_user_id'],strtotime("now"));
 			
-		$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i','i');
+		$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i','i');
 		
 		$res = db_prep_query($sql,$v,$t);
 		if(!$res){
@@ -341,18 +343,31 @@
 		}
 		
 		//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();	
+		foreach ($this->cat_op_values as $op_category=>$op_name_array){
+			foreach($op_name_array as $op_type=>$op_value_array){
+				foreach($op_value_array as $op_sub_type=>$value){
+					$op_type_value = '';
+					if($op_sub_type != 'dflt'){
+						//If not dflt, then it is either soap or xml - store this info as post_xml etc
+						$op_type_value = $op_type.'_'.$op_sub_type;
+					}
+					//Store values
+					$sql = " INSERT INTO cat_op_conf(fk_cat_id, param_type, 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