[Mapbender-commits] r8177 - in trunk/mapbender/http: php plugins
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Oct 6 10:03:05 EDT 2011
Author: armin11
Date: 2011-10-06 07:03:05 -0700 (Thu, 06 Oct 2011)
New Revision: 8177
Modified:
trunk/mapbender/http/php/mod_dataISOMetadata.php
trunk/mapbender/http/php/mod_layerISOMetadata.php
trunk/mapbender/http/plugins/mb_metadata_layerTree.js
trunk/mapbender/http/plugins/mb_metadata_server.php
trunk/mapbender/http/plugins/mb_metadata_showMetadataAddon.js
Log:
Some bugfixes for service-data coupling and restore validation against the gdi-de testsuite (xml schema validation had problems with dynamic generated metadata).
Modified: trunk/mapbender/http/php/mod_dataISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_dataISOMetadata.php 2011-10-03 18:55:55 UTC (rev 8176)
+++ trunk/mapbender/http/php/mod_dataISOMetadata.php 2011-10-06 14:03:05 UTC (rev 8177)
@@ -262,7 +262,9 @@
$MD_Metadata->setAttribute("xmlns:gco", "http://www.isotc211.org/2005/gco");
$MD_Metadata->setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
$MD_Metadata->setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
- $MD_Metadata->setAttribute("xsi:schemaLocation", "http://www.isotc211.org/2005/gmd ./xsd/gmd/gmd.xsd://www.isotc211.org/2005/srv ./xsd/srv/srv.xsd");
+ #$MD_Metadata->setAttribute("xsi:schemaLocation", "http://www.isotc211.org/2005/gmd ./xsd/gmd/gmd.xsd://www.isotc211.org/2005/srv ./xsd/srv/srv.xsd");
+$MD_Metadata->setAttribute("xsi:schemaLocation", "http://www.isotc211.org/2005/gmd");
+//$MD_Metadata->setAttribute("xsi:schemaLocation=","http://www.isotc211.org/2005/gmd http://schemas.opengis.net/iso/19139/20060504/gmd/gmd.xsd");
//generate fileidentifier part (metadata record identification)
$identifier = $iso19139->createElement("gmd:fileIdentifier");
@@ -295,7 +297,7 @@
//generate Characterset
$characterSet = $iso19139->createElement("gmd:characterSet");
$characterSetCode = $iso19139->createElement("gmd:MD_CharacterSetCode");
- $characterSetCode->setAttribute("codeList", "./resources/codeList.xml#MD_CharacterSetCode");
+ $characterSetCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#MD_CharacterSetCode");
$characterSetCode->setAttribute("codeListValue", $mb_metadata['inspire_charset']);
$characterSet->appendChild($characterSetCode);
$characterSet = $MD_Metadata->appendChild($characterSet);
@@ -367,7 +369,7 @@
$dateStamp = $iso19139->createElement("gmd:dateStamp");
$mddate = $iso19139->createElement("gco:Date");
if (isset($mb_metadata['lastchanged'])) {
- $mddateText = $iso19139->createTextNode(date("Y-m-d h:i:s",$mb_metadata['lastchanged']));
+ $mddateText = $iso19139->createTextNode(date("Y-m-d",$mb_metadata['lastchanged']));
}
else {
$mddateText = $iso19139->createTextNode("2000-01-01");
@@ -389,7 +391,165 @@
$metadataStandardVersion->appendChild($metadataStandardVersionText);
$MD_Metadata->appendChild($metadataStandardName);
$MD_Metadata->appendChild($metadataStandardVersion);
+#fill in reference system info - maybe this is not a good position for it
+//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");
+ $gco_DateText=$iso19139->createTextNode("2008-11-12");
+
+ $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($gco_DateText);
+ $gmd_date2->appendChild($gco_Date);
+
+ $gmd_CI_Date->appendChild($gmd_date2);
+ $gmd_CI_Date->appendChild($gmd_dateType);
+
+ $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_Metadata->appendChild($gmd_referenceSystemInfo);
+
+
#do the things for identification
$identificationInfo=$iso19139->createElement("gmd:identificationInfo");
$MD_DataIdentification=$iso19139->createElement("gmd:MD_DataIdentification");
@@ -422,7 +582,7 @@
$dateTypeCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode");
$dateTypeCode->setAttribute("codeListValue", "publication");
$dateTypeCodeText=$iso19139->createTextNode('publication');
- $dateText= $iso19139->createTextNode(date("Y-m-d h:i:s",$mb_metadata['createdate']));
+ $dateText= $iso19139->createTextNode(date("Y-m-d",$mb_metadata['createdate']));
$dateTypeCode->appendChild($dateTypeCodeText);
$dateType->appendChild($dateTypeCode);
$gcoDate->appendChild($dateText);
@@ -435,50 +595,50 @@
#Do things for B 5.3 date of revision
//this should be created from the information of maintenance if available
//some initialization for the temporal extent:
- $beginPositionValue = $mb_metadata['tmp_reference_1'];
- $endPositionValue = $mb_metadata['tmp_reference_2'];
- $dateOfLastRevision = date('Y-m-d h:i:s');
+ $beginPositionValue = date('Y-m-d',strtotime($mb_metadata['tmp_reference_1']));
+ $endPositionValue = date('Y-m-d',strtotime($mb_metadata['tmp_reference_2']));
+ $dateOfLastRevision = date('Y-m-d');
if (isset($mb_metadata['update_frequency']) && $mb_metadata['update_frequency'] != "") {
switch ($mb_metadata['update_frequency']) {
case ('continual'):
//set value to now
- $endPositionValue = date('Y-m-d h:i:s');
+ $endPositionValue = date('Y-m-d');
$dateOfLastRevision = $endPositionValue;
break;
case ('daily'):
//set value to now - one day
- $endPositionValue = date('Y-m-d h:i:s', mktime(0, 0, 0, date("m"), date("d")-1, date("Y")));
+ $endPositionValue = date('Y-m-d', mktime(0, 0, 0, date("m"), date("d")-1, date("Y")));
$dateOfLastRevision = $endPositionValue;
break;
case ('weekly'):
//set value to now - one week
- $endPositionValue = date('Y-m-d h:i:s', mktime(0, 0, 0, date("m"), date("d")-7, date("Y")));
+ $endPositionValue = date('Y-m-d', mktime(0, 0, 0, date("m"), date("d")-7, date("Y")));
$dateOfLastRevision = $endPositionValue;
break;
case ('fortnightly'):
//set value to now - two weeks
- $endPositionValue = date('Y-m-d h:i:s', mktime(0, 0, 0, date("m"), date("d")-14, date("Y")));
+ $endPositionValue = date('Y-m-d', mktime(0, 0, 0, date("m"), date("d")-14, date("Y")));
$dateOfLastRevision = $endPositionValue;
break;
case ('monthly'):
//set value to now - one month
- $endPositionValue = date('Y-m-d h:i:s', mktime(0, 0, 0, date("m")-1, date("d"), date("Y")));
+ $endPositionValue = date('Y-m-d', mktime(0, 0, 0, date("m")-1, date("d"), date("Y")));
$dateOfLastRevision = $endPositionValue;
break;
case ('quarterly'):
//set value to now - 3 months
- $endPositionValue = date('Y-m-d h:i:s', mktime(0, 0, 0, date("m")-3, date("d"), date("Y")));
+ $endPositionValue = date('Y-m-d', mktime(0, 0, 0, date("m")-3, date("d"), date("Y")));
$dateOfLastRevision = $endPositionValue;
break;
case ('biannually'):
//set value to now - half a year
- $endPositionValue = date('Y-m-d h:i:s', mktime(0, 0, 0, date("m")-6, date("d"), date("Y")));
+ $endPositionValue = date('Y-m-d', mktime(0, 0, 0, date("m")-6, date("d"), date("Y")));
$dateOfLastRevision = $endPositionValue;
break;
case ('annually'):
//set value to now - one year
- $endPositionValue = date('Y-m-d h:i:s', mktime(0, 0, 0, date("m"), date("d"), date("Y")-1));
+ $endPositionValue = date('Y-m-d', mktime(0, 0, 0, date("m"), date("d"), date("Y")-1));
$dateOfLastRevision = $endPositionValue;
break;
default:
@@ -828,9 +988,16 @@
/* Example
<gmd:spatialResolution><gmd:MD_Resolution><gmd:distance><gco:Distance uom="m">3.0</gco:Distance></gmd:distance></gmd:MD_Resolution></gmd:spatialResolution>
*/
- $spatialResolution=$iso19139->createElement("spatialResolution");
+ $spatialResolution=$iso19139->createElement("gmd:spatialResolution");
$MD_Resolution=$iso19139->createElement("gmd:MD_Resolution");
-
+
+ //Problem if scale is not set properly
+ if ($mb_metadata['spatial_res_value'] == '') {
+ $mb_metadata['spatial_res_value'] = 0;
+ }
+
+
+
if ($mb_metadata['spatial_res_type'] == 'groundDistance') {
$distance = $iso19139->createElement("gmd:distance");
$Distance = $iso19139->createElement("gmd:Distance");
@@ -1007,156 +1174,7 @@
-//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);
@@ -1222,7 +1240,7 @@
$gmd_level=$iso19139->createElement("gmd:level");
$MD_ScopeCode=$iso19139->createElement("gmd:MD_ScopeCode");
$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("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#MD_ScopeCode");
$MD_ScopeCode->setAttribute("codeListValue", "dataset");
$MD_ScopeCode->appendChild($MD_ScopeCodeText);
$gmd_level->appendChild($MD_ScopeCode);
@@ -1247,13 +1265,42 @@
$LI_Lineage->appendChild($statement);
$statement->appendChild($statement_cs);
$statement_cs->appendChild($statementText);
- $DQ_DataQuality->appendChild($lineage);
+
//gmd:report in dataQualityInfo
$gmd_report=$iso19139->createElement("gmd:report");
$DQ_DomainConsistency=$iso19139->createElement("gmd:DQ_DomainConsistency");
+ $DQ_DomainConsistency->setAttribute("xsi:type","gmd:DQ_DomainConsistency_Type");
+
+ //rs identifier - why?
+ //<gmd:measureIdentification>
+ $measureIdentification=$iso19139->createElement("gmd:measureIdentification");
+
+ $identifier=$iso19139->createElement("gmd:identifier");
+ $rs_identifier=$iso19139->createElement("gmd:RS_Identifier");
+
+ $code=$iso19139->createElement("gmd:code");
+ $code_cs=$iso19139->createElement("gco:CharacterString");
+ $codeText=$iso19139->createTextNode("Conformity_001");
+
+ $codeSpace=$iso19139->createElement("gmd:codeSpace");
+ $codeSpace_cs=$iso19139->createElement("gco:CharacterString");
+ $codeSpaceText=$iso19139->createTextNode("INSPIRE");
+
+ $code_cs->appendChild($codeText);
+ $code->appendChild($code_cs);
+ $rs_identifier->appendChild($code);
+
+ $codeSpace_cs->appendChild($codeSpaceText);
+ $codeSpace->appendChild($codeSpace_cs);
+ $rs_identifier->appendChild($codeSpace);
+ $measureIdentification->appendChild($rs_identifier);
+
+
+
$gmd_result=$iso19139->createElement("gmd:result");
$DQ_ConformanceResult=$iso19139->createElement("gmd:DQ_ConformanceResult");
+ $DQ_ConformanceResult->setAttribute("xsi:type","gmd:DQ_ConformanceResult_Type");
$gmd_specification=$iso19139->createElement("gmd:specification");
$CI_Citation=$iso19139->createElement("gmd:CI_Citation");
$gmd_title=$iso19139->createElement("gmd:title");
@@ -1299,11 +1346,14 @@
$DQ_ConformanceResult->appendChild($gmd_specification);
$DQ_ConformanceResult->appendChild($gmd_explanation);
$DQ_ConformanceResult->appendChild($gmd_pass);
+
+$DQ_DomainConsistency->appendChild($measureIdentification);
+
$gmd_result->appendChild($DQ_ConformanceResult);
$DQ_DomainConsistency->appendChild($gmd_result);
$gmd_report->appendChild($DQ_DomainConsistency);
$DQ_DataQuality->appendChild($gmd_report);
-
+ $DQ_DataQuality->appendChild($lineage);
$gmd_dataQualityInfo->appendChild($DQ_DataQuality);
//$MD_ScopeCode->setAttribute("codeListValue", "service");
$MD_Metadata->appendChild($identificationInfo);
Modified: trunk/mapbender/http/php/mod_layerISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_layerISOMetadata.php 2011-10-03 18:55:55 UTC (rev 8176)
+++ trunk/mapbender/http/php/mod_layerISOMetadata.php 2011-10-06 14:03:05 UTC (rev 8177)
@@ -839,9 +839,11 @@
$DQ_Scope->appendChild($gmd_level);
$gmd_scope->appendChild($DQ_Scope);
$DQ_DataQuality->appendChild($gmd_scope);
+
//gmd:report in dataQualityInfo
$gmd_report=$iso19139->createElement("gmd:report");
$DQ_DomainConsistency=$iso19139->createElement("gmd:DQ_DomainConsistency");
+ $DQ_DomainConsistency->setAttribute("xsi:type","gmd:DQ_DomainConsistency_Type");
$gmd_result=$iso19139->createElement("gmd:result");
$DQ_ConformanceResult=$iso19139->createElement("gmd:DQ_ConformanceResult");
$gmd_specification=$iso19139->createElement("gmd:specification");
Modified: trunk/mapbender/http/plugins/mb_metadata_layerTree.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_layerTree.js 2011-10-03 18:55:55 UTC (rev 8176)
+++ trunk/mapbender/http/plugins/mb_metadata_layerTree.js 2011-10-06 14:03:05 UTC (rev 8177)
@@ -40,8 +40,8 @@
var createLeaf = function (set) {
if (set.attr.layer_coupling != 0) {
//create html annex to title element
- //annex = set.attr.layer_title+" - "+set.attr.layer_coupling+" x coupled";
- annex = set.attr.layer_title;
+ annex = set.attr.layer_title+" - "+set.attr.layer_coupling+" x coupled";
+ //annex = set.attr.layer_title;
} else {
annex = set.attr.layer_title;
}
Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php 2011-10-03 18:55:55 UTC (rev 8176)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php 2011-10-06 14:03:05 UTC (rev 8177)
@@ -557,7 +557,24 @@
$ajaxResponse->setResult($resultObj);
$ajaxResponse->setSuccess(true);
break;
+ case "getWmsIdByLayerId" :
+ $layerId = $ajaxResponse->getParameter("layerId");
+ $sql = <<<SQL
+SELECT fkey_wms_id from layer where layer_id = $1
+
+SQL;
+ $v = array($layerId);
+ $t = array('i');
+ $res = db_prep_query($sql,$v,$t);
+ $row = array();
+ if ($res) {
+ $row = db_fetch_assoc($res);
+ $resultObj["wms_id"]= $row['fkey_wms_id'];
+ }
+ $ajaxResponse->setResult($resultObj);
+ $ajaxResponse->setSuccess(true);
+ break;
case "getLayerMetadataAddon" :
$layerId = $ajaxResponse->getParameter("layerId");
$metadataId = $ajaxResponse->getParameter("metadataId");
Modified: trunk/mapbender/http/plugins/mb_metadata_showMetadataAddon.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_showMetadataAddon.js 2011-10-03 18:55:55 UTC (rev 8176)
+++ trunk/mapbender/http/plugins/mb_metadata_showMetadataAddon.js 2011-10-06 14:03:05 UTC (rev 8177)
@@ -94,7 +94,8 @@
break;
}
//select the right list entries:
- $(".format_selectbox").val(obj.format); $(".charset_selectbox").val(obj.inspire_charset);
+ $(".format_selectbox").val(obj.format);
+ $(".charset_selectbox").val(obj.inspire_charset);
$(".ref_system_selectbox").val(obj.ref_system);
$(".cyclic_selectbox").val(obj.update_frequency);
$(".radioRes").filter('[value='+obj.spatial_res_type+']').attr('checked', true);
@@ -190,7 +191,25 @@
$("<img class='metadataEntry' title='new' src='../img/add.png' onclick='initMetadataAddon("+obj.md_metadata.metadata_id[i]+","+layerId+",true);return false;'/>").appendTo($("#metadataTable"));
}
-
+ getWmsId = function(layerId){
+ var req = new Mapbender.Ajax.Request({
+ url: "../plugins/mb_metadata_server.php",
+ method: "getWmsIdByLayerId",
+ parameters: {
+ "layerId": layerId
+ },
+ callback: function (obj, result, message) {
+ if (!result) {
+ return;
+ }
+ return obj;
+ }
+ });
+ req.send();
+ }
+
+
+
deleteAddedMetadata = function(metadataId, layerId){
// push metadata from server
var req = new Mapbender.Ajax.Request({
@@ -208,12 +227,14 @@
//fill MetadataURLs into metadata_selectbox_id
//update layer form to show edited data
that.fillLayerForm(layerId);
+ //alert(getWmsId(layerId));
$("<div></div>").text(message).dialog({
modal: true
});
}
});
- req.send();
+ req.send();
+ //Mapbender.modules.mb_md_layer_tree.init(950); klappt ganz gut aber wo steht die wms_id
}
@@ -254,7 +275,9 @@
that.updateAddedMetadata(metadataId, layerId, formData);
} else {
that.insertAddedMetadata(layerId, formData);
+
}
+ //$('#mb_md_layer_tree').refresh;
$(this).dialog('close');
}
},
More information about the Mapbender_commits
mailing list