diff --git a/application/default/controllers/ServiceController.php b/application/default/controllers/ServiceController.php index 1167a21d..426c0ccb 100644 --- a/application/default/controllers/ServiceController.php +++ b/application/default/controllers/ServiceController.php @@ -1805,6 +1805,54 @@ class ServiceController extends Zend_Controller_Action public function jsonexit($data){ $this->getResponse()->setHeader('Content-Type', 'application/json')->appendBody(json_encode($data,JSON_NUMERIC_CHECK)); return true; - } - + } + + public function dciAction() + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + //must have doi to output dci + $uuid=$this->_request->getParam('uuid'); + + $xml=' + + +
+ '.date("Y-m-d").' + Cold and Arid Regions Science Data Center at Lanzhou + CARD-WDS + '.$uuid.' +
+ + '; + + $sql="select title_en,doi,author_en,ts_published from datadoi where uuid=".$this->db->quote($uuid); + $row=$this->db->fetchRow($sql); + $authors=explode(',',str_replace('"','',substr($row['author_en'],1,-1))); + $i=0; + foreach($authors as $a) + { + $i=$i+1; + $xml.=''; + $xml.=''.$a.''; + } + $xml.=' + + + '.$row['title_en'].' + + + http://card.westgis.ac.cn/data/'.$uuid.' + CARD + '.date('Y',strtotime($row['ts_published'])).' + + + English + + +
+
'; + $this->getResponse()->setHeader('Content-Type', 'text/xml') + ->setBody($xml); + } }