[Mapbender-commits] r7805 - in trunk/mapbender/http: php plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue May 10 08:45:57 EDT 2011


Author: armin11
Date: 2011-05-10 05:45:57 -0700 (Tue, 10 May 2011)
New Revision: 7805

Modified:
   trunk/mapbender/http/php/mod_dataISOMetadata.php
   trunk/mapbender/http/plugins/mb_metadata_server.php
Log:
Bugfix

Modified: trunk/mapbender/http/php/mod_dataISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_dataISOMetadata.php	2011-05-10 11:38:28 UTC (rev 7804)
+++ trunk/mapbender/http/php/mod_dataISOMetadata.php	2011-05-10 12:45:57 UTC (rev 7805)
@@ -565,6 +565,25 @@
 		$keyword->appendChild($keyword_cs);
 		$MD_Keywords->appendChild($keyword);
 	}
+	//pull special keywords from custom categories:
+	$e = new mb_exception("layer: ".$layerId);	
+
+	$sql = "SELECT custom_category.custom_category_key FROM custom_category, layer_custom_category WHERE layer_custom_category.fkey_layer_id = $1 AND layer_custom_category.fkey_custom_category_id =  custom_category.custom_category_id AND (custom_category_hidden <> 1 OR custom_category_hidden ISNULL)";
+	$v = array((integer)$layerId);
+	$t = array('i');
+	$res = db_prep_query($sql,$v,$t);
+	$e = new mb_notice("look for custom categories: ");
+	$countCustom = 0;
+	while ($row = db_fetch_array($res)) {
+		$keyword=$iso19139->createElement("gmd:keyword");
+		$keyword_cs=$iso19139->createElement("gco:CharacterString");
+		$keywordText = $iso19139->createTextNode($row['custom_category_key']);
+		$keyword_cs->appendChild($keywordText);
+		$keyword->appendChild($keyword_cs);
+		$MD_Keywords->appendChild($keyword);
+		$countCustom++;
+	}
+	$e = new mb_exception("count custom categories: ".$countCustom);
 	//read out the inspire categories and push them in as controlled keywords
 /* example
 <gmd:keyword><gco:CharacterString>Geographical names</gco:CharacterString></gmd:keyword><gmd:thesaurusName><gmd:CI_Citation><gmd:title><gco:CharacterString>GEMET - INSPIRE themes, version 1.0</gco:CharacterString></gmd:title><gmd:date><gmd:CI_Date><gmd:date><gco:Date>2008-06-01</gco:Date></gmd:date><gmd:dateType><gmd:CI_DateTypeCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode" codeListValue="publication">publication</gmd:CI_DateTypeCode></gmd:dateType></gmd:CI_Date></gmd:date></gmd:CI_Citation></gmd:thesaurusName></gmd:MD_Keywords></gmd:descriptiveKeywords><gmd:descriptiveKeywords><gmd:MD_Keywords><gmd:keyword><gco:CharacterString>BasisDLM</gco:CharacterString></gmd:keyword>	
@@ -730,7 +749,7 @@
 	#Topic Category B 2.1 - not needed for services
 
 	//read keywords for resource out of the database:
-	$sql = "SELECT md_topic_category.md_topic_category_code_en FROM md_topic_category, layer_md_topic_category WHERE layer_md_topic_category.fkey_layer_id=$1 AND layer_md_topic_category.fkey_md_topic_category_id=md_topic_category.md_topic_category_id";
+	$sql = "SELECT md_topic_category.md_topic_category_code_en FROM md_topic_category, layer_md_topic_category WHERE layer_md_topic_category.fkey_layer_id = $1 AND layer_md_topic_category.fkey_md_topic_category_id=md_topic_category.md_topic_category_id";
 	$v = array((integer)$layerId);
 	$t = array('i');
 	$res = db_prep_query($sql,$v,$t);

Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php	2011-05-10 11:38:28 UTC (rev 7804)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php	2011-05-10 12:45:57 UTC (rev 7805)
@@ -739,10 +739,7 @@
 SQL;
 		$v = array($link, $uuid, $origin, $title, $abstract, $format, $ref_system, $export2csw,$inspire_top_consistence,$tmp_reference_1,$tmp_reference_2,$lineage,$spatial_res_type,$spatial_res_value,$inspire_charset);
 		$t = array('s','s','s','s','s','s','s','b','b','s','s','s','s','s','s');
-		$res = db_prep_query($sql,$v,$t);
-		if (db_error()) {
-			$test = new mb_exception("test");
-		}
+		
 		try {
 			$res = db_prep_query($sql,$v,$t);
 		}



More information about the Mapbender_commits mailing list