[Mapbender-commits] r8254 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Feb 16 15:16:38 EST 2012


Author: armin11
Date: 2012-02-16 12:16:38 -0800 (Thu, 16 Feb 2012)
New Revision: 8254

Modified:
   trunk/mapbender/http/plugins/mb_metadata_addon.php
   trunk/mapbender/http/plugins/mb_metadata_server.php
   trunk/mapbender/http/plugins/mb_metadata_showMetadataAddon.js
Log:
Bugfix: There was a javascript bug when trying to upload a metadata file :-( . Its fixed now. jquery dont allow to set onclick attributes per .attr ? it has to be defined as a function.

Modified: trunk/mapbender/http/plugins/mb_metadata_addon.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_addon.php	2012-02-15 09:41:43 UTC (rev 8253)
+++ trunk/mapbender/http/plugins/mb_metadata_addon.php	2012-02-16 20:16:38 UTC (rev 8254)
@@ -8,7 +8,7 @@
 		<p>
 			<table><tr><td><img src='../img/osgeo_graphics/geosilk/link.png' title='linkage' onclick='$("#addonChooser").css("display","none");$("#link_editor").css("display","block");$("#kindOfMetadataAddOn").attr("value","link");' /></td><td><?php echo _mb("Add URL to existing Metadataset");?><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Here someone can add a url to an existing metadata record, which is available over www. The record can either be harvested and pushed to the own catalogue service or it is only used as a link. This links are pushed into the service metadata record and the new capabilities document.");?>'}" src="../img/questionmark.png" alt="" /></td></tr>
 			<tr><td><img src='../img/gnome/edit-select-all.png' title='metadata'  onclick='$("#addonChooser").css("display","none");$("#simple_metadata_editor").css("display","block");$("#kindOfMetadataAddOn").attr("value","metadataset");' /></td><td><?php echo _mb("Add a simple metadata record which is mostly generated from given layer information");?><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("With this option someone can generate a very simple metadata record for the data which is distributed thru the wms layer. The record fulfills only the INSPIRE Metadata Regulation! Most of the needed data is pulled from the service, layer and group information of the owner of the service. The metadate will be created on the fly. It is not stored in the database!");?>'}" src="../img/questionmark.png" alt="" /></td></tr>
-			<tr><td><img src='../img/button_blue_red/up.png' id='uploadImage' title='upload' /></td><td><?php echo _mb("Add a simple metadata record from a local file");?><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("With this option someone can upload an existing metadata record and couple it to the layer. The uploaded data is pushed to the catalogue and will be available for searching. The uploaded data is not fully controlled and validated. It cannot be edited but must be replaced with a new record if needed!");?>'}" src="../img/questionmark.png" alt="" /></td></tr>
+			<tr><td><img onclick='initUploadForm();' src='../img/button_blue_red/up.png' id='uploadImage' title='upload'  /></td><td><?php echo _mb("Add a simple metadata record from a local file");?><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("With this option someone can upload an existing metadata record and couple it to the layer. The uploaded data is pushed to the catalogue and will be available for searching. The uploaded data is not fully controlled and validated. It cannot be edited but must be replaced with a new record if needed!");?>'}" src="../img/questionmark.png" alt="" /></td></tr>
 			</table>
 		</p>
 	</fieldset>

Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php	2012-02-15 09:41:43 UTC (rev 8253)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php	2012-02-16 20:16:38 UTC (rev 8254)
@@ -1038,7 +1038,9 @@
 		$regex = "#</csw:GetRecordByIdResponse>#";
 		$output = preg_replace($regex,"",$output);
 		//$e = new mb_exception($output);
-		$metaData = $output;
+		$iso19139Xml = simplexml_load_string($output);
+		$e = new mb_exception('');
+		
 		//get elements for database from xml by using xpath
 		//uuid
 		$uuid = $iso19139Xml->xpath('/gmd:MD_Metadata/gmd:fileIdentifier/gco:CharacterString');

Modified: trunk/mapbender/http/plugins/mb_metadata_showMetadataAddon.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_showMetadataAddon.js	2012-02-15 09:41:43 UTC (rev 8253)
+++ trunk/mapbender/http/plugins/mb_metadata_showMetadataAddon.js	2012-02-16 20:16:38 UTC (rev 8254)
@@ -34,6 +34,7 @@
 				$metadataAddonForm.easyform("reset");
 				$metadataAddonForm.easyform("fill", obj);
 				
+				
 				//that.showForm(metadataId, layerId);
 				/*
 				//enable link element to edit link!
@@ -277,17 +278,17 @@
 				//show chooser
 				$("#metadataUrlEditor").css("display","block"); 
 				$("#addonChooser").css("display","block");
-				$("#uploadImage").attr('onclick', 'initUploadForm('+layerId+')');
 				//get initial values (title/abstract)
 				that.getInitialLayerMetadata(metadataId, layerId);
 			}
 			that.showForm(metadataId, layerId, isNew);
+			$("#uploadImage").click(function () {
+				initUploadForm(layerId);
+			});
+			//alert($("#uploadImage").attr('onclick')); //there has been a bigger problem when setting an onclick attribut with jquery :-(
 			//TODO: make the fields resizable 
 			//$( "#abstract" ).resizable({ minWidth: 75 });
 		});
-		//upload form
-		
-		//$metadataUploadPopup.append($metadataUploadForm);
 	}
 	initMetadataAddon = function(metadataId, layerId, isNew) {
 		//close old window and load form



More information about the Mapbender_commits mailing list