[Mapbender-commits] r4422 - branches/mifan_dev/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jul 27 08:26:53 EDT 2009


Author: mifan
Date: 2009-07-27 08:26:52 -0400 (Mon, 27 Jul 2009)
New Revision: 4422

Modified:
   branches/mifan_dev/mapbender/http/javascripts/mod_searchCSW_ajax.php
Log:
getrecords

Modified: branches/mifan_dev/mapbender/http/javascripts/mod_searchCSW_ajax.php
===================================================================
--- branches/mifan_dev/mapbender/http/javascripts/mod_searchCSW_ajax.php	2009-07-27 08:42:23 UTC (rev 4421)
+++ branches/mifan_dev/mapbender/http/javascripts/mod_searchCSW_ajax.php	2009-07-27 12:26:52 UTC (rev 4422)
@@ -51,23 +51,29 @@
 	<script type="text/javascript">
 	<!--
 	// Set default for element variables if they are undefined
+	/*
 	option_dball      = (typeof(option_dball) !== 'undefined')      ? option_dball      : '1';
 	option_dbgroup    = (typeof(option_dbgroup) !== 'undefined')    ? option_dbgroup    : '0';
 	option_dbgui      = (typeof(option_dbgui) !== 'undefined')      ? option_dbgui      : '0';
 	capabilitiesInput = (typeof(capabilitiesInput) !== 'undefined') ? capabilitiesInput : '1';
 	gui_list          = (typeof(gui_list) !== 'undefined')          ? gui_list          : '';
+	*/
 
+	/*
 	var guis = gui_list.split(',');
 	
 	if(gui_list === '') {
 		guis = [];
 	}
+	*/
 
 	var global_source = 'capabilities';  // [capabilities,db]
+
+	
 	var global_is_advanced = false;
 
-	//set server side URL
-	var phpUrl        = '../php/mod_addWMSfromfilteredList_server.php?<?php echo $urlParameters;?>';
+	//set server side URL for query builder
+	var phpUrl        = '../php/mod_searchCatQueryBuilder_server.php?<?php echo $urlParameters;?>';
 
 
 	//Build CSW query and search
@@ -77,13 +83,133 @@
 		//check for simple or advanced
 		if(global_is_advanced){
 			//handle advanced search
+			imageOn();
+			parent.mb_ajax_json(phpUrl, {"command":"getrecordsadvanced"}, function (json, status) {
+				imageOff();
+				displayRecords(json.cats);
+				//displayGroups(json.group);
+			});
+				
 		}
 		else{
 			//handle simple search
+			alert('1');
+			
+			//imageOn();
+			parent.mb_ajax_json(phpUrl, {"command":"getrecordssimple", "search":simplesearchterm }, function (json, status) {
+				//imageOff();
+				alert('3');
+				displayRecords(json.cats);
+				//displayGroups(json.group);
+			});
+				
 		}	
 		
-		alert (simplesearchterm);
 	}
+
+	// Display Catalog records returned by getrecords
+	function displayRecords(catarray){
+		alert('2');
+		for (var i=0;i<catarray.length; i++) {
+			alert(catarray[i]);
+		}
+	}
+
+
+	function hide_advanced_form(){
+
+		global_is_advanced = false;
+		var html='';
+		html = html + "<fieldset>";
+		html = html + "<input type='button' id='adv_search_show' name='adv_search_show' value='<?php echo _mb('+ Advanced'); ?>' onclick='show_advanced_form();' />";
+		html = html + "</fieldset>";
+
+		document.getElementById('advanced_div').innerHTML=html;
+	}
+
+	// Form fields
+
+	function show_advanced_form(){
+		
+		global_is_advanced = true;
+		var html = '';
+		html = html + "<fieldset>";
+		html = html + "<input type='button' value='--Advanced' onclick=hide_advanced_form() />";
+		html = html + "</fieldset>";
+		html = html + "<fieldset>";
+		html = html + "<legend>Advanced Search</legend>";
+		html = html + "<fieldset id='cont_adv_summary'>";
+		html = html + "<label for='adv_title'><?php echo _mb('Title '); ?>:</label>";
+		html = html + "<input type='text' id='adv_title' name='adv_title' /> <br /><br />";
+		html = html + "<label for='adv_abstract'><?php echo _mb('Abstract'); ?>:</label>";
+		html = html + "<input type='text' id='adv_abstract' name='adv_abstract' /><br /><br />";
+		html = html + "<label for='adv_keywords'><?php echo _mb('Keywords'); ?>:</label>";
+		html = html + "<input type='text' id='adv_keywords' name='adv_keywords' /><br /><br />";
+		html = html + "</fieldset>";
+
+		
+		html = html + "<fieldset>";
+		html = html + "<table>";
+		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 + "</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 + "</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 + "</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 + "<td></td>";
+		html = html + "</tr>";
+		html = html + "</table>";
+		html = html + "</fieldset>";
+		
+		document.getElementById('advanced_div').innerHTML=html;			
+			
+	}
+
+	function show_options_form(){
+		var html = '';
+		html = html + "<fieldset>";
+		html = html + "<input type='button' value='- Options' onclick=hide_options_form() />";
+		html = html + "</fieldset>";
+		html = html + "<fieldset>";
+		html = html + "<legend>Search Options</legend>";
+		html = html + "<fieldset id='cont_options'>";
+		html = html + "<label for='opt_result_cont'><?php echo _mb('No. of Hits'); ?>:</label>";
+		html = html + "<input type='text' id='opt_result_cont' name='opt_result_cont' /> <br /><br />";
+		html = html + "</fieldset>";
+		document.getElementById('options_div').innerHTML=html;
+	}
+
+	function hide_options_form(){
+
+		var html='';
+		html = html + "<fieldset>";
+		html = html + "<input type='button' id='options_show' name='options_show' value='<?php echo _mb('+ Options'); ?>' onclick='show_options_form();' />";
+		html = html + "</fieldset>";
+
+		document.getElementById('options_div').innerHTML=html;
+	}
+
+	// End of Form fields
+	
+	
 	// Load service
 
 	function mod_addWMSfromDB(gui_id,wms_id) {
@@ -312,74 +438,6 @@
 		}
 	}
 
-	function hide_advanced_form(){
-
-		global_is_advanced = false;
-		var html='';
-		html = html + "<fieldset>";
-		html = html + "<input type='button' id='adv_search_show' name='adv_search_show' value='<?php echo _mb('+ Advanced'); ?>' onclick='show_advanced_form();' />";
-		html = html + "</fieldset>";
-
-		document.getElementById('advanced_div').innerHTML=html;
-	}
-
-	function show_advanced_form(){
-		
-		global_is_advanced = true;
-		var html = '';
-		html = html + "<fieldset>";
-		html = html + "<input type='button' value='--Advanced' onclick=hide_advanced_form() />";
-		html = html + "</fieldset>";
-		html = html + "<fieldset>";
-		html = html + "<legend>Advanced Search</legend>";
-		html = html + "<fieldset id='cont_adv_summary'>";
-		html = html + "<label for='adv_title'><?php echo _mb('Title '); ?>:</label>";
-		html = html + "<input type='text' id='adv_title' name='adv_title' /> <br /><br />";
-		html = html + "<label for='adv_abstract'><?php echo _mb('Abstract'); ?>:</label>";
-		html = html + "<input type='text' id='adv_abstract' name='adv_abstract' /><br /><br />";
-		html = html + "<label for='adv_keywords'><?php echo _mb('Keywords'); ?>:</label>";
-		html = html + "<input type='text' id='adv_keywords' name='adv_keywords' /><br /><br />";
-		html = html + "</fieldset>";
-
-		
-		html = html + "<fieldset>";
-		html = html + "<table>";
-		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 + "</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 + "</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 + "</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 + "<td></td>";
-		html = html + "</tr>";
-		html = html + "</table>";
-		html = html + "</fieldset>";
-		
-
-		document.getElementById('advanced_div').innerHTML=html;	
-				  
-			
-			
-	}
-
 	function displayWMS (wmsArray, guiId) {
 		if (wmsArray.length > 0) {
 			setTableHeader(selectWmsText, wmsNameText, wmsAbstractText);
@@ -447,7 +505,13 @@
 		</fieldset>
 		</div>
 		
+		<div id="options_div">
+		<fieldset>
+			<input type="button" id="options_show" name="options_show" value="<?php echo _mb("+ Options"); ?>" onclick="show_options_form();" />
+		</fieldset>
+		</div>
 		
+		
 		<input type="button" id="basic_search_submit" name="addCapURL" value="<?php echo _mb("Search CSW"); ?>" onclick="mod_searchCSW();" />
 </form>
 </div>



More information about the Mapbender_commits mailing list