[Mapbender-commits] r9658 - in trunk/mapbender/http: classes plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jan 17 06:40:20 PST 2017


Author: armin11
Date: 2017-01-17 06:40:20 -0800 (Tue, 17 Jan 2017)
New Revision: 9658

Modified:
   trunk/mapbender/http/classes/class_iso19139.php
   trunk/mapbender/http/plugins/mb_metadata_addon.php
   trunk/mapbender/http/plugins/mb_metadata_server.php
Log:
Possibility to define a no export2csw flag in the metadata editor and from external metadata

Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php	2017-01-17 10:52:42 UTC (rev 9657)
+++ trunk/mapbender/http/classes/class_iso19139.php	2017-01-17 14:40:20 UTC (rev 9658)
@@ -343,14 +343,20 @@
 						} else {
 							$this->inspireDownload = 0;
 						}
+			                case "mapbender.2.noCswExport":
+						if ($keyword == "1") {
+							$this->export2Csw = 'f';
+						} else {
+							$this->export2Csw = 't';
+						}
 						//$e = new mb_exception("inspireDownload: ".$this->inspireDownload);
-					break;
+						break;
 					case "mapbender.2.inspireWholeArea":
 						$this->inspireWholeArea = $keyword;
-					break;
+						break;
 					case "mapbender.2.inspireActualCoverage":
 						$this->inspireActualCoverage = $keyword;
-					break;
+						break;
 				}
 				unset($thesaurusName);
 				$iKeyword++;

Modified: trunk/mapbender/http/plugins/mb_metadata_addon.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_addon.php	2017-01-17 10:52:42 UTC (rev 9657)
+++ trunk/mapbender/http/plugins/mb_metadata_addon.php	2017-01-17 14:40:20 UTC (rev 9658)
@@ -328,6 +328,10 @@
 			<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>
+		<fieldset>
+			<legend><?php echo _mb("Metadata export");?><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Harvest link target and export to CSW");?>'}" src="../img/questionmark.png" alt="" /></legend>
+			<input name="export2csw2" id="export2csw2" type="checkbox"/>
+		</fieldset>
 	</div>
 	</div><!--accordion-->
 	</div><!--demo-->

Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php	2017-01-17 10:52:42 UTC (rev 9657)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php	2017-01-17 14:40:20 UTC (rev 9658)
@@ -1170,9 +1170,11 @@
 			switch ($export2csw) {
 				case "t" :
 					$resultObj["export2csw"] = true;
+					$resultObj["export2csw2"] = true;
 					break;
 				case "f" :
 					$resultObj["export2csw"] = false;
+					$resultObj["export2csw2"] = false;
 					break;
 				default:
 				break;
@@ -1318,6 +1320,9 @@
 				}
 			break;
 		}
+		//set export2csw and searchable always initially to true
+		$resultObj["export2csw2"] = true; 
+		$resultObj["searchable"] = true;
 		$ajaxResponse->setResult($resultObj);
 		$ajaxResponse->setSuccess(true);
 		break;
@@ -1331,10 +1336,18 @@
 		$mbMetadata = new Iso19139();
 		$result = $mbMetadata->createFromDBInternalId($metadataId);
 		if ($result) {
-			if ($data->export2csw) {
-				$mbMetadata->export2Csw = 't';
+			if ($data->kindOfMetadataAddOn == 'link') {
+				if ($data->export2csw) {
+					$mbMetadata->export2Csw = 't';
+				} else {
+					$mbMetadata->export2Csw = 'f';
+				}
 			} else {
-				$mbMetadata->export2Csw = 'f';
+				if ($data->export2csw2) {
+					$mbMetadata->export2Csw = 't';
+				} else {
+					$mbMetadata->export2Csw = 'f';
+				}
 			}
 			if ($data->inspire_top_consistence) {
 				$mbMetadata->inspireTopConsistence = 't';
@@ -1366,7 +1379,11 @@
 			$mbMetadata->tmpExtentEnd = $data->tmp_reference_2;
 			$mbMetadata->lineage = $data->lineage;
 			//set origin always to metador - even if it was an uploaded record before!
-			$mbMetadata->origin = 'metador';
+			if ($data->kindOfMetadataAddOn == 'link') {
+				$mbMetadata->origin = 'external';
+			} else {
+				$mbMetadata->origin = 'metador';
+			}
 			$mbMetadata->spatialResType = $data->spatial_res_type;
 			$mbMetadata->spatialResValue = $data->spatial_res_value;
 			$mbMetadata->inspireCharset = $data->inspire_charset;
@@ -1515,15 +1532,21 @@
 		if ($data->kindOfMetadataAddOn == 'link') {
 			//generate metador entry
 			$origin = 'external';
+			//export
+			if ($data->export2csw == "on") {
+				$data->export2csw = 't';
+			} else {
+				$data->export2csw = 'f';
+			}
 		} else {
+			if ($data->export2csw2 == "on") {
+				$data->export2csw = 't';
+			} else {
+				$data->export2csw = 'f';
+			}
 			$origin = 'metador';
 		}
-		//export
-		if ($data->export2csw == "on") {
-			$data->export2csw = 't';
-		} else {
-			$data->export2csw = 'f';
-		}
+		//give 
 		//consistence
 		if ($data->inspire_top_consistence == "on") {
 			$data->inspire_top_consistence = 't';



More information about the Mapbender_commits mailing list