增加同步WATER单条元数据功能

This commit is contained in:
wlx 2010-07-04 11:00:26 +00:00
parent f808077500
commit 93a4728005
2 changed files with 10 additions and 2 deletions

View File

@ -56,13 +56,20 @@ class Admin_DataController extends Zend_Controller_Action
$this->db->query("update metadata set source=? where uuid=?",array($gmd->source,$gmd->uuid)); $this->db->query("update metadata set source=? where uuid=?",array($gmd->source,$gmd->uuid));
} }
$this->view->msg='成功同步黑河遥感综合实验元数据!'; $this->view->msg='成功同步黑河遥感综合实验元数据!';
} elseif (!empty($uuid)) { } elseif (!empty($uuid) && isset($_POST['submit'])) {
//同步单条元数据 //同步单条元数据
$sql=$this->db->quoteInto("select data from geonetworkmetadata where uuid=?",$uuid); $sql=$this->db->quoteInto("select data from geonetworkmetadata where uuid=?",$uuid);
if ($rs=$this->db->fetchRow($sql)) { if ($rs=$this->db->fetchRow($sql)) {
$this->import($rs->data); $this->import($rs->data);
$this->view->msg='成功同步元数据:'.$uuid; $this->view->msg='成功同步元数据:'.$uuid;
} else $this->view->msg='不存在此元数据:'.$uuid; } else $this->view->msg='不存在此元数据:'.$uuid;
} elseif (!empty($uuid) && isset($_POST['watersubmit'])) {
//同步单条元数据
$sql=$this->db->quoteInto("select data from watergn where uuid=?",$uuid);
if ($rs=$this->db->fetchRow($sql)) {
$this->import($rs->data);
$this->view->msg='成功同步元数据:'.$uuid;
} else $this->view->msg='不存在此元数据:'.$uuid;
} elseif ($list=='water') { } elseif ($list=='water') {
$sql="select uuid,title from metadata where uuid not in (select uuid from watergn where schemaid='iso19115') and uuid not in (select uuid from geonetworkmetadata where schemaid='iso19115')"; $sql="select uuid,title 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->view->metadata=$this->db->query($sql); $this->view->metadata=$this->db->query($sql);

View File

@ -34,7 +34,8 @@
<p><a href="/admin/data/sync/adminuser/geonetwork">同步管理员帐号到GEONETWORK</a></p> <p><a href="/admin/data/sync/adminuser/geonetwork">同步管理员帐号到GEONETWORK</a></p>
<form method="POST"> <form method="POST">
<p>指定元数据UUID: <input type="text" name="uuid"></p> <p>指定元数据UUID: <input type="text" name="uuid"></p>
<input type="submit" value="同步此元数据" /> <button type="submit" name="submit">同步此元数据</button>
<button type="submit" name="watersubmit">同步WATER数据</button>
</form> </form>
<?php if ($this->metadata) : ?> <?php if ($this->metadata) : ?>
<ul> <ul>