';
- $content.=''.$row['title'].'';
- $content.='
-
- ';
-
- $dispostion = 'attachment; filename*="utf8\' \''.urlencode($row['title']).'.doc"';
-
- $ua = $_SERVER["HTTP_USER_AGENT"];
-
- if (preg_match("/MSIE/", $ua)) {
- $dispostion = 'attachment; filename="'.urlencode($row['title']).'.doc"';
- } else if (preg_match("/Firefox/", $ua)) {
- //$dispostion;
- } else {
- $dispostion = 'attachment; filename="'.$row['title'].'.doc"';
- }
-
- $content.=$xslt->transformToXML($dom);
- if ($review==1) $content.=file_get_contents('../data/review-table.htm',true);
- $content.="";
- $this->getResponse()->setHeader('Content-Type', 'application/vnd.ms-doc')
- ->setHeader('Content-Disposition',$dispostion)
- ->setHeader('Content-Length', strlen($content))
- ->setHeader('Content-Type','application/force-download')
- ->setHeader('Content-Type','application/download')
- ->setHeader('Content-Description','File Transfer')
- ->setHeader('Content-Transfer-Encoding','binary')
- ->setHeader('Expires',0)
- ->setHeader('Cache-Control','must-revalidate, post-check=0, pre-check=0')
- ->setHeader('Pragma','public')
- ->setBody($content);
- }
-
- /*
- * 转换元数据为PDF格式
- */
- public function pdfAction()
- {
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
- $uuid=$this->_request->getParam('uuid');
- $review=$this->_request->getParam('review');
- error_reporting(1);
- if (!empty($uuid))
- {
- $sql="select x.data,m.title,m.citation,m.suppinfo,m.doi,m.filesize,m.fileformat,m.south,m.east,m.west,m.north,m.timebegin,m.timeend,m.title_en,m.uuid,m.description,g.id,m.projection,t.filetype,
- cc.name as category, cc.name_zh as category_zh
- from metadata m left join xml x on m.id=x.id left join thumbnail t on x.id=t.id
- left join category c on c.id=m.id left join categorycode cc on c.code=cc.code
- left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid);
- $row=$this->db->fetchRow($sql);
- $sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?";
- $sql=$this->db->quoteInto($sql,$uuid);
- $ref=$this->db->fetchAll($sql);
- $reference="";
- foreach($ref as $k=>$refer)
- {
- $reference.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$refer['reference'])."\r\n";
- }
- $row['reference']=$reference;
- $sql="select u.uselimit from mdlimit ml left join metadata m on ml.uuid=m.uuid left join uselimit u on ml.lid=u.id where m.uuid=?";
- $sql=$this->db->quoteInto($sql,$uuid);
- $limits=$this->db->fetchAll($sql);
- $uselimits="";
- foreach($limits as $k=>$limit)
- {
- //$uselimits.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$limit['uselimit'])."\r\n";
- $uselimits.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$limit['uselimit'])."\r\n";
- }
- $row['uselimits']=$uselimits;
- $sql="select ol.* from onlineresource ol left join metadata m on ol.uuid=m.uuid where m.uuid=?";
- $sql=$this->db->quoteInto($sql,$uuid);
- $row['resources']=$this->db->fetchAll($sql);
- $sql="select r.role,s.* from role r left join responsible s on r.resid=s.id left join metadata m on m.uuid=r.uuid where m.uuid=? order by r.role,r.id";
- $sql=$this->db->quoteInto($sql,$uuid);
- $row['contacts']=$this->db->fetchAll($sql);
-
- $sql="select k.keyword, k.keytype from keyword k left join metadata m on k.id=m.id where m.uuid=? order by k.keytype";
- $sql=$this->db->quoteInto($sql,$uuid);
- $keys=$this->db->fetchAll($sql);
- $keyword=array();
- foreach($keys as $key)
- {
- @$keyword[$key['keytype']].=$key['keyword'].',';
- }
- $row['keyword']=$keyword;
-
- if (is_numeric($row['projection']))
- {
- $sql="select proj4text from spatial_ref_sys where auth_srid=?";
- $rs=$this->db->fetchRow($sql,array($row['projection']));
- if ($rs) $projection=$rs['proj4text'];
- }
- if (!empty($projection)) $row['projection']=$projection;
- } else
- $projection='';
-
- $dom = new DOMDocument();
- $dom->loadXML($row['data']);
- $xpath = new DOMXpath($dom);
- $row['rfdenom']=@$dom->getElementsByTagName('rfDenom')->item(0)->nodeValue;
- $row['resolution']=@$xpath->query('//scaleDist/value/Real')->item(0)->nodeValue;
- $row['resolution'].=@$dom->getElementsByTagName('uomName')->item(0)->nodeValue;
- //提前对表格进行预处理
- /*$wiki=new WikiFormat();
- $row['description']=$wiki->parseTable($row["description"]);
- preg_match_all('/
[\s\S]*?<\/table>/im', $row['description'],$tables);
- foreach($tables as $k=>$table)
- {
- $row['description']=@str_replace($tables[$k],"\n 【表格内容暂不支持,请访问网站查看,此处请忽略】\n",$row['description']);
- }*/
- $pdf=new MetadataPDF();
- $pdf->metadata=$row;
- $pdf->Draw();
- $pdf->setTitle($row['title'],true);
- $pdf->setAuthor('寒区旱区科学数据中心',true);
- $this->getResponse()->setHeader('Content-Type', 'application/pdf');
- //->setHeader('Content-Disposition','inline; filename="'.$row['title'].'.pdf"');
- $pdf->Output($row['title'].'.pdf','I');
- //die();
- }
- public function odtAction()
- {
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
- $uuid=$this->_request->getParam('uuid');
- $review=$this->_request->getParam('review');
- //error_reporting(1);
- if (!empty($uuid))
- {
- $sql="select x.data,m.title,m.citation,m.suppinfo,m.doi,m.filesize,m.fileformat,m.south,m.east,m.west,m.north,m.timebegin,m.timeend,m.title_en,m.uuid,m.description,g.id,m.projection,t.filetype,
- cc.name as category, cc.name_zh as category_zh
- from xml x left join metadata m on m.id=x.id left join thumbnail t on x.id=t.id
- left join category c on c.id=m.id left join categorycode cc on c.code=cc.code
- left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid);
- $row=$this->db->fetchRow($sql);
- $sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?";
- $sql=$this->db->quoteInto($sql,$uuid);
- $ref=$this->db->fetchAll($sql);
- $reference="";
- foreach($ref as $k=>$refer)
- {
- $reference.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$refer['reference'])."\r\n";
- }
- $row['reference']=$reference;
- $sql="select u.uselimit from mdlimit ml left join metadata m on ml.uuid=m.uuid left join uselimit u on ml.lid=u.id where m.uuid=?";
- $sql=$this->db->quoteInto($sql,$uuid);
- $limits=$this->db->fetchAll($sql);
- $uselimits="";
- foreach($limits as $k=>$limit)
- {
- //$uselimits.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$limit['uselimit'])."\r\n";
- $uselimits.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$limit['uselimit'])."\r\n";
- }
- $row['uselimits']=$uselimits;
- $sql="select ol.* from onlineresource ol left join metadata m on ol.uuid=m.uuid where m.uuid=?";
- $sql=$this->db->quoteInto($sql,$uuid);
- $res=$this->db->fetchAll($sql);
- $resource="";
- foreach($res as $k=>$r)
- {
- $resource.=($k+1).". ".$r['name'].' '.$r['linkage']."\n";
- }
- $row['resources']=$resource;
- $sql="select r.role,s.* from role r left join responsible s on r.resid=s.id left join metadata m on m.uuid=r.uuid where m.uuid=? order by r.role,r.id";
- $sql=$this->db->quoteInto($sql,$uuid);
- $contact=$this->db->fetchAll($sql);
- $contacts="";
- $party_zh=array('resourceProvider'=>'资源提供者','custodian'=>'维护者','owner'=>'拥有者','user'=>'用户','distributor'=>'数据服务联系人','originator'=>'创建者','pointOfContact'=>'联系人','principalInvestigator'=>'数据调查与处理者','processor'=>'处理者','publisher'=>'元数据发布者','author'=>'元数据作者');
- foreach($contact as $k=>$c)
- {
- @$contacts.=($k+1).". ".$party_zh[$c['role']]."\n";
- @$contacts.=$c['individual'].' 单位:'.$c['organisation']."\n";
- @$contacts.='地址:'.$c['country'].' '.$c['administractive'].' '.$c['city'].' '.$c['delivery']."\n";
- @$contacts.='邮编:'.$c['postal'].' 电话:'.$c['phone'].' 邮件:'.$c['email']."\n\n";
- }
- $row['contacts']=$contacts;
- $sql="select k.keyword, k.keytype from keyword k left join metadata m on k.id=m.id where m.uuid=? order by k.keytype";
- $sql=$this->db->quoteInto($sql,$uuid);
- $keys=$this->db->fetchAll($sql);
- $keyword=array();
- foreach($keys as $key)
- {
- @$keyword[$key['keytype']].=$key['keyword'].',';
- }
- $row['keyword']=$keyword;
-
- if (is_numeric($row['projection']))
- {
- $sql="select proj4text from spatial_ref_sys where auth_srid=?";
- $rs=$this->db->fetchRow($sql,array($row['projection']));
- if ($rs) $projection=$rs['proj4text'];
- }
- if (!empty($projection)) $row['projection']=$projection;
- } else
- $projection='';
-
- $dom = new DOMDocument();
- $dom->loadXML($row['data']);
- $xpath = new DOMXpath($dom);
- $row['rfdenom']=@$dom->getElementsByTagName('rfDenom')->item(0)->nodeValue;
- $row['resolution']=@$xpath->query('//scaleDist/value/Real')->item(0)->nodeValue;
- $row['resolution'].=@$dom->getElementsByTagName('uomName')->item(0)->nodeValue;
- //提前对表格进行预处理
- $wiki=new WikiFormat();
- $row['description']=$wiki->parseTable($row["description"]);
- preg_match_all('/
';
- }else
- {
- echo "暂无相关数据";
- }
- }//相关下载 给我推荐
-
- function relatedAction(){
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
- $uuid = $this->_request->getParam('uuid');
-
- $sql="select m.id from normalmetadata m left join mdstatus s on m.uuid=s.uuid
- left join thumbnail t on t.id=m.id left join geonetworkmetadata g on m.uuid=g.uuid where ";
- $where=$this->db->quoteInto('m.uuid = ?',$uuid);
- $sql.=$where;
- $row=$this->db->fetchRow($sql);
- if (!$row) exit("读取信息错误");
- $id=$row['id'];
-
- //相关元数据,根据同名关键词实现
- $sql="select distinct(md.uuid),md.title from keyword kw left join normalmetadata md on kw.id=md.id where length(md.title)>2 and kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>?";
- $rows=$this->db->fetchAll($sql,array($id,$id));
-
- $paginator = Zend_Paginator::factory($rows);
- $paginator->setCurrentPageNumber($this->_getParam('page'));
- $paginator->setItemCountPerPage(10);
- $paginator->setView($this->view);
- Zend_View_Helper_PaginationControl::setDefaultViewPartial('data/pagination_related.phtml');
- if ($paginator)
- {
- foreach($paginator as $c)
- {
- print '
';
- }
- } //相关数据
-
- function literatureAction(){
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
- $uuid = $this->_request->getParam('uuid');
- $sql="select m.id from normalmetadata m left join mdstatus s on m.uuid=s.uuid
- left join thumbnail t on t.id=m.id left join geonetworkmetadata g on m.uuid=g.uuid where ";
- $where=$this->db->quoteInto('m.uuid = ?',$uuid);
- $sql.=$where;
- $row=$this->db->fetchRow($sql);
- if (!$row) exit("读取信息错误");
- $id=$row['id'];
-
- $keys=$this->db->fetchAll("select * from keyword where id=? order by keytype,ts_created",array($id));
-
- $wheresql = array();
- foreach ($keys as $k=>$v)
- {
- if($v['keytype']=="theme")
- $wheresql[] = " a.title like '%".$v['keyword']."%' ";
- }
- $wheresql[] = " 1<>1 ";
- $wheresql = join(" or ",$wheresql);
- $sql="select a.*,array_to_string(array(select author from knl_author t where t.item_id=a.item_id order by place asc),'; ') as author from knl_article a where ($wheresql) order by a.ts_created desc";
- $rows = $this->db->fetchAll($sql);
-
- $paginator = Zend_Paginator::factory($rows);
- $paginator->setCurrentPageNumber($this->_getParam('page'));
- $paginator->setItemCountPerPage(10);
- $paginator->setView($this->view);
- Zend_View_Helper_PaginationControl::setDefaultViewPartial('data/pagination_literature.phtml');
- if ($paginator)
- {
- foreach($paginator as $c)
- {
- $u=parse_url($c['url']);
- if (@$u['host']=='hdl.handle.net') $c['url'] = $this->config->seekspace->handleurl.$u['path'];
- print '
';
+ $content.=''.$row['title'].'';
+ $content.='
+
+ ';
+
+ $dispostion = 'attachment; filename*="utf8\' \''.urlencode($row['title']).'.doc"';
+
+ $ua = $_SERVER["HTTP_USER_AGENT"];
+
+ if (preg_match("/MSIE/", $ua)) {
+ $dispostion = 'attachment; filename="'.urlencode($row['title']).'.doc"';
+ } else if (preg_match("/Firefox/", $ua)) {
+ //$dispostion;
+ } else {
+ $dispostion = 'attachment; filename="'.$row['title'].'.doc"';
+ }
+
+ $content.=$xslt->transformToXML($dom);
+ if ($review==1) $content.=file_get_contents('../data/review-table.htm',true);
+ $content.="";
+ $this->getResponse()->setHeader('Content-Type', 'application/vnd.ms-doc')
+ ->setHeader('Content-Disposition',$dispostion)
+ ->setHeader('Content-Length', strlen($content))
+ ->setHeader('Content-Type','application/force-download')
+ ->setHeader('Content-Type','application/download')
+ ->setHeader('Content-Description','File Transfer')
+ ->setHeader('Content-Transfer-Encoding','binary')
+ ->setHeader('Expires',0)
+ ->setHeader('Cache-Control','must-revalidate, post-check=0, pre-check=0')
+ ->setHeader('Pragma','public')
+ ->setBody($content);
+ }
+
+ /*
+ * 转换元数据为PDF格式
+ */
+ public function pdfAction()
+ {
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+ $uuid=$this->_request->getParam('uuid');
+ $review=$this->_request->getParam('review');
+ error_reporting(1);
+ if (!empty($uuid))
+ {
+ $sql="select x.data,m.title,m.citation,m.suppinfo,m.doi,m.filesize,m.fileformat,m.south,m.east,m.west,m.north,m.timebegin,m.timeend,m.title_en,m.uuid,m.description,g.id,m.projection,t.filetype,
+ cc.name as category, cc.name_zh as category_zh
+ from metadata m left join xml x on m.id=x.id left join thumbnail t on x.id=t.id
+ left join category c on c.id=m.id left join categorycode cc on c.code=cc.code
+ left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid);
+ $row=$this->db->fetchRow($sql);
+ $sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?";
+ $sql=$this->db->quoteInto($sql,$uuid);
+ $ref=$this->db->fetchAll($sql);
+ $reference="";
+ foreach($ref as $k=>$refer)
+ {
+ $reference.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$refer['reference'])."\r\n";
+ }
+ $row['reference']=$reference;
+ $sql="select u.uselimit from mdlimit ml left join metadata m on ml.uuid=m.uuid left join uselimit u on ml.lid=u.id where m.uuid=?";
+ $sql=$this->db->quoteInto($sql,$uuid);
+ $limits=$this->db->fetchAll($sql);
+ $uselimits="";
+ foreach($limits as $k=>$limit)
+ {
+ //$uselimits.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$limit['uselimit'])."\r\n";
+ $uselimits.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$limit['uselimit'])."\r\n";
+ }
+ $row['uselimits']=$uselimits;
+ $sql="select ol.* from onlineresource ol left join metadata m on ol.uuid=m.uuid where m.uuid=?";
+ $sql=$this->db->quoteInto($sql,$uuid);
+ $row['resources']=$this->db->fetchAll($sql);
+ $sql="select r.role,s.* from role r left join responsible s on r.resid=s.id left join metadata m on m.uuid=r.uuid where m.uuid=? order by r.role,r.id";
+ $sql=$this->db->quoteInto($sql,$uuid);
+ $row['contacts']=$this->db->fetchAll($sql);
+
+ $sql="select k.keyword, k.keytype from keyword k left join metadata m on k.id=m.id where m.uuid=? order by k.keytype";
+ $sql=$this->db->quoteInto($sql,$uuid);
+ $keys=$this->db->fetchAll($sql);
+ $keyword=array();
+ foreach($keys as $key)
+ {
+ @$keyword[$key['keytype']].=$key['keyword'].',';
+ }
+ $row['keyword']=$keyword;
+
+ if (is_numeric($row['projection']))
+ {
+ $sql="select proj4text from spatial_ref_sys where auth_srid=?";
+ $rs=$this->db->fetchRow($sql,array($row['projection']));
+ if ($rs) $projection=$rs['proj4text'];
+ }
+ if (!empty($projection)) $row['projection']=$projection;
+ } else
+ $projection='';
+
+ $dom = new DOMDocument();
+ $dom->loadXML($row['data']);
+ $xpath = new DOMXpath($dom);
+ $row['rfdenom']=@$dom->getElementsByTagName('rfDenom')->item(0)->nodeValue;
+ $row['resolution']=@$xpath->query('//scaleDist/value/Real')->item(0)->nodeValue;
+ $row['resolution'].=@$dom->getElementsByTagName('uomName')->item(0)->nodeValue;
+ //提前对表格进行预处理
+ /*$wiki=new WikiFormat();
+ $row['description']=$wiki->parseTable($row["description"]);
+ preg_match_all('/
[\s\S]*?<\/table>/im', $row['description'],$tables);
+ foreach($tables as $k=>$table)
+ {
+ $row['description']=@str_replace($tables[$k],"\n 【表格内容暂不支持,请访问网站查看,此处请忽略】\n",$row['description']);
+ }*/
+ $pdf=new MetadataPDF();
+ $pdf->metadata=$row;
+ $pdf->Draw();
+ $pdf->setTitle($row['title'],true);
+ $pdf->setAuthor('寒区旱区科学数据中心',true);
+ $this->getResponse()->setHeader('Content-Type', 'application/pdf');
+ //->setHeader('Content-Disposition','inline; filename="'.$row['title'].'.pdf"');
+ $pdf->Output($row['title'].'.pdf','I');
+ //die();
+ }
+ public function odtAction()
+ {
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+ $uuid=$this->_request->getParam('uuid');
+ $review=$this->_request->getParam('review');
+ //error_reporting(1);
+ if (!empty($uuid))
+ {
+ $sql="select x.data,m.title,m.citation,m.suppinfo,m.doi,m.filesize,m.fileformat,m.south,m.east,m.west,m.north,m.timebegin,m.timeend,m.title_en,m.uuid,m.description,g.id,m.projection,t.filetype,
+ cc.name as category, cc.name_zh as category_zh
+ from xml x left join metadata m on m.id=x.id left join thumbnail t on x.id=t.id
+ left join category c on c.id=m.id left join categorycode cc on c.code=cc.code
+ left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid);
+ $row=$this->db->fetchRow($sql);
+ $sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?";
+ $sql=$this->db->quoteInto($sql,$uuid);
+ $ref=$this->db->fetchAll($sql);
+ $reference="";
+ foreach($ref as $k=>$refer)
+ {
+ $reference.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$refer['reference'])."\r\n";
+ }
+ $row['reference']=$reference;
+ $sql="select u.uselimit from mdlimit ml left join metadata m on ml.uuid=m.uuid left join uselimit u on ml.lid=u.id where m.uuid=?";
+ $sql=$this->db->quoteInto($sql,$uuid);
+ $limits=$this->db->fetchAll($sql);
+ $uselimits="";
+ foreach($limits as $k=>$limit)
+ {
+ //$uselimits.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$limit['uselimit'])."\r\n";
+ $uselimits.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$limit['uselimit'])."\r\n";
+ }
+ $row['uselimits']=$uselimits;
+ $sql="select ol.* from onlineresource ol left join metadata m on ol.uuid=m.uuid where m.uuid=?";
+ $sql=$this->db->quoteInto($sql,$uuid);
+ $res=$this->db->fetchAll($sql);
+ $resource="";
+ foreach($res as $k=>$r)
+ {
+ $resource.=($k+1).". ".$r['name'].' '.$r['linkage']."\n";
+ }
+ $row['resources']=$resource;
+ $sql="select r.role,s.* from role r left join responsible s on r.resid=s.id left join metadata m on m.uuid=r.uuid where m.uuid=? order by r.role,r.id";
+ $sql=$this->db->quoteInto($sql,$uuid);
+ $contact=$this->db->fetchAll($sql);
+ $contacts="";
+ $party_zh=array('resourceProvider'=>'资源提供者','custodian'=>'维护者','owner'=>'拥有者','user'=>'用户','distributor'=>'数据服务联系人','originator'=>'创建者','pointOfContact'=>'联系人','principalInvestigator'=>'数据调查与处理者','processor'=>'处理者','publisher'=>'元数据发布者','author'=>'元数据作者');
+ foreach($contact as $k=>$c)
+ {
+ @$contacts.=($k+1).". ".$party_zh[$c['role']]."\n";
+ @$contacts.=$c['individual'].' 单位:'.$c['organisation']."\n";
+ @$contacts.='地址:'.$c['country'].' '.$c['administractive'].' '.$c['city'].' '.$c['delivery']."\n";
+ @$contacts.='邮编:'.$c['postal'].' 电话:'.$c['phone'].' 邮件:'.$c['email']."\n\n";
+ }
+ $row['contacts']=$contacts;
+ $sql="select k.keyword, k.keytype from keyword k left join metadata m on k.id=m.id where m.uuid=? order by k.keytype";
+ $sql=$this->db->quoteInto($sql,$uuid);
+ $keys=$this->db->fetchAll($sql);
+ $keyword=array();
+ foreach($keys as $key)
+ {
+ @$keyword[$key['keytype']].=$key['keyword'].',';
+ }
+ $row['keyword']=$keyword;
+
+ if (is_numeric($row['projection']))
+ {
+ $sql="select proj4text from spatial_ref_sys where auth_srid=?";
+ $rs=$this->db->fetchRow($sql,array($row['projection']));
+ if ($rs) $projection=$rs['proj4text'];
+ }
+ if (!empty($projection)) $row['projection']=$projection;
+ } else
+ $projection='';
+
+ $dom = new DOMDocument();
+ $dom->loadXML($row['data']);
+ $xpath = new DOMXpath($dom);
+ $row['rfdenom']=@$dom->getElementsByTagName('rfDenom')->item(0)->nodeValue;
+ $row['resolution']=@$xpath->query('//scaleDist/value/Real')->item(0)->nodeValue;
+ $row['resolution'].=@$dom->getElementsByTagName('uomName')->item(0)->nodeValue;
+ //提前对表格进行预处理
+ $wiki=new WikiFormat();
+ $row['description']=$wiki->parseTable($row["description"]);
+ preg_match_all('/
';
+ }else
+ {
+ echo "暂无相关数据";
+ }
+ }//相关下载 给我推荐
+
+ function relatedAction(){
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+ $uuid = $this->_request->getParam('uuid');
+
+ $sql="select m.id from normalmetadata m left join mdstatus s on m.uuid=s.uuid
+ left join thumbnail t on t.id=m.id left join geonetworkmetadata g on m.uuid=g.uuid where ";
+ $where=$this->db->quoteInto('m.uuid = ?',$uuid);
+ $sql.=$where;
+ $row=$this->db->fetchRow($sql);
+ if (!$row) exit("读取信息错误");
+ $id=$row['id'];
+
+ //相关元数据,根据同名关键词实现
+ $sql="select distinct(md.uuid),md.title from keyword kw left join normalmetadata md on kw.id=md.id where length(md.title)>2 and kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>?";
+ $rows=$this->db->fetchAll($sql,array($id,$id));
+
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage(10);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('data/pagination_related.phtml');
+ if ($paginator)
+ {
+ foreach($paginator as $c)
+ {
+ print '
';
+ }
+ } //相关数据
+
+ function literatureAction(){
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+ $uuid = $this->_request->getParam('uuid');
+ $sql="select m.id from normalmetadata m left join mdstatus s on m.uuid=s.uuid
+ left join thumbnail t on t.id=m.id left join geonetworkmetadata g on m.uuid=g.uuid where ";
+ $where=$this->db->quoteInto('m.uuid = ?',$uuid);
+ $sql.=$where;
+ $row=$this->db->fetchRow($sql);
+ if (!$row) exit("读取信息错误");
+ $id=$row['id'];
+
+ $keys=$this->db->fetchAll("select * from keyword where id=? order by keytype,ts_created",array($id));
+
+ $wheresql = array();
+ foreach ($keys as $k=>$v)
+ {
+ if($v['keytype']=="theme")
+ $wheresql[] = " a.title like '%".$v['keyword']."%' ";
+ }
+ $wheresql[] = " 1<>1 ";
+ $wheresql = join(" or ",$wheresql);
+ $sql="select a.*,array_to_string(array(select author from knl_author t where t.item_id=a.item_id order by place asc),'; ') as author from knl_article a where ($wheresql) order by a.ts_created desc";
+ $rows = $this->db->fetchAll($sql);
+
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage(10);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('data/pagination_literature.phtml');
+ if ($paginator)
+ {
+ foreach($paginator as $c)
+ {
+ $u=parse_url($c['url']);
+ if (@$u['host']=='hdl.handle.net') $c['url'] = $this->config->seekspace->handleurl.$u['path'];
+ print '
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/application/admin/views/scripts/stat/awstatsftp2.phtml b/application/admin/views/scripts/stat/awstatsftp2.phtml
index 3f79a716..39195b06 100644
--- a/application/admin/views/scripts/stat/awstatsftp2.phtml
+++ b/application/admin/views/scripts/stat/awstatsftp2.phtml
@@ -11,5 +11,8 @@
= $this->partial('stat/left.phtml'); ?>
-
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/application/admin/views/scripts/stat/awstatsweb.phtml b/application/admin/views/scripts/stat/awstatsweb.phtml
index 8621a407..fe5e21ed 100644
--- a/application/admin/views/scripts/stat/awstatsweb.phtml
+++ b/application/admin/views/scripts/stat/awstatsweb.phtml
@@ -11,5 +11,8 @@
= $this->partial('stat/left.phtml'); ?>
-
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/application/admin/views/scripts/stat/awstatsweb2.phtml b/application/admin/views/scripts/stat/awstatsweb2.phtml
index 19d9c60f..346eb40f 100644
--- a/application/admin/views/scripts/stat/awstatsweb2.phtml
+++ b/application/admin/views/scripts/stat/awstatsweb2.phtml
@@ -11,5 +11,8 @@
= $this->partial('stat/left.phtml'); ?>
-
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/application/admin/views/scripts/stat/webalizer.phtml b/application/admin/views/scripts/stat/webalizer.phtml
index 719706a5..ac1fa9ac 100644
--- a/application/admin/views/scripts/stat/webalizer.phtml
+++ b/application/admin/views/scripts/stat/webalizer.phtml
@@ -11,5 +11,8 @@
= $this->partial('stat/left.phtml'); ?>
-
-
\ No newline at end of file
+
+
+
\ No newline at end of file
From 1889b06b29cf96d463a27e13bfd0241dd5a29a03 Mon Sep 17 00:00:00 2001
From: wlx
Date: Tue, 28 May 2013 03:32:53 +0000
Subject: [PATCH 04/18] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=81=A2=E5=A4=8D=E6=9F=A5=E7=9C=8B=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../admin/controllers/SysController.php | 156 +++++++++++++++++-
.../admin/views/scripts/sys/left.phtml | 4 +-
.../admin/views/scripts/sys/recovery.phtml | 43 +++++
3 files changed, 201 insertions(+), 2 deletions(-)
create mode 100644 application/admin/views/scripts/sys/recovery.phtml
diff --git a/application/admin/controllers/SysController.php b/application/admin/controllers/SysController.php
index f5f5d46e..d473ae20 100644
--- a/application/admin/controllers/SysController.php
+++ b/application/admin/controllers/SysController.php
@@ -332,6 +332,160 @@ class Admin_SysController extends Zend_Controller_Action
}
}//end
- }//getmessageAction() 获取站内消息
+ }//getmessageAction() 获取站内消息
+
+ //ftp测试
+ function ftptestAction()
+ {
+ }
+
+ function recoveryAction()
+ {
+ $pages=20;
+ $ac=$this->_request->getParam('ac');
+ if ($ac=='' || $ac=='online')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ (select floor(sum(filesize)/1024/1024*100)/100 from datafile where dsid=ds.id) as filesize,
+ (select count(id) from datafile where dsid=ds.id) as filecount from metadata m
+ LEFT JOIN mdstatus s ON m.uuid=s.uuid
+ LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ where s.status>4 and m.datatype=0 and ds.host='ftp1.westgis.ac.cn'
+ ORDER BY m.id DESC";
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage($pages);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
+ $this->view->paginator=$paginator;
+ } else if ($ac=='heihe')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ (select floor(sum(filesize)/1024/1024*100)/100 from datafile where dsid=ds.id) as filesize,
+ (select count(id) from datafile where dsid=ds.id) as filecount from metadata m
+ LEFT JOIN mdstatus s ON m.uuid=s.uuid
+ LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ left join datasource on datasource.uuid=m.uuid
+ left join source on datasource.sourceid=source.id
+ where s.status>4 and m.datatype=1 and ds.host='ftp1.westgis.ac.cn' and source.code='heihe'
+ ORDER BY m.id DESC";
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage($pages);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
+ $this->view->paginator=$paginator;
+ } else if ($ac=='water')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ (select floor(sum(filesize)/1024/1024*100)/100 from datafile where dsid=ds.id) as filesize,
+ (select count(id) from datafile where dsid=ds.id) as filecount from metadata m
+ LEFT JOIN mdstatus s ON m.uuid=s.uuid
+ LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ left join datasource on datasource.uuid=m.uuid
+ left join source on datasource.sourceid=source.id
+ where s.status>4 and m.datatype=1 and ds.host='ftp1.westgis.ac.cn' and source.code='water'
+ ORDER BY m.id DESC";
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage($pages);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
+ $this->view->paginator=$paginator;
+ } else if ($ac=='heihe1')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ (select floor(sum(filesize)/1024/1024*100)/100 from datafile where dsid=ds.id) as filesize,
+ (select count(id) from datafile where dsid=ds.id) as filecount from metadata m
+ LEFT JOIN mdstatus s ON m.uuid=s.uuid
+ LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ left join datasource on datasource.uuid=m.uuid
+ left join source on datasource.sourceid=source.id
+ where s.status in (2,3,4) and ds.host='ftp1.westgis.ac.cn' and source.code='heihe'
+ ORDER BY m.title DESC";
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage($pages);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
+ $this->view->paginator=$paginator;
+ } else if ($ac=='hiwater')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ (select floor(sum(filesize)/1024/1024*100)/100 from datafile where dsid=ds.id) as filesize,
+ (select count(id) from datafile where dsid=ds.id) as filecount from metadata m
+ LEFT JOIN mdstatus s ON m.uuid=s.uuid
+ LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ left join datasource on datasource.uuid=m.uuid
+ left join source on datasource.sourceid=source.id
+ where ds.host='ftp1.westgis.ac.cn' and source.code='hiwater'
+ ORDER BY m.title DESC";
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage($pages);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
+ $this->view->paginator=$paginator;
+ }else if ($ac=='westee')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ (select floor(sum(filesize)/1024/1024*100)/100 from datafile where dsid=ds.id) as filesize,
+ (select count(id) from datafile where dsid=ds.id) as filecount from metadata m
+ LEFT JOIN mdstatus s ON m.uuid=s.uuid
+ LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ where ds.host='ftp1.westgis.ac.cn' and m.uuid in (select uuid from westeemd)
+ ORDER BY m.title DESC";
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage($pages);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
+ $this->view->paginator=$paginator;
+ }else if ($ac=='other')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ (select floor(sum(filesize)/1024/1024*100)/100 from datafile where dsid=ds.id) as filesize,
+ (select count(id) from datafile where dsid=ds.id) as filecount from metadata m
+ LEFT JOIN mdstatus s ON m.uuid=s.uuid
+ LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ where ds.host='ftp1.westgis.ac.cn' and m.uuid not in (select uuid from datasource) and m.uuid not in (select uuid from westeemd)
+ ORDER BY m.title DESC";
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage($pages);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
+ $this->view->paginator=$paginator;
+ }
+ }
+
}
diff --git a/application/admin/views/scripts/sys/left.phtml b/application/admin/views/scripts/sys/left.phtml
index f68e5f0d..4340d407 100644
--- a/application/admin/views/scripts/sys/left.phtml
+++ b/application/admin/views/scripts/sys/left.phtml
@@ -2,5 +2,7 @@
英文发表的成果依据以下规范注明: The data set is provided by Environmental and Ecological Science Data Center for West China,National Natural Science Foundation of China (http://westdc.westgis.ac.cn)
英文发表的成果依据以下规范注明: The data set is provided by Environmental and Ecological Science Data Center for West China,National Natural Science Foundation of China (http://westdc.westgis.ac.cn)
此数据还在评审过程中,我们真切地邀请您参加此数据的评审,以便我们能尽快发布此数据!评审
- -数据评论
-