From 6a97ffe00657dd9cf568ff8f66cc700d3061cf26 Mon Sep 17 00:00:00 2001 From: wlx Date: Tue, 22 Dec 2009 11:13:31 +0000 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=90=8C=E6=AD=A5=E9=BB=91?= =?UTF-8?q?=E6=B2=B3=E8=AF=95=E9=AA=8C=E5=85=83=E6=95=B0=E6=8D=AE=E7=BC=A9?= =?UTF-8?q?=E7=95=A5=E5=9B=BE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controllers/DataController.php | 9 +++++++++ application/admin/views/scripts/data/sync.phtml | 1 + 2 files changed, 10 insertions(+) diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index f29a1710..a3a059e6 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -67,6 +67,15 @@ class Admin_DataController extends Zend_Controller_Action $this->db->query($sql,array(base64_encode($data),$row->id)); } $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') { $sql="select id,username,password,email from users where usertype='administrator'"; $rows=$this->db->fetchAll($sql); diff --git a/application/admin/views/scripts/data/sync.phtml b/application/admin/views/scripts/data/sync.phtml index 065563e0..8a4b5a99 100644 --- a/application/admin/views/scripts/data/sync.phtml +++ b/application/admin/views/scripts/data/sync.phtml @@ -28,6 +28,7 @@

开始同步:从water同步到WESTDC,若有冲突,以water为准

删除WESTDC中多出的元数据

同步GEONETWORK中的缩略图

+

同步WATER中的缩略图

同步管理员帐号到GEONETWORK

指定元数据UUID: