[Mapbender-commits] r7893 - in trunk/mapbender/http: geoportal php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jun 30 10:26:39 EDT 2011


Author: armin11
Date: 2011-06-30 07:26:39 -0700 (Thu, 30 Jun 2011)
New Revision: 7893

Modified:
   trunk/mapbender/http/geoportal/mod_readOpenSearchResults.php
   trunk/mapbender/http/geoportal/mod_readOpenSearchResultsDetail.php
   trunk/mapbender/http/php/mod_dataISOMetadata.php
Log:
Enhancement of exporting iso19139 metadata records - give reference system info. Enhancemant of iso19139 parser for inspire. Not yet ready!

Modified: trunk/mapbender/http/geoportal/mod_readOpenSearchResults.php
===================================================================
--- trunk/mapbender/http/geoportal/mod_readOpenSearchResults.php	2011-06-29 14:04:21 UTC (rev 7892)
+++ trunk/mapbender/http/geoportal/mod_readOpenSearchResults.php	2011-06-30 14:26:39 UTC (rev 7893)
@@ -399,7 +399,7 @@
 				fwrite($os_catalogs_file_handle,urlencode($openSearchWrapperDetail."?osid=".$os_list[$i_si] ['id']."&plugid=".$plugid."&docid=".$docid."&docuuid=".$docuuid."&mdtype=iso19139"));
 				fwrite($os_catalogs_file_handle,"</iso19139url>\n");
 				fwrite($os_catalogs_file_handle,"<inspireurl>");
-				fwrite($os_catalogs_file_handle,urlencode($openSearchWrapperDetail."?osid=".$os_list[$i_si] ['id']."&plugid=".$plugid."&docid=".$docid."&docuuid=".$docuuid."&mdtype=inspire"));
+				fwrite($os_catalogs_file_handle,urlencode($openSearchWrapperDetail."?osid=".$os_list[$i_si] ['id']."&plugid=".$plugid."&docid=".$docid."&docuuid=".$docuuid."&mdtype=iso19139&validate=true"));
 				fwrite($os_catalogs_file_handle,"</inspireurl>\n");
 				#end of resultlist
 				fwrite($os_catalogs_file_handle,"</result>\n");

Modified: trunk/mapbender/http/geoportal/mod_readOpenSearchResultsDetail.php
===================================================================
--- trunk/mapbender/http/geoportal/mod_readOpenSearchResultsDetail.php	2011-06-29 14:04:21 UTC (rev 7892)
+++ trunk/mapbender/http/geoportal/mod_readOpenSearchResultsDetail.php	2011-06-30 14:26:39 UTC (rev 7893)
@@ -11,28 +11,622 @@
     $string = eregi_replace("\n", "<br>", $string);
     return $string;
 }  
+function guid(){
+    if (function_exists('com_create_guid')){
+        return com_create_guid();
+    }else{
+        mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.
+        $charid = strtoupper(md5(uniqid(rand(), true)));
+        $hyphen = chr(45);// "-"
+        $uuid = chr(123)// "{"
+                .substr($charid, 0, 8).$hyphen
+                .substr($charid, 8, 4).$hyphen
+                .substr($charid,12, 4).$hyphen
+                .substr($charid,16, 4).$hyphen
+                .substr($charid,20,12)
+                .chr(125);// "}"
+        return $uuid;
+    }
+}
+	//function to validate against the inspire validation service
+	function validateInspireMetadataFromData($iso19139Xml){
+		$validatorUrl = 'http://www.inspire-geoportal.eu/INSPIREValidatorService/resources/validation/inspire';
+		#$validatorUrl2 = 'http://localhost/mapbender/x_geoportal/log_requests.php';
+		//send inspire xml to validator and push the result to requesting user
+		$validatorInterfaceObject = new connector();
+		$validatorInterfaceObject->set('httpType','POST');
+		$validatorInterfaceObject->set('httpContentType','multipart/form-data'); # maybe given automatically
+		//first test with data from ram - doesn't function 
+		$fields = array(
+			'dataFile'=>urlencode($iso19139Xml)
+			);
+		//generate file identifier:
+		$fileId = guid();
+		//generate temporary file under tmp
+		 if($h = fopen(TMPDIR."/".$fileId."iso19139_validate_tmp.xml","w")){
+			if(!fwrite($h,$iso19139Xml)){
+				$e = new mb_exception("mod_layerISOMetadata: cannot write to file: ".TMPDIR."iso19139_validate_tmp.xml");
+			}
+		fclose($h);
+		}
+		//send file as post like described under http://www.tecbrat.com/?itemid=13&catid=1
+		$fields['dataFile']='@'.TMPDIR.'/'.$fileId.'iso19139_validate_tmp.xml';
+		#if we give a string with parameters
+		#foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } 
+		#rtrim($fields_string,'&');
+		#$postData = $fields_string;
+		$postData = $fields;
+		#$e = new mb_exception("mod_layerISOMetadata: postData: ".$postData['dataFile']);
+		//number of post fields:
+		//curl_setopt($ch,CURLOPT_POST,count($fields));
+		$validatorInterfaceObject->set('httpPostFieldsNumber',count($postData));
+		$validatorInterfaceObject->set('curlSendCustomHeaders',false);
+		//$validatorInterfaceObject->set('httpPostData', $postData);
+		$validatorInterfaceObject->set('httpPostData', $postData); #give an array
+		$validatorInterfaceObject->load($validatorUrl);
+		header("Content-type: text/html; charset=UTF-8");
+		echo $validatorInterfaceObject->file;
+		//delete file in tmp 
+		//TODO - this normally done by a cronjob
+		die();
+	}
 
+
+
+//INSPIRE Mapping
 $md_ident = array(
+//Metadata Identifier - not neccessary?
 	array(	ibus => "t01_object.obj_id",
 		iso19139 => "/gmd:MD_Metadata/gmd:fileIdentifier/gco:CharacterString",
 		iso19139explode => "false" ,
 		inspire => "unique resource identifier",
-		inspiremandatory => "true",
+		inspiremandatory => "false",
 		iso_name => "fileIdentifier",
-		html => _mb("Metadata file identifier"),
+		html => _mb("Metadata identifier"),
 		value => "",
-		gdescription => "Ein Wert, durch den die Ressource eindeutig gekennzeichnet wird. Der Wertebereich dieses Metadatenelements ist ein obligatorischer Zeichenkettencode, der in der Regel vom Eigentümer der Daten zugeordnet wird, und ein Zeichenketten-Namensraum, der das Umfeld des Bezeichnercodes eindeutig bestimmt (z. B. den Eigentümer der Daten). "
+		category => "identification",
+		description => _mb("A value uniquely identifying the resource. The value domain of this metadata element is a mandatory character string code, generally assigned by the data owner, and a character string namespace uniquely identifying the context of the identifier code (for example, the data owner).")
 	),
+//B 1.1
+	array(	ibus => "rtitle",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString",
+		iso19139explode => "false" ,
+		inspire => "resource title",
+		inspiremandatory => "true",
+		iso_name => "type",
+		html => _mb("Resource title"),
+		value => "",
+		category => "identification",
+		description => _mb("This a characteristic, and often unique, name by which the resource is known. The value domain of this metadata element is free text.")
+	),
+//B 1.2
 	array(	ibus => "abstract",
 		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract/gco:CharacterString",
 		iso19139explode => "false" ,
 		inspire => "resource abstract",
 		inspiremandatory => "true",
 		iso_name => "description",
-		html => _mb("Metadata description"),
+		html => _mb("Resource abstract"),
 		value => "",
-		gdescription => "Description"
+		category => "identification",
+		description => _mb("This is a brief narrative summary of the content of the resource.")
+	),
+//B 1.3
+	array(	ibus => "rtype",
+		iso19139 => "/gmd:MD_Metadata/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue",
+		iso19139explode => "false" ,
+		inspire => "resource type",
+		inspiremandatory => "true",
+		iso_name => "type",
+		html => _mb("Resource type"),
+		value => "",
+		category => "identification",
+		description => _mb("This is the type of resource being described by the metadata.")
+	),
+//B 1.4
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource/gmd:linkage/gmd:URL",
+		iso19139explode => "false" ,
+		inspire => "unique resource locator",
+		inspiremandatory => "true",
+		iso_name => "resourceLocator",
+		html => _mb("Resource locator"),
+		value => "",
+		category => "identification",
+		description => _mb("The resource locator defines the link(s) to the resource and/or the link to additional information about the resource. The value domain of this metadata element is a character string, commonly expressed as uniform resource locator (URL).")
+	),
+//B 1.5 - Identifier of dataset!
+//Part 1 id
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:code/gco:CharacterString",
+		iso19139explode => "false" ,
+		inspire => "unique resource identifier namespace",
+		inspiremandatory => "true",
+		iso_name => "dataset id",
+		html => _mb("Unique resource identifier id"),
+		value => "",
+		category => "identification",
+		description => _mb("A value uniquely identifying the resource. The value domain of this metadata element is a mandatory character string code, generally assigned by the data owner.")
+	),
+//Part 2 - namespace
+
+//B 
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:codeSpace/gco:CharacterString",
+		iso19139explode => "false" ,
+		inspire => "unique resource identifier namespace",
+		inspiremandatory => "true",
+		iso_name => "dataset namespace",
+		html => _mb("Unique resource identifier namespace"),
+		value => "",
+		category => "identification",
+		description => _mb("A character string namespace uniquely identifying the context of the identifier code (for example, the data owner)")
+	),
+//B 1.6 Coupled resource
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/srv:SV_ServiceIdentification/srv:operatesOn/@xlink:href",
+		iso19139explode => "false" ,
+		inspire => "coupled resource",
+		inspiremandatory => "true",
+		iso_name => "coupled resource",
+		html => _mb("Coupled resource"),
+		value => "",
+		category => "identification",
+		description => _mb("If the resource is a spatial data service, this metadata element identifies, where relevant, the target spatial data set(s) of the service through their unique resource identifiers (URI). The value domain of this metadata element is a mandatory character string code, generally assigned by the data owner, and a character string namespace uniquely identifying the context of the identifier code (for example, the data owner).")
+	),
+//B 1.7 Language dataset
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:language/gmd:LanguageCode/@codeListValue",
+		iso19139explode => "false" ,
+		inspire => "Language",
+		inspiremandatory => "true",
+		iso_name => "language",
+		html => _mb("Language"),
+		value => "",
+		category => "identification",
+		description => _mb("The language(s) used within the resource. The value domain of this metadata element is limited to the languages defined in ISO 639-2.")
+	),
+
+//B 2.1 Topic category
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory/gmd:MD_TopicCategoryCode",
+		iso19139explode => "true" ,
+		inspire => "topic category",
+		inspiremandatory => "true",
+		iso_name => "topic category",
+		html => _mb("Topic category"),
+		value => "",
+		category => "classification",
+		description => _mb("The topic category is a high-level classification scheme to assist in the grouping and topic-based search of available spatial data resources. The value domain of this metadata element is defined in Part D.2.")
+	),
+//B 2.2 Spatial data service type
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/srv:SV_ServiceIdentification/srv:serviceType/gco:LocalName",
+		iso19139explode => "false" ,
+		inspire => "spatial data service type",
+		inspiremandatory => "true",
+		iso_name => "topic category",
+		html => _mb("Spatial data service type"),
+		value => "",
+		category => "classification",
+		description => _mb("This is a classification to assist in the search of available spatial data services. A specific service shall be categorised in only one category. The value domain of this metadata element is defined in Part D.3.")
+	),
+//B3 Keyword
+//B 3.1 keyword value dataset
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:keyword/gco:CharacterString",
+		iso19139explode => "true" ,
+		inspire => "keyword value",
+		inspiremandatory => "true",
+		iso_name => "keywordValue",
+		html => _mb("Keyword value"),
+		value => "",
+		category => "keyword",
+		description => _mb("If the resource is a spatial data service, at least one keyword from Part D.4 shall be provided. If a resource is a spatial data set or spatial data set series, at least one keyword shall be provided from the general environmental multilingual thesaurus (GEMET) describing the relevant spatial data theme as defined in Annex I, II or III to Directive 2007/2/EC.")
+	),
+//B 4 Geographic Location
+//B 4.1 Geographic bounding box
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/*/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/*/gco:Decimal",
+		iso19139explode => "true" ,
+		inspire => "geographic bounding box",
+		inspiremandatory => "true",
+		iso_name => "geographic bounding box",
+		html => _mb("Geographic bounding box"),
+		value => "",
+		category => "location",
+		description => _mb("This is the extent of the resource in the geographic space, given as a bounding box. The bounding box shall be expressed with westbound and eastbound longitudes, and southbound and northbound latitudes in decimal degrees, with a precision of at least two decimals.")
+	),
+//B 5. Temporal reference
+//B 5.1 Temporal extent
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_EX_TemporalExtent/gmd:extent/gml:TimePeriod/*",
+		iso19139explode => "false" ,
+		inspire => "temporal extent",
+		inspiremandatory => "false",
+		iso_name => "Temporal extent",
+		html => _mb("Temporal extent"),
+		value => "",
+		category => "actuality",
+		description => _mb("The temporal extent defines the time period covered by the content of the resource. This time period may be expressed as any of the following: - an individual date, - an interval of dates expressed through the starting date and end date of the interval, - a mix of individual dates and intervals of dates.")
+	),
+//B 5.2 Date of publication
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date[gmd:dateType/gmd:CI_DateTypeCode/@codeListValue='publication']/gmd:date/*",
+		iso19139explode => "false" ,
+		inspire => "date of publication",
+		inspiremandatory => "true",
+		iso_name => "date of publication",
+		html => _mb("Date of publication"),
+		value => "",
+		category => "actuality",
+		description => _mb("This is the date of publication of the resource when available, or the date of entry into force. There may be more than one date of publication.")
+	),
+//B 5.3 Date of last revision
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date[gmd:dateType/gmd:CI_DateTypeCode/@codeListValue='revision']/gmd:date/*",
+		iso19139explode => "false" ,
+		inspire => "date of last revision",
+		inspiremandatory => "true",
+		iso_name => "date of last revision",
+		html => _mb("Date of last revision"),
+		value => "",
+		category => "actuality",
+		description => _mb("This is the date of last revision of the resource, if the resource has been revised. There shall not be more than one date of last revision.")
+	),
+//B 5.4 Date of creation
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date[gmd:dateType/gmd:CI_DateTypeCode/@codeListValue='creation']/gmd:date/*",
+		iso19139explode => "false" ,
+		inspire => "date of creation",
+		inspiremandatory => "true",
+		iso_name => "date of creation",
+		html => _mb("Date of creation"),
+		value => "",
+		category => "actuality",
+		description => _mb("This is the date of creation of the resource. There shall not be more than one date of creation.")
+	),
+//B 6. Quality and validity
+//B 6.1 Lineage
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:lineage/gmd:LI_Lineage/gmd:statement/gco:CharacterString",
+		iso19139explode => "false" ,
+		inspire => "lineage",
+		inspiremandatory => "true",
+		iso_name => "lineage",
+		html => _mb("Lineage"),
+		value => "",
+		category => "quality",
+		description => _mb("This is a statement on process history and/or overall quality of the spatial data set. Where appropriate it may include a statement whether the data set has been validated or quality assured, whether it is the official version (if multiple versions exist), and whether it has legal validity.")
+	),
+
+//B 6.2 Spatial Resolution
+//B 6.2.1 equivalent scale 
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:spatialResolution/gmd:MD_Resolution/gmd:equivalentScale/gmd:MD_RepresentativeFraction/gmd:denominator/gco:Integer",
+		iso19139explode => "false" ,
+		inspire => "equivalent scale",
+		inspiremandatory => "true",
+		iso_name => "equivalent scale",
+		html => _mb("Equivalent scale"),
+		value => "",
+		category => "resolution",
+		description => _mb("An equivalent scale is generally expressed as an integer value expressing the scale denominator.")
+	),
+//B 6.2.2 ground distance
+//B 6.2.2.1 ground distance value
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:spatialResolution/gmd:MD_Resolution/gmd:distancegco:Distance",
+		iso19139explode => "false" ,
+		inspire => "ground distance value",
+		inspiremandatory => "true",
+		iso_name => "groundDistanceValue",
+		html => _mb("Ground Distance Value"),
+		value => "",
+		category => "resolution",
+		description => _mb("A resolution distance shall be expressed as a numerical value associated with a unit of length.")
+	),
+//B 6.2.2.1 ground distance value
+//TODO maybe everytime m? or parse the href ...
+//B 7. Conformity
+//B 7.1. Specification
+//B 7.1.1 Title
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult/gmd:specification/gmd:CI_Citation/gmd:title/gco:CharacterString",
+		iso19139explode => "false" ,
+		inspire => "Specification title",
+		inspiremandatory => "true",
+		iso_name => "Specification title",
+		html => _mb("Specification title"),
+		value => "",
+		category => "quality",
+		description => _mb("This is a citation of the implementing rules adopted under Article 7(1) of Directive 2007/2/EC or other specification to which a particular resource conforms. A resource may conform to more than one implementing rules adopted under Article 7(1) of Directive 2007/2/EC or other specification. This citation shall include at least the title and a reference date (date of publication, date of last revision or of creation) of the implementing rules adopted under Article 7(1) of Directive 2007/2/EC or of the specification.")
+	),
+//B 7.1.2 Reference Date
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult/gmd:specification/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date/*",
+		iso19139explode => "false" ,
+		inspire => "specification reference date",
+		inspiremandatory => "true",
+		iso_name => "Specification reference date",
+		html => _mb("Specification reference date"),
+		value => "",
+		category => "quality",
+		description => _mb("This is a citation of the implementing rules adopted under Article 7(1) of Directive 2007/2/EC or other specification to which a particular resource conforms. A resource may conform to more than one implementing rules adopted under Article 7(1) of Directive 2007/2/EC or other specification. This citation shall include at least the title and a reference date (date of publication, date of last revision or of creation) of the implementing rules adopted under Article 7(1) of Directive 2007/2/EC or of the specification.")
+	),
+//B 7.2. Degree
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult/gmd:pass/gco:Boolean",
+		iso19139explode => "false" ,
+		inspire => "deegree of conformance",
+		inspiremandatory => "true",
+		iso_name => "Deegree of conformance",
+		html => _mb("Deegree of conformance"),
+		value => "",
+		category => "quality",
+		description => _mb("This is the degree of conformity of the resource to the implementing rules adopted under Article 7(1) of Directive 2007/2/EC or other specification. The value domain of this metadata element is defined in Part D.")
+	),
+//B 8. Constraints related to access and use
+//B 8.1. Conditions applying to access and use
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:resourceConstraints/gmd:MD_Constraints/gmd:useLimitation/gco:CharacterString",
+		iso19139explode => "false" ,
+		inspire => "conditions applying to access and use",
+		inspiremandatory => "true",
+		iso_name => "conditions applying to access and use",
+		html => _mb("Conditions applying to access and use"),
+		value => "",
+		category => "useconstraints",
+		description => _mb("A set of conditions applying to access and use.")
+	),
+//B 8.2. Limitations on public access
+//B 8.2.1 access constraints codelist
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:accessConstraints/gmd:MD_RestrictionCode/@codeListValue",
+		iso19139explode => "false" ,
+		inspire => "access constraints code",
+		inspiremandatory => "true",
+		iso_name => "access constraints code",
+		html => _mb("Access constraints code"),
+		value => "",
+		category => "useconstraints",
+		description => _mb("Code for access constraints")
+	),
+
+//B 8.2.2 other constraints
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:otherConstraints/gco:CharacterString",
+		iso19139explode => "false" ,
+		inspire => "other constraints",
+		inspiremandatory => "true",
+		iso_name => "other constraints",
+		html => _mb("Other constraints"),
+		value => "",
+		category => "useconstraints",
+		description => _mb("Other constraints")
+	),
+
+//B 9. Organisations responsible for the establishment, management, maintance and distribution of spatial data sets and services
+//B 9.1. Responsible party
+//B 9.1.1 Responsible party name
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:pointOfContact/gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString",
+		iso19139explode => "false" ,
+		inspire => "responsible party name",
+		inspiremandatory => "true",
+		iso_name => "responsible party name",
+		html => _mb("Responsible party name"),
+		value => "",
+		category => "contact",
+		description => _mb("The name of the organisation as free text.")
+	),
+//B 9.1.2 Responsible party email
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:pointOfContact/gmd:CI_ResponsibleParty/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress/gco:CharacterString",
+		iso19139explode => "false" ,
+		inspire => "responsible party email",
+		inspiremandatory => "true",
+		iso_name => "responsible party email",
+		html => _mb("Responsible party email"),
+		value => "",
+		category => "contact",
+		description => _mb("A contact e-mail address as a character string.")
+	),
+//B 9.2 Responsible party role
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:pointOfContact/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode/@codeListValue",
+		iso19139explode => "false" ,
+		inspire => "responsible party role",
+		inspiremandatory => "true",
+		iso_name => "responsible party role",
+		html => _mb("Responsible party role"),
+		value => "",
+		category => "contact",
+		description => _mb("This is the role of the responsible organisation. The value domain of this metadata element is defined in Part D.")
+	),
+//B 10 Metadata on metadata
+//B 10.1. Metadata point of contact
+//B 10.1.1 Metadata point of contact name
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:contact/gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString",
+		iso19139explode => "false" ,
+		inspire => "metadata point of contact name",
+		inspiremandatory => "true",
+		iso_name => "Metadata point of contact name",
+		html => _mb("Metadata point of contact name"),
+		value => "",
+		category => "contact",
+		description => _mb("The name of the organisation as free text.")
+	),
+//B 10.1.2 Metadata point of contact email
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:contact/gmd:CI_ResponsibleParty/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress/gco:CharacterString",
+		iso19139explode => "false" ,
+		inspire => "metadata point of contact email",
+		inspiremandatory => "true",
+		iso_name => "Metadata point of contact email",
+		html => _mb("Metadata point of contact email"),
+		value => "",
+		category => "contact",
+		description => _mb("A contact e-mail address as a character string.")
+	),
+//B 10.2. Metadata date
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:dateStamp/*",
+		iso19139explode => "false" ,
+		inspire => "metadata date",
+		inspiremandatory => "true",
+		iso_name => "Metadata date",
+		html => _mb("Metadata date"),
+		value => "",
+		category => "metadata",
+		description => _mb("The date which specifies when the metadata record was created or updated. This date shall be expressed in conformity with ISO 8601.")
+	),
+//B 10.3. Metadata language
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:language/gmd:LanguageCode/@codeListValue",
+		iso19139explode => "false" ,
+		inspire => "metadata language",
+		inspiremandatory => "true",
+		iso_name => "Metadata language",
+		html => _mb("Metadata language"),
+		value => "",
+		category => "metadata",
+		description => _mb("This is the language in which the metadata elements are expressed. The value domain of this metadata element is limited to the official languages of the Community expressed in conformity with ISO 639-2.")
+	),
+
+//Additional Metadata Elements from the Data Specs
+//Metadata required for interoperability
+//TODO!!
+/*
+https://geo-ide.noaa.gov/wiki/index.php?title=ISO_Boilerplate
+<gmd:referenceSystemInfo>
+    <gmd:MD_ReferenceSystem>
+        <gmd:referenceSystemIdentifier>
+            <gmd:RS_Identifier>
+                <gmd:authority>
+                    <gmd:CI_Citation>
+                        <gmd:title>
+                            <gco:CharacterString>European Petroleum Survey Group (EPSG) Geodetic Parameter Registry</gco:CharacterString>
+                        </gmd:title>
+                        <gmd:date>
+                            <gmd:CI_Date>
+                                <gmd:date>
+                                    <gco:Date>2008-11-12</gco:Date>
+                                </gmd:date>
+                                <gmd:dateType>
+                                    <gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="publication">publication</gmd:CI_DateTypeCode>
+                                </gmd:dateType>
+                            </gmd:CI_Date>
+                        </gmd:date>
+                        <gmd:citedResponsibleParty>
+                            <gmd:CI_ResponsibleParty>
+                                <gmd:organisationName>
+                                    <gco:CharacterString>European Petroleum Survey Group</gco:CharacterString>
+                                </gmd:organisationName>
+                                <gmd:contactInfo>
+                                    <gmd:CI_Contact>
+                                        <gmd:onlineResource>
+                                            <gmd:CI_OnlineResource>
+                                                <gmd:linkage>
+                                                    <gmd:URL>http://www.epsg-registry.org/</gmd:URL>
+                                                </gmd:linkage>
+                                            </gmd:CI_OnlineResource>
+                                        </gmd:onlineResource>
+                                    </gmd:CI_Contact>
+                                </gmd:contactInfo>
+                                <gmd:role gco:nilReason="missing"/>
+                            </gmd:CI_ResponsibleParty>
+                        </gmd:citedResponsibleParty>                            
+                    </gmd:CI_Citation>
+                </gmd:authority>
+                <gmd:code>
+                    <gco:CharacterString>urn:ogc:def:crs:EPSG:4326</gco:CharacterString>
+                </gmd:code>
+                <gmd:version>
+                    <gco:CharacterString>6.18.3</gco:CharacterString>
+                </gmd:version>
+            </gmd:RS_Identifier>
+        </gmd:referenceSystemIdentifier>
+    </gmd:MD_ReferenceSystem>
+</gmd:referenceSystemInfo>
+
+*/
+
+
+//1. Coordinate Reference System
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:RS_Identifier/gmd:code/gco:CharacterString",
+		iso19139explode => "false" ,
+		inspire => "coordinate reference system",
+		inspiremandatory => "true",
+		iso_name => "coordinate reference system",
+		html => _mb("Coordinate reference system"),
+		value => "",
+		category => "dataspec",
+		description => _mb("Description of the coordinate reference system(s) used in the data set.")
+	),
+
+/*
+//2. Temporal Reference System - only mandatory if not the standard system!
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:language/gmd:LanguageCode/@codeListValue",
+		iso19139explode => "false" ,
+		inspire => "temporal reference system",
+		inspiremandatory => "true",
+		iso_name => "temporal reference system",
+		html => _mb("Temporal reference system"),
+		value => "",
+		category => "dataspec",
+		description => _mb("Description of the temporal reference system(s) used in the data set. This element is mandatory only if the spatial data set contains temporal information that does not refer to the default temporal reference system.")
+	),
+*/
+//3. Encoding
+
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:MD_DataIdentification/gmd:distributionInfo/gmd:MD_Distribution/gmd:distributionFormat/gmd:MD_Format/gmd:name/gco:CharacterString",
+		iso19139explode => "false" ,
+		inspire => "encoding",
+		inspiremandatory => "true",
+		iso_name => "encoding",
+		html => _mb("Encoding"),
+		value => "",
+		category => "dataspec",
+		description => _mb("Description of the computer language construct(s) specifying the representation of data objects in a record, file, message, storage device or transmission channel.")
+	),
+/*
+//4. Topological Consistency
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:language/gmd:LanguageCode/@codeListValue",
+		iso19139explode => "false" ,
+		inspire => "topological Consistency",
+		inspiremandatory => "true",
+		iso_name => "topological Consistency",
+		html => _mb("Topological Consistency"),
+		value => "",
+		category => "dataspec",
+		description => _mb("Correctness of the explicitly encoded topological characteristics of the data set as described by the scope. This element is mandatory only if the data set includes types from the Generic Network Model and does not assure centreline topology (connectivity of centrelines) for the network.")
+	),
+*/
+//5. Character Encoding
+/*<gmd:characterSet>
+  <gmd:MD_CharacterSetCode
+    codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode"
+    codeListValue="UTF8">UTF8</gmd:MD_CharacterSetCode>
+</gmd:characterSet>
+*/
+	array(	ibus => "t01_object.obj_id",
+		iso19139 => "/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:characterSet/gmd:MD_CharacterSetCode/@codeListValue",
+		iso19139explode => "false" ,
+		inspire => "character Encoding",
+		inspiremandatory => "true",
+		iso_name => "character Encoding",
+		html => _mb("Character Encoding"),
+		value => "",
+		category => "dataspec",
+		description => _mb("The character encoding used in the data set. This element is mandatory only if an encoding is used that is not based on UTF-8.")
 	)
+
 );
 
 
@@ -119,18 +713,28 @@
 $openSearchDetailXML->registerXPathNamespace("srv", "http://www.isotc211.org/2005/srv");
 
 
-if ($_REQUEST['mdtype']=='iso19139') {
+if ($_REQUEST['mdtype']=='iso19139' && $_REQUEST['validate'] != 'true') {
 	header("Content-type: application/xhtml+xml; charset=UTF-8");
 	//delete scw entries from response file
 	$MD_Metadata = str_replace('<csw:GetRecordByIdResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2">', '', $openSearchDetail);
 	$MD_Metadata = str_replace('</csw:GetRecordByIdResponse>', '', $MD_Metadata);
 	echo $MD_Metadata;
 	die();
-}	
+}
+if ($_REQUEST['mdtype']=='iso19139' && $_REQUEST['validate'] == 'true') {
+	$MD_Metadata = str_replace('<csw:GetRecordByIdResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2">', '', $openSearchDetail);
+	$MD_Metadata = str_replace('</csw:GetRecordByIdResponse>', '', $MD_Metadata);
+	validateInspireMetadataFromData($MD_Metadata);
+}
 
 
 
 
+
+
+
+
+
 	#count unidentified elements
 	$i=0;
 	#get list for ibus variables - cause php is row major
@@ -148,12 +752,15 @@
 	$j=0;
 	switch ($os_list[0] ['version']) {
     		case 2:
-			#echo $url."<br><br>";
+			echo "<a href='".$url."'>GetRecordById URL</a><br><br>";
 			//register namespaces: 
 /* <gmd:MD_Metadata xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gml="http://www.opengis.net/gml" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:srv="http://www.isotc211.org/2005/srv" id="_ingrid-group_iplug-rp-udk-db_263">*/
 			for($a = 0; $a < count($md_ident); $a++) {
 				$resultOfXpath = $openSearchDetailXML->xpath('/csw:GetRecordByIdResponse'.$md_ident[$a]['iso19139']);
-				$md_ident[$a]['value'] = $resultOfXpath[0];
+				for ($i = 0; $i < count($resultOfXpath); $i++) {
+					$md_ident[$a]['value'] = $md_ident[$a]['value'].",".$resultOfXpath[$i];
+				}
+				$md_ident[$a]['value'] = ltrim($md_ident[$a]['value'],',');
 				echo "<b>".$md_ident[$a]['html']."</b>: ".$md_ident[$a]['value']."<br><br>";
 			}
 			echo "Version of PortalU CSW interface is currently not yet full supported! We work on the new Interface.<br> Please use the link <b>Originäre Metadaten</b> instead.";

Modified: trunk/mapbender/http/php/mod_dataISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_dataISOMetadata.php	2011-06-29 14:04:21 UTC (rev 7892)
+++ trunk/mapbender/http/php/mod_dataISOMetadata.php	2011-06-30 14:26:39 UTC (rev 7893)
@@ -980,8 +980,161 @@
 	$MD_DataIdentification->appendChild($extent);
 
 
+	
+
+//reference system
+/*
+https://geo-ide.noaa.gov/wiki/index.php?title=ISO_Boilerplate
+<gmd:referenceSystemInfo>
+    <gmd:MD_ReferenceSystem>
+        <gmd:referenceSystemIdentifier>
+            <gmd:RS_Identifier>
+                <gmd:authority>
+                    <gmd:CI_Citation>
+                        <gmd:title>
+                            <gco:CharacterString>European Petroleum Survey Group (EPSG) Geodetic Parameter Registry</gco:CharacterString>
+                        </gmd:title>
+                        <gmd:date>
+                            <gmd:CI_Date>
+                                <gmd:date>
+                                    <gco:Date>2008-11-12</gco:Date>
+                                </gmd:date>
+                                <gmd:dateType>
+                                    <gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="publication">publication</gmd:CI_DateTypeCode>
+                                </gmd:dateType>
+                            </gmd:CI_Date>
+                        </gmd:date>
+                        <gmd:citedResponsibleParty>
+                            <gmd:CI_ResponsibleParty>
+                                <gmd:organisationName>
+                                    <gco:CharacterString>European Petroleum Survey Group</gco:CharacterString>
+                                </gmd:organisationName>
+                                <gmd:contactInfo>
+                                    <gmd:CI_Contact>
+                                        <gmd:onlineResource>
+                                            <gmd:CI_OnlineResource>
+                                                <gmd:linkage>
+                                                    <gmd:URL>http://www.epsg-registry.org/</gmd:URL>
+                                                </gmd:linkage>
+                                            </gmd:CI_OnlineResource>
+                                        </gmd:onlineResource>
+                                    </gmd:CI_Contact>
+                                </gmd:contactInfo>
+                                <gmd:role gco:nilReason="missing"/>
+                            </gmd:CI_ResponsibleParty>
+                        </gmd:citedResponsibleParty>                            
+                    </gmd:CI_Citation>
+                </gmd:authority>
+                <gmd:code>
+                    <gco:CharacterString>urn:ogc:def:crs:EPSG:4326</gco:CharacterString>
+                </gmd:code>
+                <gmd:version>
+                    <gco:CharacterString>6.18.3</gco:CharacterString>
+                </gmd:version>
+            </gmd:RS_Identifier>
+        </gmd:referenceSystemIdentifier>
+    </gmd:MD_ReferenceSystem>
+</gmd:referenceSystemInfo>
+*/
+
+	$gmd_referenceSystemInfo=$iso19139->createElement("gmd:referenceSystemInfo");
+	$gmd_MD_ReferenceSystem=$iso19139->createElement("gmd:MD_ReferenceSystem");
+	$gmd_referenceSystemIdentifier=$iso19139->createElement("gmd:referenceSystemIdentifier");
+	$gmd_RS_Identifier=$iso19139->createElement("gmd:RS_Identifier");
+	$gmd_authority=$iso19139->createElement("gmd:authority");
+	$gmd_CI_Citation=$iso19139->createElement("gmd:CI_Citation");
+	$gmd_title=$iso19139->createElement("gmd:title");
+	$gmd_title_cs=$iso19139->createElement("gco:CharacterString");
+	$gmd_title_Text=$iso19139->createTextNode("European Petroleum Survey Group (EPSG) Geodetic Parameter Registry");
+
+	$gmd_title_cs->appendChild($gmd_title_Text);
+	$gmd_title->appendChild($gmd_title_cs);
+	$gmd_CI_Citation->appendChild($gmd_title);
+
+	$gmd_date=$iso19139->createElement("gmd:date");
+	$gmd_CI_Date=$iso19139->createElement("gmd:CI_Date");
+	$gmd_date2=$iso19139->createElement("gmd:date");
+	$gco_Date=$iso19139->createElement("gco:Date");
+	$gmd_dateType=$iso19139->createElement("gmd:dateType");
+	$gmd_CI_DateTypeCode=$iso19139->createElement("gmd:CI_DateTypeCode");
+	$gmd_CI_DateTypeCode_Text=$iso19139->createTextNode("publication");
+	$gmd_CI_DateTypeCode->setAttribute("codeList", "http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode");
+	$gmd_CI_DateTypeCode->setAttribute("codeListValue", "publication");
+
+	$gmd_CI_DateTypeCode->appendChild($gmd_CI_DateTypeCode_Text);
+	$gmd_dateType->appendChild($gmd_CI_DateTypeCode);
+	$gco_Date->appendChild($gmd_dateType);
+	$gmd_date2->appendChild($gco_Date);
+	$gmd_CI_Date->appendChild($gmd_date2);
+	$gmd_date->appendChild($gmd_CI_Date);
+	$gmd_CI_Citation->appendChild($gmd_date);
+
+	$gmd_citedResponsibleParty=$iso19139->createElement("gmd:citedResponsibleParty");
+	$gmd_CI_ResponsibleParty=$iso19139->createElement("gmd:CI_ResponsibleParty");
+	$gmd_organisationName=$iso19139->createElement("gmd:organisationName");
+	$gmd_organisationName_cs=$iso19139->createElement("gco:CharacterString");
+	$gmd_organisationName_Text=$iso19139->createTextNode("European Petroleum Survey Group");
+
+	$gmd_organisationName_cs->appendChild($gmd_organisationName_Text);
+	$gmd_organisationName->appendChild($gmd_organisationName_cs);
+	$gmd_CI_ResponsibleParty->appendChild($gmd_organisationName);
+	
+
+
+
+	$gmd_contactInfo=$iso19139->createElement("gmd:contactInfo");
+	$gmd_CI_Contact=$iso19139->createElement("gmd:CI_Contact");
+	$gmd_onlineResource=$iso19139->createElement("gmd:onlineResource");
+	$gmd_CI_OnlineResource=$iso19139->createElement("gmd:CI_OnlineResource");
+	$gmd_linkage=$iso19139->createElement("gmd:linkage");
+	$gmd_URL=$iso19139->createElement("gmd:URL");
+	$gmd_URL_Text=$iso19139->createTextNode("http://www.epsg-registry.org/");
+	
+	$gmd_URL->appendChild($gmd_URL_Text);
+	$gmd_linkage->appendChild($gmd_URL);
+	$gmd_CI_OnlineResource->appendChild($gmd_linkage);
+	$gmd_onlineResource->appendChild($gmd_CI_OnlineResource);
+	$gmd_CI_Contact->appendChild($gmd_onlineResource);
+	$gmd_contactInfo->appendChild($gmd_CI_Contact);
+
+	$gmd_CI_ResponsibleParty->appendChild($gmd_contactInfo);
+
+	$gmd_role=$iso19139->createElement("gmd:role");
+	$gmd_role->setAttribute("gco:nilReason", "missing");
+	
+	$gmd_CI_ResponsibleParty->appendChild($gmd_role);
+
+	$gmd_citedResponsibleParty->appendChild($gmd_CI_ResponsibleParty);
+	$gmd_CI_Citation->appendChild($gmd_citedResponsibleParty);
+	$gmd_authority->appendChild($gmd_CI_Citation);
+
+	$gmd_RS_Identifier->appendChild($gmd_authority);
+
+	$gmd_code=$iso19139->createElement("gmd:code");
+	$gmd_code_cs=$iso19139->createElement("gco:CharacterString");
+	$gmd_code_text=$iso19139->createTextNode("urn:ogc:def:crs:".$mb_metadata['ref_system']);
+	
+	$gmd_code_cs->appendChild($gmd_code_text);
+	$gmd_code->appendChild($gmd_code_cs);
+	$gmd_RS_Identifier->appendChild($gmd_code);
+
+	$gmd_version=$iso19139->createElement("gmd:version");
+	$gmd_version_cs=$iso19139->createElement("gco:CharacterString");
+	$gmd_version_text=$iso19139->createTextNode("6.18.3");
+	
+	$gmd_version_cs->appendChild($gmd_version_text);
+	$gmd_version->appendChild($gmd_version_cs);
+	$gmd_RS_Identifier->appendChild($gmd_version);
+	
+	$gmd_referenceSystemIdentifier->appendChild($gmd_RS_Identifier);
+	$gmd_MD_ReferenceSystem->appendChild($gmd_referenceSystemIdentifier);
+	$gmd_referenceSystemInfo->appendChild($gmd_MD_ReferenceSystem);
+
+	$MD_DataIdentification->appendChild($gmd_referenceSystemInfo);
+
 	$identificationInfo->appendChild($MD_DataIdentification);
 
+
 //distributionInfo
 	$gmd_distributionInfo=$iso19139->createElement("gmd:distributionInfo");
 	$MD_Distribution=$iso19139->createElement("gmd:MD_Distribution");
@@ -1029,9 +1182,6 @@
 	$MD_Format->appendChild($gmd_name);
 	$MD_Format->appendChild($gmd_version);
 
-
-
-
 	$gmd_distributionFormat->appendChild($MD_Format);
 
 	$MD_Distribution->appendChild($gmd_distributionFormat);
@@ -1046,9 +1196,9 @@
 	$DQ_Scope=$iso19139->createElement("gmd:DQ_Scope");
 	$gmd_level=$iso19139->createElement("gmd:level");
 	$MD_ScopeCode=$iso19139->createElement("gmd:MD_ScopeCode");
-	$MD_ScopeCodeText=$iso19139->createTextNode("service");
-	$MD_ScopeCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#MD_RetrictionCode");
-	$MD_ScopeCode->setAttribute("codeListValue", "service");
+	$MD_ScopeCodeText=$iso19139->createTextNode("dataset");
+	$MD_ScopeCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#MD_RestrictionCode");
+	$MD_ScopeCode->setAttribute("codeListValue", "dataset");
 	$MD_ScopeCode->appendChild($MD_ScopeCodeText);
 	$gmd_level->appendChild($MD_ScopeCode);
 	$DQ_Scope->appendChild($gmd_level);



More information about the Mapbender_commits mailing list