切换watergn为heihegn,为黑河项目数据提供同步功能

This commit is contained in:
wlx 2011-10-14 02:45:04 +00:00
parent 80bc836f6a
commit 6c5e8cef11
1 changed files with 5 additions and 4 deletions

View File

@ -44,12 +44,13 @@ class Admin_DataController extends Zend_Controller_Action
$this->view->msg='成功同步元数据!'; $this->view->msg='成功同步元数据!';
} elseif ($source=="watergn" && empty($uuid) ) { } elseif ($source=="watergn" && empty($uuid) ) {
//首先删除所有的黑河试验数据 //首先删除所有的黑河试验数据
$sql="delete from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d'"; //$sql="delete from metadata where source='e3ad32dc-f573-11e0-aa7b-b768cfd88d80'";
$sql="delete from metadata where uuid in (select uuid from heihegn)";
$this->db->query($sql); $this->db->query($sql);
$sql="delete from responsible where id not in (select distinct(resid) from role)"; $sql="delete from responsible where id not in (select distinct(resid) from role)";
$this->db->query($sql); $this->db->query($sql);
//同步黑河遥感实验的元数据 //同步黑河遥感实验的元数据
$sql="select uuid,data,source from watergn where schemaid='iso19115'"; $sql="select uuid,data,source from heihegn where schemaid='iso19115'";
$rs=$this->db->fetchAll($sql); $rs=$this->db->fetchAll($sql);
foreach($rs as $gmd) { foreach($rs as $gmd) {
$this->import($gmd->data); $this->import($gmd->data);
@ -125,7 +126,7 @@ class Admin_DataController extends Zend_Controller_Action
} }
$this->view->msg='已成功同步缩略图!'; $this->view->msg='已成功同步缩略图!';
} elseif ($thumb=='water') { } elseif ($thumb=='water') {
$sql="select g.id as gid,m.uuid,t.* from watergn g left join metadata m on m.uuid=g.uuid left join thumbnail t on t.id=m.id where t.filetype is not null and t.filename is not null"; $sql="select g.id as gid,m.uuid,t.* from heihegn g left join metadata m on m.uuid=g.uuid left join thumbnail t on t.id=m.id where t.filetype is not null and t.filename is not null";
$rows=$this->db->fetchAll($sql); $rows=$this->db->fetchAll($sql);
foreach($rows as $row) { foreach($rows as $row) {
$data=file_get_contents($this->view->config->watergeonetwork->url.'srv/cn/resources.get?access=public&id='.$row->gid.'&fname='.urlencode($row->filename)); $data=file_get_contents($this->view->config->watergeonetwork->url.'srv/cn/resources.get?access=public&id='.$row->gid.'&fname='.urlencode($row->filename));