重新整理知识积累平台

This commit is contained in:
wlx 2013-11-12 07:02:40 +00:00
parent 9260c03a60
commit d7eec24005
9 changed files with 211 additions and 151 deletions

View File

@ -15,7 +15,7 @@ class KnowledgeController extends Zend_Controller_Action
function datacenterAction()
{
$siteid="e31f5ea7-a4af-4ae3-9ac1-1a84132c4338";//site uuid from geonetowrk
$sql="select * from mdref mr left join reference r on mr.refid=r.id where mr.uuid=? order by r.id desc";
$sql="select * from mdref mr left join reference r on mr.refid=r.id where mr.uuid=? order by r.year desc, reference desc";
$sth = $this->db->prepare($sql);
$sth->execute(array($siteid));
$rows = $sth->fetchAll();
@ -26,9 +26,9 @@ class KnowledgeController extends Zend_Controller_Action
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
}
function userAction()
function waterAction()
{
$sql="select * from reference where id in (select refid from mdref where reftype=1 and uuid in (select uuid from normalmetadata)) order by id desc";
$sql="select * from reference where id in (select refid from mdref where uuid in (select uuid from en.normalmetadata)) order by year desc, reference desc";
$sth = $this->db->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();
@ -39,9 +39,24 @@ class KnowledgeController extends Zend_Controller_Action
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
}
function userAction()
{
$sql="select * from reference where id in (select refid from mdref where reftype=1 and uuid in (select uuid from normalmetadata)) order by year desc, reference desc";
$sth = $this->db->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(10);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
}
function authorAction()
{
$sql="select * from reference where id in (select refid from mdref where reftype=0 and uuid in (select uuid from normalmetadata)) order by id desc";
$sql="select * from reference where id in (select refid from mdref where reftype=0 and uuid in (select uuid from normalmetadata)) order by year desc, reference desc";
$sth = $this->db->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();
@ -66,14 +81,15 @@ class KnowledgeController extends Zend_Controller_Action
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
}
function searchAction()
{
$key=$this->_request->getParam('q');
$author = (int)$this->_request->getParam('author');
$source=$this->_request->getParam('searchsource');
if(preg_match("/\"|'|<|>/",$key))
{
$data=array('<'=>'&lt;','>'=>'&gt;', "\'"=>'', "\""=>'”');
$patterns = array();
$replacements = array();
foreach($data as $k=>$v)
@ -86,10 +102,13 @@ class KnowledgeController extends Zend_Controller_Action
$key=preg_replace($patterns, $replacements, $key);
}
if (!empty($key) && $source=='datasource') {
if (!empty($key)) {
$search=new SimpleSearch($key);
$where=$search->sql_expr(array("reference"));
$sql="select * from reference where ".$where." order by id desc";
$sql="select * from reference where ".$where." order by year desc, reference desc";
} else if ($author) {
$sql="select * from reference where id in (select a1.id from ref_author a1,ref_author a2 where a1.firstname=a2.firstname and a1.lastname=a2.lastname and a2.id=$author)";
}
$sth = $this->db->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();
@ -102,25 +121,9 @@ class KnowledgeController extends Zend_Controller_Action
$this->view->key=$key;
$this->view->source=$source;
$this->_helper->viewRenderer('search-data');
}
else if (!empty($key) && $source=='westsource') {
$search=new SimpleSearch($key);
$where=$search->sql_expr(array("c.title","a.author"));
$sql="select distinct a.author,c.title,c.publisher,c.ts_created,c.ts_issued,c.item_id,c.url from knl_article c left join knl_author a on c.item_id=a.item_id where c.url <>'' and a.place=1 and $where order by ts_created desc";
$sth = $this->db->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(10);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
$this->view->key=$key;
$this->view->source=$source;
//$this->_helper->viewRenderer('search-data');
}
}
function paperAction()
{
$id = (int)$this->_request->getParam('id');

View File

@ -5,7 +5,7 @@ $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/knowledge">知识积累</a>');
$this->breadcrumb('数据作者');
$this->breadcrumb('作者推荐文献库');
$this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/jquery.colorbox-min.js');
$this->headLink()->appendStylesheet('/css/colorbox.css');
@ -16,20 +16,23 @@ $this->headLink()->appendStylesheet('/css/colorbox.css');
</div>
<div class="span9">
<div id="content">
<h2>数据作者文献库</h2>
<h2>作者推荐文献库</h2>
<div>
<?php if (count($this->paginator)): ?>
<ul>
<ol start="<?php echo ($this->paginator->getCurrentPageNumber() - 1) * $this->paginator->getItemCountPerPage()+1; ?>">
<?php foreach ($this->paginator as $item): ?>
<li> <?php echo $item['reference']; ?>
<?php if (!empty($item['link'])) :
<li> <?php echo $item['reference'];
echo ' <a href="/knowledge/paper/id/'.$item['id'].'"><i class="icon-info-sign text-success"></i>查看</a>';
if (!empty($item['link'])) :
echo ' <a href="'.$item['link'].'">下载</a>';
else :
if (!empty($item['attid'])) echo ' <a href="/service/attach/id/'.$item['attid'].'"><i class="icon-download text-success"></i>下载</a>';
endif;
?>
<a class="btn btn-mini btn-info" href="javascript:;" onclick="showdata('<?php echo $item['id'];?>',0)">相关数据</a>
<a href="javascript:;" onclick="showdata('<?php echo $item['id'];?>',0)"><i class="icon-external-link text-success"></i>相关数据</a>
</li>
<?php endforeach; ?>
</ul>
</ol>
<div class="pagenavi"><?= $this->paginator; ?></div>
<?php endif; ?>
</div>

View File

@ -17,16 +17,19 @@ $this->breadcrumb()->setSeparator(' > ');
<h2>数据中心文献库</h2>
<div>
<?php if (count($this->paginator)): ?>
<ul>
<ol start="<?php echo ($this->paginator->getCurrentPageNumber() - 1) * $this->paginator->getItemCountPerPage()+1; ?>">
<?php foreach ($this->paginator as $item): ?>
<li> <?php echo $item['reference']; ?>
<?php if (!empty($item['link'])) :
<li> <?php echo $item['reference'];
echo ' <a href="/knowledge/paper/id/'.$item['id'].'"><i class="icon-info-sign text-success"></i>查看</a>';
if (!empty($item['link'])) :
echo ' <a href="'.$item['link'].'">下载</a>';
else :
if (!empty($item['attid'])) echo ' <a href="/service/attach/id/'.$item['attid'].'"><i class="icon-download text-success"></i>下载</a>';
endif;
?>
</li>
<?php endforeach; ?>
</ul>
</ol>
<div class="pagenavi"><?= $this->paginator; ?></div>
<?php endif; ?>
</div>

View File

@ -10,16 +10,6 @@ $this->breadcrumb()->setSeparator(' > ');
<div class="row">
<div class="span3">
<?= $this->partial('knowledge/navi.phtml'); ?>
<div class="sidebar-nav bs-review-nav">
<ul class="nav nav-list bs-review-sidenav">
<li> <a href="http://seekspace.resip.ac.cn/handle/2239/1" target="_blank"><i class="icon-share"></i>西部计划资源</a> </li>
<li> <a href="http://seekspace.resip.ac.cn/handle/2239/2" target="_blank"><i class="icon-share"></i>环境与生态科学期刊资源 </a> </li>
<li> <a href="http://seekspace.resip.ac.cn/handle/2239/12" target="_blank"><i class="icon-share"></i>环境与生态科学信息网关 </a> </li>
<li> <a href="http://seekspace.resip.ac.cn/handle/2239/13" target="_blank"><i class="icon-share"></i>环境与生态科学开放知识资源 </a> </li>
<li> <a href="http://seekspace.resip.ac.cn/handle/2239/2460" target="_blank"><i class="icon-share"></i>西部环境与生态科学文献库 </a> </li>
<li> <a href="http://seekspace.resip.ac.cn/handle/2239/23662" target="_blank"><i class="icon-share"></i>黑河流域研究 </a> </li>
</ul>
</div>
</div>
<div class="span9">
<div id="myCarousel" class="carousel slide">
@ -27,10 +17,32 @@ $this->breadcrumb()->setSeparator(' > ');
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>
<!-- Carousel items -->
<div class="carousel-inner">
<div class="active item hero-unit"><h2>西部计划文献库</h2>
<div class="active item hero-unit">
<h2>数据施引文献库</h2>
<p>数据施引文献库是数据用户在使用科学数据后公开发表在科技期刊上的文献,由用户自发通知数据中心、数据作者收集和数据中心集中手机三种方式进行收集整理。</p>
<p>从数据用户的文献库中,可以挖掘出更多的知识,了解用户是如何使用数据中心提供的科学数据。数据作者也可以从其中获取到数据相关的趋势性知识。
数据中心也欢迎用户提供更多的公开发表成果,我们将持续更新其内容,以满足数据的深层挖掘,实现学术信息进行搜索、发现、聚集和再组织。</p>
<p><a class="btn btn-primary" href="/knowledge/user">查看 &raquo;</a></p>
</div>
<div class="item hero-unit">
<h2>作者推荐文献库</h2>
<p>作者推荐文献库是对发布在数据中心的科学数据的作者所推荐的和其数据相关的科技文献,主要是由数据作者发表的、和其数据紧密相关的科学文献。</p>
<p>用户可以通过数据作者的文献库中挖掘出对应的数据信息,实现从文献到数据的一个知识挖掘。将数据中心所有的数据作者文献构建一个和数据紧密相关的知识库,可以供用户更好的了解和发现数据和知识。
支持用户对数据作者的学术信息进行搜索、发现、聚集和再组织。</p>
<p><a class="btn btn-primary" href="/knowledge/author">查看 &raquo;</a></p>
</div>
<div class="item hero-unit">
<h2>WATER文献库</h2>
<p>WATER文献库是对由WATER项目所相关的科技文献包括WATER项目自身发表的文献以及WATER数据用户所发表的文献。</p>
<p>用户可以通过WATER文献库中挖掘出对应的数据信息实现从文献到数据的一个知识挖掘。将数据中心所有的数据作者文献构建一个和数据紧密相关的知识库可以供用户更好的了解和发现数据和知识。
支持用户对数据作者的学术信息进行搜索、发现、聚集和再组织。</p>
<p><a class="btn btn-primary" href="/knowledge/water">查看 &raquo;</a></p>
</div>
<div class="item hero-unit"><h2>西部计划文献库</h2>
<div class="span3"><a href="http://seekspace.resip.ac.cn" target="_blank"> <img alt="中国(西部)环境与生态科学知识积累平台" src="/images/ssimg.jpg" /></a></div>
<p>旨在发展和形成一个支持环境与生态科学领域开放学术信息的自助存档、交流和发现的领域知识平台。
首先,实现对国家自然科学基金委组织实施的“中国西部环境与生态科学研究计划”历年来所支持的研究项目和课题所产生的有重要科研和学术价值的知识产出进行统一组织和管理,
@ -38,20 +50,6 @@ $this->breadcrumb()->setSeparator(' > ');
特别是对有重要学术影响的研究性数字知识库所涉及的环境与生态科学领域的学术信息进行搜索、发现、聚集和再组织。</p>
<p><a class="btn btn-primary" href="/knowledge/westplan">查看 &raquo;</a> <a class="btn btn-info" href="http://seekspace.resip.ac.cn">访问seekspace &raquo;</a></p>
</div>
<div class="item hero-unit">
<h2>数据作者文献库</h2>
<p>数据作者文献库是对发布在数据中心的科学数据中相关的参考文献,主要是由数据作者发表的、和其数据紧密相关的科学文献。</p>
<p>用户可以通过数据作者的文献库中挖掘出对应的数据信息,实现从文献到数据的一个知识挖掘。将数据中心所有的数据作者文献构建一个和数据紧密相关的知识库,可以供用户更好的了解和发现数据和知识。
支持用户对数据作者的学术信息进行搜索、发现、聚集和再组织。</p>
<p><a class="btn btn-primary" href="/knowledge/author">查看 &raquo;</a></p>
</div>
<div class="item hero-unit">
<h2>数据用户文献库</h2>
<p>数据用户文献库是数据用户在使用科学数据后公开发表在科技期刊上的文献,由用户自发通知数据中心、数据作者收集和数据中心集中手机三种方式进行收集整理。</p>
<p>从数据用户的文献库中,可以挖掘出更多的知识,了解用户是如何使用数据中心提供的科学数据。数据作者也可以从其中获取到数据相关的趋势性知识。
数据中心也欢迎用户提供更多的公开发表成果,我们将持续更新其内容,以满足数据的深层挖掘,实现学术信息进行搜索、发现、聚集和再组织。</p>
<p><a class="btn btn-primary" href="/knowledge/user">查看 &raquo;</a></p>
</div>
</div>
<!-- Carousel nav -->
<a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>

View File

@ -1,25 +1,16 @@
<div class="sidebar-nav bs-review-nav">
<ul class="nav nav-list bs-review-sidenav">
<li id="Nav-knowledge-index"><a href="/knowledge/"><i class="icon-chevron-right"></i>介绍</a></li>
<li id="Nav-knowledge-westplan"><a href="/knowledge/westplan"><i class="icon-chevron-right"></i>西部计划文献库</a></li>
<li id="Nav-knowledge-author"><a href="/knowledge/author"><i class="icon-chevron-right"></i>数据作者文献库</a></li>
<li id="Nav-knowledge-user"><a href="/knowledge/user"><i class="icon-chevron-right"></i>数据用户文献库</a></li>
<li id="Nav-knowledge-user"><a href="/knowledge/user"><i class="icon-chevron-right"></i>数据施引文献库</a></li>
<li id="Nav-knowledge-author"><a href="/knowledge/author"><i class="icon-chevron-right"></i>作者推荐文献库</a></li>
<li id="Nav-knowledge-water"><a href="/knowledge/water"><i class="icon-chevron-right"></i>WATER文献库</a></li>
<li id="Nav-knowledge-datacenter"><a href="/knowledge/datacenter"><i class="icon-chevron-right"></i>数据中心文献库</a></li>
<li id="Nav-knowledge-westplan"><a href="/knowledge/westplan"><i class="icon-chevron-right"></i>西部计划文献库</a></li>
</ul>
</div>
<form class="form-search" id="search" enctype="application/x-www-form-urlencoded" action="/knowledge/search" method="get">
<div class="input-append">
<input class="span2" id="q" name="q" type="text" value="<?php echo (empty($this->key))?'':$this->key; ?>" placeholder="搜索作者和标题">
<button type="submit" class="btn">搜索</button>
<div class="form-actions">
<label class="radio">
<input type="radio" name="searchsource" id="datasource" value="datasource" <?php echo ($this->source=='datasource')?'checked':''; ?>>
数据文献库
</label>
<label class="radio">
<input type="radio" name="searchsource" id="westsource" value="westsource" <?php echo ($this->source=='datasource')?'':'checked'; ?>>
西部计划文献库
</label>
</div>
</div>
</form>

View File

@ -24,7 +24,7 @@ $this->headLink()->appendStylesheet('/css/colorbox.css');
<h4>作者</h4>
<ul>
<?php foreach($this->author as $a) : ?>
<li><?php echo $a['lastname'];if (!empty($a['firstname'])) echo ', '.$a['firstname']; ?></li>
<li><?php echo $a['lastname'];if (!empty($a['firstname'])) echo ', '.$a['firstname']; ?><a href="/knowledge/search/author/<?php echo $a['id']; ?>">所有文章</a></li>
<?php endforeach; ?>
</ul>
<hr />
@ -71,7 +71,7 @@ $this->headLink()->appendStylesheet('/css/colorbox.css');
echo ' <a href="'.$item['link'].'">下载</a>';
endif;
?>
<a class="btn btn-mini btn-info" href="javascript:;" onclick="showdata('<?php echo $this->paper['id'];?>',0)">相关数据(共<span id="referenceDataCount"></span>条)</a>
<a href="javascript:;" onclick="showdata('<?php echo $this->paper['id'];?>',0)"><i class="icon-external-link text-success"></i>相关数据(共<span id="referenceDataCount"></span>条)</a>
</div>
@ -79,7 +79,7 @@ $this->headLink()->appendStylesheet('/css/colorbox.css');
</div>
</div>
<script type="text/javascript" >
$('#Nav-knowledge-author').addClass('active');
$('#Nav-knowledge-user').addClass('active');
</script>
<script>
function showdata(id,page){

View File

@ -19,17 +19,20 @@ $this->headLink()->appendStylesheet('/css/colorbox.css');
<h2>数据文献搜索</h2>
<div>
<?php if (count($this->paginator)): ?>
<ul>
<ol start="<?php echo ($this->paginator->getCurrentPageNumber() - 1) * $this->paginator->getItemCountPerPage()+1; ?>">
<?php foreach ($this->paginator as $item): ?>
<li> <?php echo $item['reference']; ?>
<?php if (!empty($item['link'])) :
echo ' <a class="btn btn-mini btn-inverse" href="'.$item['link'].'">下载</a>';
<li> <?php echo $item['reference'];
echo ' <a href="/knowledge/paper/id/'.$item['id'].'"><i class="icon-info-sign text-success"></i>查看</a>';
if (!empty($item['link'])) :
echo ' <a href="'.$item['link'].'">下载</a>';
else :
if (!empty($item['attid'])) echo ' <a href="/service/attach/id/'.$item['attid'].'"><i class="icon-download text-success"></i>下载</a>';
endif;
?>
<a class="btn btn-mini btn-info" href="javascript:;" onclick="showdata('<?php echo $item['id'];?>',0)">相关数据</a>
<a href="javascript:;" onclick="showdata('<?php echo $item['id'];?>',0)"><i class="icon-external-link text-success"></i>相关数据</a>
</li>
<?php endforeach; ?>
</ul>
</ol>
<div class="pagenavi"><?= $this->paginator; ?></div>
<?php endif; ?>
</div>

View File

@ -5,7 +5,7 @@ $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/knowledge">知识积累</a>');
$this->breadcrumb('数据用户');
$this->breadcrumb('数据施引文献库');
$this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/jquery.colorbox-min.js');
$this->headLink()->appendStylesheet('/css/colorbox.css');
@ -16,20 +16,23 @@ $this->headLink()->appendStylesheet('/css/colorbox.css');
</div>
<div class="span9">
<div id="content">
<h2>数据用户文献库</h2>
<h2>数据施引文献库</h2>
<div>
<?php if (count($this->paginator)): ?>
<ul>
<ol start="<?php echo ($this->paginator->getCurrentPageNumber() - 1) * $this->paginator->getItemCountPerPage()+1; ?>">
<?php foreach ($this->paginator as $item): ?>
<li> <?php echo $item['reference']; ?>
<?php if (!empty($item['link'])) :
<li> <?php echo $item['reference'];
echo ' <a href="/knowledge/paper/id/'.$item['id'].'"><i class="icon-info-sign text-success"></i>查看</a>';
if (!empty($item['link'])) :
echo ' <a href="'.$item['link'].'">下载</a>';
else :
if (!empty($item['attid'])) echo ' <a href="/service/attach/id/'.$item['attid'].'"><i class="icon-download text-success"></i>下载</a>';
endif;
?>
<a class="btn btn-mini btn-info" href="javascript:;" onclick="showdata('<?php echo $item['id'];?>',0)">相关数据</a>
<a href="javascript:;" onclick="showdata('<?php echo $item['id'];?>',0)"><i class="icon-external-link text-success"></i>相关数据</a>
</li>
<?php endforeach; ?>
</ul>
</ol>
<div class="pagenavi"><?= $this->paginator; ?></div>
<?php endif; ?>
</div>

View File

@ -0,0 +1,56 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('知识积累');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/knowledge">知识积累</a>');
$this->breadcrumb('WATER文献库');
$this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/jquery.colorbox-min.js');
$this->headLink()->appendStylesheet('/css/colorbox.css');
?>
<div class="row">
<div class="span3">
<?= $this->partial('knowledge/navi.phtml'); ?>
</div>
<div class="span9">
<div id="content">
<h2>WATER文献库</h2>
<div>
<?php if (count($this->paginator)): ?>
<ol start="<?php echo ($this->paginator->getCurrentPageNumber() - 1) * $this->paginator->getItemCountPerPage()+1; ?>">
<?php foreach ($this->paginator as $item): ?>
<li> <?php echo $item['reference'];
echo ' <a href="/knowledge/paper/id/'.$item['id'].'"><i class="icon-info-sign text-success"></i>查看</a>';
if (!empty($item['link'])) :
echo ' <a href="'.$item['link'].'">下载</a>';
else :
if (!empty($item['attid'])) echo ' <a href="/service/attach/id/'.$item['attid'].'"><i class="icon-download text-success"></i>下载</a>';
endif;
?>
<a href="javascript:;" onclick="showdata('<?php echo $item['id'];?>',0)"><i class="icon-external-link text-success"></i>相关数据</a>
</li>
<?php endforeach; ?>
</ol>
<div class="pagenavi"><?= $this->paginator; ?></div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<script type="text/javascript" >
$('#Nav-knowledge-water').addClass('active');
</script>
<script>
function showdata(id,page){
var url="/service/refdatalist/id/"+id;
$.ajax({
'type':"GET",
'url':url,
'data':'page='+page,
'dataType':'html',
'success':function(html){$.colorbox({'html':html,'innerHeight':230});}
});
}
</script>