实现同步黑河试验元数据缩略图功能

This commit is contained in:
wlx 2009-12-22 11:13:31 +00:00
parent a754bfd2f7
commit 6a97ffe006
2 changed files with 10 additions and 0 deletions

View File

@ -67,6 +67,15 @@ class Admin_DataController extends Zend_Controller_Action
$this->db->query($sql,array(base64_encode($data),$row->id)); $this->db->query($sql,array(base64_encode($data),$row->id));
} }
$this->view->msg='已成功同步缩略图!'; $this->view->msg='已成功同步缩略图!';
} elseif ($thumb=='water') {
$sql="select g.id as gid,m.uuid,t.* from thumbnail t left join metadata m on t.id=m.id left join watergn g on m.uuid=g.uuid where t.filetype is not null and t.filename is not null";
$rows=$this->db->fetchAll($sql);
foreach($rows as $row) {
$data=file_get_contents($this->view->config->geonetwork->url.'srv/cn/resources.get?access=public&id='.$row->gid.'&fname='.urlencode($row->filename));
$sql="update thumbnail set data=? where id=?";
$this->db->query($sql,array(base64_encode($data),$row->id));
}
$this->view->msg='已成功同步缩略图!';
} elseif ($adminuser=='geonetwork') { } elseif ($adminuser=='geonetwork') {
$sql="select id,username,password,email from users where usertype='administrator'"; $sql="select id,username,password,email from users where usertype='administrator'";
$rows=$this->db->fetchAll($sql); $rows=$this->db->fetchAll($sql);

View File

@ -28,6 +28,7 @@
<p><a href="/admin/data/sync/source/watergn">开始同步从water同步到WESTDC若有冲突以water为准</a> </p> <p><a href="/admin/data/sync/source/watergn">开始同步从water同步到WESTDC若有冲突以water为准</a> </p>
<p><a href="/admin/data/sync/delete/westdc">删除WESTDC中多出的元数据</a></p> <p><a href="/admin/data/sync/delete/westdc">删除WESTDC中多出的元数据</a></p>
<p><a href="/admin/data/sync/thumb/geonetwork">同步GEONETWORK中的缩略图</a></p> <p><a href="/admin/data/sync/thumb/geonetwork">同步GEONETWORK中的缩略图</a></p>
<p><a href="/admin/data/sync/thumb/water">同步WATER中的缩略图</a></p>
<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>