[Mapbender-commits] r4526 - in branches/mifan_dev/mapbender/http: javascripts php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Aug 17 06:45:46 EDT 2009


Author: mifan
Date: 2009-08-17 06:45:46 -0400 (Mon, 17 Aug 2009)
New Revision: 4526

Modified:
   branches/mifan_dev/mapbender/http/javascripts/mod_searchCSW_ajax.php
   branches/mifan_dev/mapbender/http/php/mod_searchCatQueryBuilder_server.php
Log:
changes to simple search

Modified: branches/mifan_dev/mapbender/http/javascripts/mod_searchCSW_ajax.php
===================================================================
--- branches/mifan_dev/mapbender/http/javascripts/mod_searchCSW_ajax.php	2009-08-16 05:59:29 UTC (rev 4525)
+++ branches/mifan_dev/mapbender/http/javascripts/mod_searchCSW_ajax.php	2009-08-17 10:45:46 UTC (rev 4526)
@@ -118,27 +118,27 @@
 		html = html + "<tr>";
 		html = html + "<td></td>";
 		html = html + "<td>";
-		html = html + "<label for='adv_title'><?php echo _mb('Lat-Min'); ?>:</label>";
-		html = html + "<input type='text' id='adv_title' name='adv_title' size=8/>";
+		html = html + "<label for='latmin'><?php echo _mb('Lat-Min'); ?>:</label>";
+		html = html + "<input type='text' id='latmin' name='latmin' size=8/>";
 		html = html + "</td>";
 		html = html + "<td></td>";
 		html = html + "</tr>";
 		html = html + "<tr>";
 		html = html + "<td>";
-		html = html + "<label for='adv_title'><?php echo _mb('Lon-Min'); ?>:</label>";
-		html = html + "<input type='text' id='adv_title' name='adv_title' />";
+		html = html + "<label for='lonmin'><?php echo _mb('Lon-Min'); ?>:</label>";
+		html = html + "<input type='text' id='lonmin' name='lonmin' />";
 		html = html + "</td>";
 		html = html + "<td></td>";
 		html = html + "<td>";
-		html = html + "<label for='adv_title'><?php echo _mb('Lat-Max'); ?>:</label>";
-		html = html + "<input type='text' id='adv_title' name='adv_title' />";
+		html = html + "<label for='latmax'><?php echo _mb('Lat-Max'); ?>:</label>";
+		html = html + "<input type='text' id='latmax' name='latmax' />";
 		html = html + "</td>";
 		html = html + "</tr>";
 		html = html + "<tr>";
 		html = html + "<td></td>";
 		html = html + "<td>";
-		html = html + "<label for='adv_title'><?php echo _mb('Lon-Max'); ?>:</label>";
-		html = html + "<input type='text' id='adv_title' name='adv_title' />";
+		html = html + "<label for='lonmax'><?php echo _mb('Lon-Max'); ?>:</label>";
+		html = html + "<input type='text' id='lonmax' name='lonmax' />";
 		html = html + "<td></td>";
 		html = html + "</tr>";
 		html = html + "</table>";
@@ -189,84 +189,8 @@
 
 	// End of Form fields
 	
-	
-	// Load service
-	
-	/*
-	function mod_addWMSfromDB(gui_id,wms_id) {
-		parent.mod_addWMSById_load(gui_id,wms_id);
-	}
 
-	function mod_addWMSfromfilteredList(pointer_name,version){
-		//TODO: load active
-		var load                 = false;
-		var conjunctionCharacter = parent.mb_getConjunctionCharacter(pointer_name);
-		
-		if(version == '1.0.0') {
-			load = pointer_name + conjunctionCharacter + 'REQUEST=capabilities&WMTVER=1.0.0';
-		}
-		else if(version == '1.1.0' || version == '1.1.1') {
-			load = pointer_name + conjunctionCharacter + 'REQUEST=GetCapabilities&SERVICE=WMS&VERSION=' + version;
-		}
-		if(load !== false) {
-			parent.mod_addWMS_load(load);
-		}
-	}
 
-	function mod_addWmsfromURL(){
-		var capabilities = document.getElementById('CapURL').value;
-		parent.mod_addWMS_load(capabilities);
-	}
-
-	// Retrieve data
-
-	function setSource(sourceValue) {
-		global_source = sourceValue;
-	}
-
-	function getGroups() {
-		imageOn();
-		parent.mb_ajax_json(phpUrl, {"command":"getGroups"}, function (json, status) {
-			imageOff();
-			displayGroups(json.group);
-		});
-	}
-
-	function getGUIs() {
-		imageOn();
-		parent.mb_ajax_json(phpUrl, {"command":"getGUIs"}, function (json, status) {
-			imageOff();
-			displayGUIs(json.gui);
-		});
-	}
-
-	function getWMSByGUI(guiId) {
-		if(guiId=="")
-			return getAllWMS();
-		imageOn();
-		parent.mb_ajax_json(phpUrl, {"command":"getWMSByGUI", "guiId":guiId}, function (json, status) {
-			imageOff();
-			displayWMS(json.wms, guiId);
-		});
-	}
-
-	function getWMSByGroup(groupId) {
-		imageOn();
-		parent.mb_ajax_json(phpUrl, {"command":"getWMSByGroup", "groupId":groupId}, function (json, status) {
-			imageOff();
-			displayWMS(json.wms);
-		});
-	}
-
-	function getAllWMS() {
-		imageOn();
-		parent.mb_ajax_json(phpUrl, {"command":"getAllWMS"}, function (json, status) {
-			imageOff();
-			displayWMS(json.wms);
-		});
-	}
-	*/
-
 	// -----------------  Display results --------------------
 
 	function removeChildNodes(node) {
@@ -493,8 +417,20 @@
 		//check for simple or advanced
 		if(global_is_advanced){
 			//handle advanced search
+			try{
+				advanced_title = document.getElementById('adv_title').value;
+				advanced_abstract = document.getElementById('adv_abstract').value;
+				advanced_keywords = document.getElementById('adv_keyword').value;
+				advanced_bb_latmin = document.getElementById('latmin').value;
+				advanced_bb_latmax = document.getElementById('latmax').value;
+				advanced_bb_lonmin = document.getElementById('lonmin').value;
+				advanced_bb_lonmax = document.getElementById('lonmax').value;
+			}
+			catch(err){
+				
+			}
 			//imageOn();
-			parent.mb_ajax_json(phpUrl, {"command":"getrecordsadvanced"}, function (json, status) {
+			parent.mb_ajax_json(phpUrl, {"command":"getrecordsadvanced","adv_title":adv_title,"adv_abstract":adv_abstract,"adv_keyword":adv_keyword,"latmin":latmin,"latmax":latmax,"lonmin":lonmin,"lonmax":lonmax}, function (json, status) {
 				//imageOff();
 				displayRecords(json.cats);
 				//displayGroups(json.group);

Modified: branches/mifan_dev/mapbender/http/php/mod_searchCatQueryBuilder_server.php
===================================================================
--- branches/mifan_dev/mapbender/http/php/mod_searchCatQueryBuilder_server.php	2009-08-16 05:59:29 UTC (rev 4525)
+++ branches/mifan_dev/mapbender/http/php/mod_searchCatQueryBuilder_server.php	2009-08-17 10:45:46 UTC (rev 4526)
@@ -132,7 +132,7 @@
 			}
 			else {
 				//Advanced GetRecords via GET
-				$url .= (isset($simplesearch) && $simplesearch!="")?'&constraintlanguage=CQLTEXT&constraint=csw:AnyText Like %'.$simplesearch.'%':'';
+				$url = getrecords_advanced_get($getrecords_url);
 			}
 			break;
 		case 'post':
@@ -144,6 +144,26 @@
 	}
 	
 	return array('url'=>$url,'xml'=>$xml);
+}	
+
+function getrecords_advanced_get($url){
+	
+	$adv_title = $_REQUEST['adv_title'];
+	$adv_subject = $_REQUEST['adv_keyword'];
+	$adv_abstract = $_REQUEST['adv_abstract'];
+	$latmin = $_REQUEST['latmin'];
+	$latmax = $_REQUEST['latmax'];
+	$lonmin = $_REQUEST['lonmin'];
+	$lonmax = $_REQUEST['lonmax'];
+	
+	$url .= '&constraintlanguage=CQLTEXT&constraint=';
+	$query = '';
+	$query .= (isset($adv_title) && $adv_title!="")?"dc:Title Like %$adv_title%":'';
+	$query .= (isset($adv_abstract) && $adv_abstract!="")?"AND dc:Abstract Like %$adv_abstract%":'';
+	$query .= (isset($adv_subject) && $adv_subject!="")?"AND dc:Subject Like %$adv_subject%":'';
+	
+	$url = $url.urlencode($query);
+	return $url;
 }
 
 /**



More information about the Mapbender_commits mailing list