添加删除GEONETWORK多余元数据功能

This commit is contained in:
wlx 2011-10-25 07:34:26 +00:00
parent 7264944669
commit dc887db3bc
2 changed files with 11 additions and 0 deletions

View File

@ -113,6 +113,16 @@ class Admin_DataController extends Zend_Controller_Action
$sql="delete from metadata where uuid not in (select uuid from geonetworkmetadata where schemaid='iso19115')";
$this->db->query($sql);
$this->view->msg='已删除WESTDC中多出的元数据';
} elseif ($delete=='geonetwork') {
//dblink view中删除多条有问题暂时用单条删除替代
//$sql="delete from geonetworkmetadata where uuid not in (select uuid from metadata)";
$sql="select uuid from geonetworkmetadata where uuid not in (select uuid from metadata)";
$rows=$this->db->fetchAll($sql);
foreach($rows as $row)
{
$this->db->exec($this->db->quoteInto("delete from geonetworkmetadata where uuid=?",$row->uuid));
}
$this->view->msg='已删除GEONETWORK中多出的元数据';
} elseif ($delete=='water') {
$sql="delete from metadata where uuid not in (select uuid from watergn where schemaid='iso19115') and uuid not in (select uuid from geonetworkmetadata where schemaid='iso19115')";
$this->db->query($sql);

View File

@ -29,6 +29,7 @@
<p><a href="/admin/data/sync/source/westdc">开始同步从WESTDC同步到GEONETWORK</a> </p>
<p><a href="/admin/data/sync/list/water">列出WESTDC中多出的WATER元数据</a></p>
<p><a href="/admin/data/sync/delete/westdc">删除WESTDC中多出的元数据</a></p>
<p><a href="/admin/data/sync/delete/geonetwork">删除GEONETWORK中多出的元数据</a></p>
<p><a href="/admin/data/sync/delete/water">删除WESTDC中多出的WATER元数据</a></p>
<p><a href="/admin/data/sync/thumb/geonetwork">同步GEONETWORK中的缩略图</a></p>
<p><a href="/admin/data/sync/thumb/water">同步WATER中的缩略图</a></p>