add elements to dci

This commit is contained in:
wlx 2014-03-03 13:34:19 +00:00
parent 8a4a5c4386
commit 7a9d11a977
1 changed files with 47 additions and 3 deletions

View File

@ -1826,7 +1826,8 @@ class ServiceController extends Zend_Controller_Action
<BibliographicData> <BibliographicData>
<AuthorList>'; <AuthorList>';
$sql="select title_en,doi,author_en,ts_published from datadoi where uuid=".$this->db->quote($uuid); $sql="select d.title_en,d.doi,author_en,d.ts_published,m.description,m.timebegin,m.timeend
from datadoi d left join en.normalmetadata m on d.uuid=m.uuid where d.uuid=".$this->db->quote($uuid);
$row=$this->db->fetchRow($sql); $row=$this->db->fetchRow($sql);
$authors=explode(',',str_replace('"','',substr($row['author_en'],1,-1))); $authors=explode(',',str_replace('"','',substr($row['author_en'],1,-1)));
$i=0; $i=0;
@ -1839,7 +1840,7 @@ class ServiceController extends Zend_Controller_Action
$xml.=' $xml.='
</AuthorList> </AuthorList>
<TitleList> <TitleList>
<ItemTitle TitleType="English title">'.$row['title_en'].'</ItemTitle> <ItemTitle TitleType="English title"><![CDATA['.$row['title_en'].']]></ItemTitle>
</TitleList> </TitleList>
<Source> <Source>
<SourceURL>http://card.westgis.ac.cn/data/'.$uuid.'</SourceURL> <SourceURL>http://card.westgis.ac.cn/data/'.$uuid.'</SourceURL>
@ -1849,7 +1850,50 @@ class ServiceController extends Zend_Controller_Action
<LanguageList> <LanguageList>
<Language>English</Language> <Language>English</Language>
</LanguageList> </LanguageList>
</BibliographicData> </BibliographicData>';
$xml.='<Abstract><![CDATA['.$row['description'].']]></Abstract>';
$xml.='<DescriptorsData>';
$sql="select k.keyword from en.keyword k left join en.normalmetadata m on k.id=m.id where k.keytype='theme' and m.uuid=".$this->db->quote($uuid);
$rowk=$this->db->fetchAll($sql);
$xml.='<KeywordsList>';
foreach ($rowk as $k)
{
$xml.='<Keyword><![CDATA['.$k['keyword'].']]></Keyword>';
}
$xml.='
</KeywordsList>';
if ($row['timebegin'])
{
$xml.='<TimeperiodList>
<TimePeriod TimeSpan="Start">'.date('Y-m-d',strtotime($row['timebegin'])).'</TimePeriod>';
if ($row['timeend'] && (date('Y-m-d',strtotime($row['timebegin']))!=date('Y-m-d',strtotime($row['timeend'])))) $xml.='
<TimePeriod TimeSpan="End">'.$row['timeend'].'</TimePeriod>';
$xml.='</TimeperiodList>';
}
$xml.='</DescriptorsData>';
$sql="select f.* from fund f left join mdfund mf on f.id=mf.fid where mf.uuid=".$this->db->quote($uuid).' order by mf.place asc';
$rowf=$this->db->fetchAll($sql);
$xml.='<FundingInfo>';
foreach ($rowf as $f)
{
$xml.='
<FundingInfoList>
<FundingStatement><GrantNumber>'.$f['fund_id'].'</GrantNumber><FundingOrganization>'.$f['fund_type_en'].'</FundingOrganization></FundingStatement>
</FundingInfoList>';
}
$xml.='</FundingInfo>';
$sql="select r.* from reference r left join mdref mr on r.id=mr.refid where mr.reftype=1 and r.language<>'zh' and mr.uuid=".$this->db->quote($uuid).' order by mr.place asc';
$rowc=$this->db->fetchAll($sql);
$xml.='<CitationList>';
foreach ($rowc as $c)
{
$xml.='<Citation CitationType="Citing" CitationSeq="1">
<CitationString>'.$c['reference'].'</CitationString>';
if ($c['doi'])
$xml.='<CitationDOI>'.$c['doi'].'</CitationDOI>';
$xml.='</Citation>';
}
$xml.='</CitationList>
</DataRecord> </DataRecord>
</DigitalContentData>'; </DigitalContentData>';
$this->getResponse()->setHeader('Content-Type', 'text/xml') $this->getResponse()->setHeader('Content-Type', 'text/xml')