合并子平台的元数据格式转换处理代码
This commit is contained in:
parent
b4e46a232f
commit
de3e27b48f
|
@ -18,6 +18,7 @@ class ServiceController extends Zend_Controller_Action
|
|||
{
|
||||
$this->db=Zend_Registry::get('db');
|
||||
$this->view->config = $this->config = Zend_Registry::get('config');
|
||||
$this->submd = 'normalmetadata';
|
||||
//$this->messenger=$this->_helper->getHelper('FlashMessenger');
|
||||
//$this->view->messages = $this->messenger->getMessages();
|
||||
}
|
||||
|
@ -189,16 +190,16 @@ class ServiceController extends Zend_Controller_Action
|
|||
function feedAction()
|
||||
{
|
||||
$feedArray = array(
|
||||
'title' => '中国西部环境与生态科学数据中心',
|
||||
'link' => 'http://'.$_SERVER['SERVER_NAME'].'/data/feed',
|
||||
'description' => '共享西部计划产生的数据',
|
||||
'title' => '三江源生态监测综合服务平台',
|
||||
'link' => 'http://'.$_SERVER['SERVER_NAME'].'/service/feed',
|
||||
'description' => '管理、共享三江源生态监测数据',
|
||||
'language' => 'zh-CN',
|
||||
'charset' => 'utf-8',
|
||||
'published' => time(),
|
||||
//'generator' => 'Zend Framework Zend_Feed',
|
||||
'entries' => array()
|
||||
);
|
||||
$sql="select * from normalmetadata order by ts_created desc";
|
||||
$sql="select * from $this->submd order by ts_created desc";
|
||||
$rs=$this->db->fetchAll($sql);
|
||||
$feedArray['published']=strtotime($rs[0]['ts_created']);
|
||||
foreach($rs as $r)
|
||||
|
@ -334,7 +335,7 @@ class ServiceController extends Zend_Controller_Action
|
|||
{
|
||||
$fund.='<li>'.$refer['fund_type'].':'.str_replace(array("\r\n", "\n", "\r"),'',$refer['title']).'(编号:'.$refer['fund_id'].")</li>";
|
||||
}
|
||||
if (empty($fund)) $fund=$row['suppinfo'];
|
||||
if (empty($fund) && !empty($row['suppinfo'])) $fund=$row['suppinfo'];
|
||||
|
||||
}
|
||||
|
||||
|
@ -356,7 +357,7 @@ class ServiceController extends Zend_Controller_Action
|
|||
$xslt->setParameter('','projection',$projection);
|
||||
$xslt->setParameter('','reference',$reference);
|
||||
$xslt->setParameter('','citation',$citation);
|
||||
$xslt->setParameter('','fund',$fund);
|
||||
if ($fund) $xslt->setParameter('','fund',$fund);
|
||||
$XSL = new DOMDocument();
|
||||
$XSL->load( '../data/doc.xsl', LIBXML_NOCDATA);
|
||||
$xslt->importStylesheet($XSL);
|
||||
|
@ -540,7 +541,7 @@ class ServiceController extends Zend_Controller_Action
|
|||
$pdf->metadata=$row;
|
||||
$pdf->Draw();
|
||||
$pdf->setTitle($row['title'],true);
|
||||
$pdf->setAuthor('寒区旱区科学数据中心',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');
|
||||
|
@ -729,8 +730,8 @@ class ServiceController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
@$odf->setVars('citation',$cit,true,'utf-8');
|
||||
@$odf->setVars('reference',$row['reference'],true,'utf-8');
|
||||
@$odf->setVars('doi',$row['doi'],true,'utf-8');
|
||||
//@$odf->setVars('reference',$row['reference'],true,'utf-8');
|
||||
//@$odf->setVars('doi',$row['doi'],true,'utf-8');
|
||||
|
||||
@$odf->setVars('north',$row['north'],true,'utf-8');
|
||||
@$odf->setVars('south',$row['south'],true,'utf-8');
|
||||
|
@ -738,18 +739,18 @@ class ServiceController extends Zend_Controller_Action
|
|||
@$odf->setVars('east',$row['east'],true,'utf-8');
|
||||
if (!$ac=='simple')
|
||||
{
|
||||
@$odf->setImage('bigthumb', 'http://westdc.westgis.ac.cn/service/bigthumb/uuid/'.$row['uuid']);
|
||||
@$odf->setImage('thumb', 'http://westdc.westgis.ac.cn/service/thumb/uuid/'.$row['uuid']);
|
||||
@$odf->setImage('bigthumb', 'http://'.$_SERVER['SERVER_NAME'].'/service/bigthumb/uuid/'.$row['uuid']);
|
||||
@$odf->setImage('thumb', 'http://'.$_SERVER['SERVER_NAME'].'/service/thumb/uuid/'.$row['uuid']);
|
||||
@$odf->setVars('projection',$row['projection'],true,'utf-8');
|
||||
@$odf->setVars('resolution',$row['resolution'],true,'utf-8');
|
||||
@$odf->setVars('rfdenom',$row['rfdenom'],true,'utf-8');
|
||||
@$odf->setVars('stratum_keyword',$row['keyword']['stratum'],true,'utf-8');
|
||||
@$odf->setVars('uselimits',$row['uselimits'],true,'utf-8');
|
||||
@$odf->setVars('resources',$row['resources'],true,'utf-8');
|
||||
@$odf->setVars('suppinfo',$row['suppinfo'],true,'utf-8');
|
||||
//@$odf->setVars('suppinfo',$row['suppinfo'],true,'utf-8');
|
||||
@$odf->setVars('contacts',$row['contacts'],true,'utf-8');
|
||||
} else {
|
||||
@$odf->setImage('qrcode', 'http://westdc.westgis.ac.cn/service/qrcode/uuid/'.$row['uuid']);
|
||||
@$odf->setImage('qrcode', 'http://'.$_SERVER['SERVER_NAME'].'/service/qrcode/uuid/'.$row['uuid']);
|
||||
}
|
||||
|
||||
$odf->exportAsAttachedFile($row['title'].'.odt');
|
||||
|
@ -1793,7 +1794,7 @@ class ServiceController extends Zend_Controller_Action
|
|||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
$uuid = $this->getRequest()->getParam('uuid');
|
||||
$code_params = array('text' => 'http://westdc.westgis.ac.cn/data/'.$uuid,
|
||||
$code_params = array('text' => 'http://'.$_SERVER['SERVER_NAME'].'/data/'.$uuid,
|
||||
'backgroundColor' => '#FFFFFF',
|
||||
'foreColor' => '#000000',
|
||||
'padding' => 4, //array(10,5,10,5),
|
||||
|
|
|
@ -25,10 +25,10 @@ class MetadataPDF extends PDF_Unicode
|
|||
function DrawTitlePage()
|
||||
{
|
||||
$this->AddPage();
|
||||
$this->Image('http://westdc.westgis.ac.cn/images/westdc_logo_white.gif',80,30,0,0,'','http://westdc.westgis.ac.cn/');
|
||||
$this->Image('http://www.sanjiangyuan.org.cn/images/logo.png',80,30,0,0,'','http://www.sanjiangyuan.org.cn/');
|
||||
$this->SetFont('uGB','B',20);
|
||||
$this->setXY(0,70);
|
||||
$this->Cell(0,0,'寒区旱区科学数据中心',0,2,'C',false,'http://westdc.westgis.ac.cn/');
|
||||
$this->Cell(0,0,'三江源生态监测综合服务平台',0,2,'C',false,'http://'.$_SERVER['SERVER_NAME']);
|
||||
$imgurl='http://'.$_SERVER['SERVER_NAME'].'/service/bigthumb/uuid/'.$this->metadata['uuid'];
|
||||
$imgsize=getimagesize($imgurl);
|
||||
if ($this->metadata['filetype'] && $imgsize)
|
||||
|
@ -44,7 +44,7 @@ class MetadataPDF extends PDF_Unicode
|
|||
//$this->setFont('Arial','',12);
|
||||
$this->ln(10);
|
||||
$this->SetFont('uGB','B',12);
|
||||
$this->Cell(0,0,'UUID: '.$this->metadata['uuid'],0,2,'C',false,'http://westdc.westgis.ac.cn/data/'.$this->metadata['uuid']);
|
||||
$this->Cell(0,0,'UUID: '.$this->metadata['uuid'],0,2,'C',false,'http://'.$_SERVER['SERVER_NAME'].'/data/'.$this->metadata['uuid']);
|
||||
}
|
||||
|
||||
function DrawContent()
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
<xsl:param name="fund" select="defaultstring"/>
|
||||
<xsl:template match="/">
|
||||
<img>
|
||||
<xsl:attribute name="src">http://westdc.westgis.ac.cn/images/westdc-logo-1.png</xsl:attribute>
|
||||
<xsl:attribute name="src">http://www.sanjiangyuan.org.cn/images/logo.png</xsl:attribute>
|
||||
</img>
|
||||
<div id="uuid" style="color:red"><u>
|
||||
<xsl:variable name="uuid" select="//Metadata/mdFileID"/>
|
||||
<a href="http://westdc.westgis.ac.cn/data/{$uuid}">
|
||||
<a href="http://www.sanjiangyuan.org.cn/data/{$uuid}">
|
||||
本数据地址:<xsl:value-of select="//Metadata/mdFileID"/>
|
||||
</a>
|
||||
</u></div>
|
||||
|
@ -159,7 +159,7 @@
|
|||
<div style="text-align:center;">
|
||||
<xsl:for-each select="//Metadata/dataIdInfo/graphOver">
|
||||
|
||||
<xsl:variable name="imgurl" select="concat('http://westdc.westgis.ac.cn/gndata/',$thumburl,'/public/',bgFileName)"/>
|
||||
<xsl:variable name="imgurl" select="concat('http://www.sanjiangyuan.org.cn/gndata/',$thumburl,'/public/',bgFileName)"/>
|
||||
<xsl:if test="bgFileDesc='large_thumbnail'">
|
||||
<img width="600" class="figure" align="center">
|
||||
<xsl:attribute name="src">
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue