add refdate import in ISO 19115
This commit is contained in:
parent
5c854c6e8a
commit
54ea3edac5
|
@ -191,11 +191,20 @@ class ISO19115
|
|||
$db->setFetchMode(Zend_Db::FETCH_OBJ);
|
||||
//save metadata into database
|
||||
try {
|
||||
$sql="insert into metadata (uuid,title,title_en,description,citation,suppinfo,fileformat,projection,datatype,filesize,ts_created,
|
||||
timebegin,timeend,west,south,north,east,doi) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
$db->query($sql,array($this->uuid,$this->resTitle,$this->resAltTitle,$this->idAbs,$this->citation,$this->suppinfo,$this->fileformat,
|
||||
if ($this->refDate)
|
||||
{
|
||||
$sql="insert into metadata (uuid,title,title_en,description,citation,suppinfo,fileformat,projection,datatype,filesize,ts_created,
|
||||
timebegin,timeend,west,south,north,east,doi,ts_published) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
$db->query($sql,array($this->uuid,$this->resTitle,$this->resAltTitle,$this->idAbs,$this->citation,$this->suppinfo,$this->fileformat,
|
||||
$this->projection,$this->datatype,$this->filesize,$this->mdDateSt,$this->timebegin,$this->timeend,$this->geoBox['w'],
|
||||
$this->geoBox['s'],$this->geoBox['n'],$this->geoBox['e'],$this->doi,$this->refDate));
|
||||
} else {
|
||||
$sql="insert into metadata (uuid,title,title_en,description,citation,suppinfo,fileformat,projection,datatype,filesize,ts_created,
|
||||
timebegin,timeend,west,south,north,east,doi) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
$db->query($sql,array($this->uuid,$this->resTitle,$this->resAltTitle,$this->idAbs,$this->citation,$this->suppinfo,$this->fileformat,
|
||||
$this->projection,$this->datatype,$this->filesize,$this->mdDateSt,$this->timebegin,$this->timeend,$this->geoBox['w'],
|
||||
$this->geoBox['s'],$this->geoBox['n'],$this->geoBox['e'],$this->doi));
|
||||
}
|
||||
$id=$db->lastInsertId('metadata','id');
|
||||
//处理在线资源
|
||||
if ($this->onlineresource) foreach($this->onlineresource as $resource)
|
||||
|
@ -549,6 +558,15 @@ class ISO19115
|
|||
}
|
||||
}
|
||||
}
|
||||
//resRefDate
|
||||
$refdates=$this->dom->getElementsByTagName('resRefDate');
|
||||
foreach($refdates as $refdate)
|
||||
{
|
||||
if ($refdate->getElementsByTagName('DateTypCd')->item(0) && $refdate->getElementsByTagName('DateTypCd')->item(0)->hasAttributes() && $refdate->getElementsByTagName('DateTypCd')->item(0)->attributes->getNamedItem('value')->nodeValue=="publication")
|
||||
{
|
||||
$this->refDate=$refdate->getElementsByTagName('refDate');
|
||||
}
|
||||
}
|
||||
//in ISO 19115 draft.
|
||||
$ds=$this->dom->getElementsByTagName('datasetSeries');
|
||||
foreach($ds as $k=>$dataset)
|
||||
|
|
Loading…
Reference in New Issue