[Mapbender-commits] r9656 - in trunk/mapbender: http/classes http/plugins resources/locale/de_DE/LC_MESSAGES

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jan 17 02:51:47 PST 2017


Author: armin11
Date: 2017-01-17 02:51:47 -0800 (Tue, 17 Jan 2017)
New Revision: 9656

Modified:
   trunk/mapbender/http/classes/class_iso19139.php
   trunk/mapbender/http/plugins/mb_metadata_addon.php
   trunk/mapbender/http/plugins/mb_metadata_server.php
   trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
Log:
New enhancement to add possibility to hide (dataset)metadata in the mapbender catalogue

Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php	2017-01-16 13:24:16 UTC (rev 9655)
+++ trunk/mapbender/http/classes/class_iso19139.php	2017-01-17 10:51:47 UTC (rev 9656)
@@ -83,6 +83,7 @@
 	var $resourceResponsibleParty; //char
 	var $resourceContactEmail; //char
         var $codeListUpdateFrequencyArray;
+	var $searchable;
 
 	function __construct() {
 		//initialize empty iso19139 object
@@ -148,6 +149,8 @@
 		$inspireLegislationConf = realpath(dirname(__FILE__) ."/../../conf/inspire_legislation.json");
 		$this->inspireLegislation = json_decode(file_get_contents($inspireLegislationConf));
 		$this->inspireRegulations = $this->getRelevantInspireRegulations();
+		//default the searchability in the mapbender catalogue to true
+		$this->searchable = 't';
 	}
 	
    //TODO: Following function is only needed til php 5.5 - after upgrade to debian 8 it is obsolet - see also class_syncCkan.php!
@@ -1188,6 +1191,7 @@
 			$this->lineage = $row['lineage'];//"";
 			$this->inspireTopConsistence = $row['inspire_top_consistence'];//"f";
 			$this->inspireInteroperability = $row['inspire_interoperability'];//"f";
+			$this->searchable = $row['searchable'];//"t";
 			$this->spatialResType = $row['spatial_res_type'];//"";
 			$this->spatialResValue = $row['spatial_res_value'];//"";
 			$this->export2Csw = $row['export2csw'];//"t";
@@ -1992,7 +1996,7 @@
 		//insert an instance for iso19139 into mapbenders database
 		$e = new mb_notice("class_iso19139.php: insert metadata with title: ".$this->title);
 		$sql = <<<SQL
-INSERT INTO mb_metadata (lastchanged, link, origin, md_format, data, linktype, uuid, title, createdate, changedate, abstract, searchtext, type, tmp_reference_1, tmp_reference_2, export2csw, datasetid, datasetid_codespace, randomid, fkey_mb_user_id, harvestresult, harvestexception, lineage, inspire_top_consistence, spatial_res_type, spatial_res_value, update_frequency, format, inspire_charset, ref_system, the_geom, datalinks, inspire_whole_area, inspire_actual_coverage, inspire_download, bounding_geom, transfer_size, fees, md_license_source_note, constraints, responsible_party_name, responsible_party_email, preview_image, fkey_mb_group_id, md_proxy, inspire_interoperability)  VALUES(now(), $1, $18, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44, $45)
+INSERT INTO mb_metadata (lastchanged, link, origin, md_format, data, linktype, uuid, title, createdate, changedate, abstract, searchtext, type, tmp_reference_1, tmp_reference_2, export2csw, datasetid, datasetid_codespace, randomid, fkey_mb_user_id, harvestresult, harvestexception, lineage, inspire_top_consistence, spatial_res_type, spatial_res_value, update_frequency, format, inspire_charset, ref_system, the_geom, datalinks, inspire_whole_area, inspire_actual_coverage, inspire_download, bounding_geom, transfer_size, fees, md_license_source_note, constraints, responsible_party_name, responsible_party_email, preview_image, fkey_mb_group_id, md_proxy, inspire_interoperability, searchable)  VALUES(now(), $1, $18, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44, $45, $46)
 SQL;
 		$v = array(
 			$this->href,
@@ -2039,13 +2043,14 @@
 			$this->previewImage,
 			$this->fkey_mb_group_id,
 			$this->mdProxy,
-			$this->inspireInteroperability
+			$this->inspireInteroperability,
+			$this->searchable
 		);
 			//$e = new mb_exception($this->tmpExtentBegin);
 			//$e = new mb_exception($this->tmpExtentEnd);
 			//$e = new mb_exception($this->createDate);
 			//$e = new mb_exception($this->changeDate);
-			$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','b','s','s','s','s','i','i','s','s','b','s','s','s','s','s','s','POLYGON','s','s','s','i','POLYGON','d','s','s','s','s','s','s','i','b','b');
+			$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','b','s','s','s','s','i','i','s','s','b','s','s','s','s','s','s','POLYGON','s','s','s','i','POLYGON','d','s','s','s','s','s','s','i','b','b','b');
 			$res = db_prep_query($sql,$v,$t);
 			return $res;
 	}
@@ -2104,7 +2109,7 @@
 		$sql .= "linktype = $4, uuid = $5, title = $6, createdate = $7, changedate = $8, lastchanged = now(), ";
 		$sql .= "abstract = $9, searchtext = $10, type = $11, tmp_reference_1 = $12, tmp_reference_2 = $13, export2csw = $14, datasetid = $15, ";
 		$sql .= "datasetid_codespace = $16, randomid = $17, harvestresult = $20, harvestexception = $21, lineage = $22, inspire_top_consistence = $23, ";
-		$sql .= "spatial_res_type = $24, spatial_res_value = $25, update_frequency = $26, format = $27, inspire_charset = $28, ref_system = $29, the_geom = $30, datalinks = $31, inspire_whole_area = $32, inspire_actual_coverage = $33, inspire_download = $34, bounding_geom = $35, transfer_size = $36, fees = $37, md_license_source_note = $38, constraints = $39, responsible_party_name = $40, responsible_party_email = $41, preview_image = $42, fkey_mb_group_id = $43, md_proxy = $44, inspire_interoperability = $45 WHERE metadata_id = $19";
+		$sql .= "spatial_res_type = $24, spatial_res_value = $25, update_frequency = $26, format = $27, inspire_charset = $28, ref_system = $29, the_geom = $30, datalinks = $31, inspire_whole_area = $32, inspire_actual_coverage = $33, inspire_download = $34, bounding_geom = $35, transfer_size = $36, fees = $37, md_license_source_note = $38, constraints = $39, responsible_party_name = $40, responsible_party_email = $41, preview_image = $42, fkey_mb_group_id = $43, md_proxy = $44, inspire_interoperability = $45, searchable = $46 WHERE metadata_id = $19";
 		//$e= new mb_exception("class_iso19139.php: downloadLinks json".$this->jsonEncodeDownloadLinks($this->downloadLinks));
 		//$e= new mb_exception("class_iso19139.php: downloadLinks[0]".$this->downloadLinks[0]);
 		$v = array(
@@ -2153,10 +2158,11 @@
 			$this->previewImage,
 			$this->fkey_mb_group_id,
 			$this->mdProxy,
-			$this->inspireInteroperability
+			$this->inspireInteroperability,
+			$this->searchable
 		);
 		//$e = new mb_exception("class_iso19139: ".$this->createWktBboxFromArray($this->wgs84Bbox));
-		$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','b','s','s','s','s','i','i','s','s','b','s','s','s','s','s','s','POLYGON','s','s','s','i','POLYGON','d','s','s','s','s','s','s','i','b','b');
+		$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','b','s','s','s','s','i','i','s','s','b','s','s','s','s','s','s','POLYGON','s','s','s','i','POLYGON','d','s','s','s','s','s','s','i','b','b','b');
 		$res = db_prep_query($sql,$v,$t);
 		return $res;
 	}

Modified: trunk/mapbender/http/plugins/mb_metadata_addon.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_addon.php	2017-01-16 13:24:16 UTC (rev 9655)
+++ trunk/mapbender/http/plugins/mb_metadata_addon.php	2017-01-17 10:51:47 UTC (rev 9656)
@@ -71,6 +71,7 @@
 			<li><a href="#tabs-8"><?php echo _mb("Licenses/Constraints");?></a></li>
 			<li><a href="#tabs-9"><?php echo _mb("Responsible Party");?></a></li>
 			<li><a href="#tabs-10"><?php echo _mb("Preview");?></a></li>
+			<li><a href="#tabs-11"><?php echo _mb("Others");?></a></li>
 		</ul>
 		<!--<legend><?php echo _mb("Simple metadata editor");?></legend>-->
 		<div id="tabs-1">
@@ -322,6 +323,12 @@
 				<input name="preview_image" id="preview_image" type="text"/><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Here you can give a url to an image that should be shown");?>'}" src="../img/questionmark.png" alt="" />
 		</fieldset>
 	</div>
+	<div id="tabs-11">
+		<fieldset>
+			<legend><?php echo _mb("Searchability");?><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Here you can define, if the metadata should be searchable in the geoportal catalogue.");?>'}" src="../img/questionmark.png" alt="" /></legend>
+			<input name="searchable" id="searchable" type="checkbox"/>
+		</fieldset>
+	</div>
 	</div><!--accordion-->
 	</div><!--demo-->
 	</fieldset>

Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php	2017-01-16 13:24:16 UTC (rev 9655)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php	2017-01-17 10:51:47 UTC (rev 9656)
@@ -1199,6 +1199,17 @@
 				default:
 				break;
 			}
+			$searchable = $mbMetadata->searchable; //boolean
+			switch ($searchable) {
+				case "t" :
+					$resultObj["searchable"] = true;
+					break;
+				case "f" :
+					$resultObj["searchable"] = false;
+					break;
+				default:
+				break;
+			}
 			switch ($mbMetadata->inspireDownload) {
 				case 0 :
 					$resultObj["inspire_download"] = false;
@@ -1335,6 +1346,11 @@
 			} else {
 				$mbMetadata->inspireInteroperability = 'f';
 			}
+			if ($data->searchable) {
+				$mbMetadata->searchable = 't';
+			} else {
+				$mbMetadata->searchable = 'f';
+			}
 			if ($data->inspire_download) {
 				$mbMetadata->inspireDownload = 1;
 			} else {
@@ -1520,6 +1536,12 @@
 		} else {
 			$data->inspire_interoperability = 'f';
 		}
+		//searchable
+		if ($data->searchable == "on") {
+			$data->searchable = 't';
+		} else {
+			$data->searchable = 'f';
+		}
 		//generate a uuid for the record:
 		$uuid = new Uuid();
 		//initialize database objects
@@ -1558,6 +1580,11 @@
 		} else {
 			$mbMetadata->inspireInteroperability = "f";
 		}
+		if (isset($data->searchable)) {
+			$mbMetadata->searchable = $data->searchable;
+		} else {
+			$mbMetadata->searchable = "f";
+		}
 		if (isset($data->tmp_reference_1)) {
 			$mbMetadata->tmpExtentBegin = $data->tmp_reference_1;
 		}

Modified: trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
===================================================================
--- trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po	2017-01-16 13:24:16 UTC (rev 9655)
+++ trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po	2017-01-17 10:51:47 UTC (rev 9656)
@@ -4176,4 +4176,9 @@
 msgid "Flag which show, that the provided dataset should be compliant to the Interoperability Regulation. This means, that the data itself is provided in the INSPIRE data model."
 msgstr "Schalter der anzeigt, dass die bereitgestellten Daten konform zu den Interoperabilitätsanforderungen der INSPIRE Richtlinie sein sollen. Dieser Schalter soll nur dann gesetzt werden, wenn die Daten im INSPIRE Datenmodell vorliegen und so abgegeben werden."
 
+msgid "Searchability"
+msgstr "Suchbarkeit"
 
+msgid "Here you can define, if the metadata should be searchable in the geoportal catalogue."
+msgstr "Hier kann festgelegt werden, ob der Metadatensatz im Geoportal auffindbar ist oder nicht."
+



More information about the Mapbender_commits mailing list