[Mapbender-commits] r9513 - trunk/mapbender/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jun 9 02:12:23 PDT 2016
Author: armin11
Date: 2016-06-09 02:12:23 -0700 (Thu, 09 Jun 2016)
New Revision: 9513
Modified:
trunk/mapbender/http/classes/class_iso19139.php
Log:
Handle preview image url by internal metadata class
Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php 2016-06-09 09:11:44 UTC (rev 9512)
+++ trunk/mapbender/http/classes/class_iso19139.php 2016-06-09 09:12:23 UTC (rev 9513)
@@ -61,6 +61,7 @@
var $inspireCharset;
var $licenseSourceNote;
var $licenseJson;
+ var $previewImage;
//the following attribute is specific to predefined terms of use as they are managed by the mapbender database - it is the identifier (fkey) of an entry in the termsofuse table
var $termsOfUseRef;
var $accessConstraints;
@@ -129,6 +130,7 @@
$this->licenseJson = null;
$this->resourceResponsibleParty = null;
$this->resourceContactEmail = null;
+ $this->previewImage = null;
}
public function removeGetRecordTag ($xml) {
@@ -307,7 +309,14 @@
$this->transferSize = $this->transferSize[0];
} else {
$this->transferSize = null;
- }
+ }
+ //preview image
+ $this->previewImage = $iso19139Xml->xpath('//gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:graphicOverview/gmd:MD_BrowseGraphic/gmd:fileName/gco:CharacterString');
+ if (is_array($this->previewImage) && $this->previewImage[0] !== '') {
+ $this->previewImage = $this->previewImage[0];
+ } else {
+ $this->previewImage = null;
+ }
//$e = new mb_exception("class_iso19139.php: count of downloadlinks: ".count($this->downloadLinks));
//$this->downloadLinks = array_values($this->downloadLinks);
//$dump = var_export($this->downloadLinks, true);
@@ -1036,6 +1045,7 @@
$this->licenseSourceNote = $row['md_license_source_note'];
$this->resourceResponsibleParty = $row['responsible_party_name'];
$this->resourceContactEmail = $row['responsible_party_email'];
+ $this->previewImage = $row['preview_image'];
//get relations from other tables:
//get categories and keywords
//get isoCategories
@@ -1764,7 +1774,7 @@
//insert an instance for iso19139 into mapbenders database
$e = new mb_exception("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) 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)
+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) 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)
SQL;
$v = array(
$this->href,
@@ -1807,13 +1817,14 @@
$this->licenseSourceNote,
$this->accessConstraints,
$this->resourceResponsibleParty,
- $this->resourceContactEmail
+ $this->resourceContactEmail,
+ $this->previewImage
);
//$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');
+ $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');
$res = db_prep_query($sql,$v,$t);
return $res;
}
@@ -1871,7 +1882,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 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 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(
@@ -1916,10 +1927,11 @@
$this->licenseSourceNote,
$this->accessConstraints,
$this->resourceResponsibleParty,
- $this->resourceContactEmail
+ $this->resourceContactEmail,
+ $this->previewImage
);
//$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');
+ $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');
$res = db_prep_query($sql,$v,$t);
return $res;
}
More information about the Mapbender_commits
mailing list