update metadata list in admin

This commit is contained in:
jack 2018-06-21 16:14:47 +08:00
parent 590313d5c7
commit 1c8a523f9b
3 changed files with 61 additions and 22 deletions

View File

@ -304,7 +304,7 @@ class Admin_DataController extends Zend_Controller_Action
$keyword = $this->_getParam('keyword'); $keyword = $this->_getParam('keyword');
$att=$this->_getParam('att'); $att=$this->_getParam('att');
$attupdate = $this->_getParam('attupdate'); $attupdate = $this->_getParam('attupdate');
$source = (int)$this->_getParam('source');
if ($delete) if ($delete)
{ {
@ -498,25 +498,28 @@ class Admin_DataController extends Zend_Controller_Action
}//search }//search
else{ else{
$sourceSql = "";
$sql = "SELECT md.*,s.viewed,g.id as gid,gen.id as genid,st.status as mdstatus,ds.id as datasetid,spatial.stid as stid FROM metadata md $sourceJoin = "";
LEFT JOIN mdstat s ON md.uuid=s.uuid if($source && is_int($source)){
LEFT JOIN geonetworkmetadata g ON g.uuid=md.uuid $sourceJoin = " LEFT JOIN datasource dsrc ON dsrc.uuid=md.uuid ";
LEFT JOIN mdstatus st ON md.uuid=st.uuid $sourceSql = " WHERE dsrc.sourceid=$source ";
LEFT JOIN dataset ds ON md.uuid=ds.uuid and ds.lang in ('','cn') }
left join en.geonetworkmetadata gen on gen.uuid=md.uuid
left join (select count(uuid) as stid,uuid from dataspatial group by uuid) as spatial on spatial.uuid=md.uuid $sql = "SELECT md.*,s.viewed,g.id as gid,gen.id as genid,st.status as mdstatus,ds.id as datasetid,spatial.stid as stid FROM metadata md
ORDER BY md.id DESC"; LEFT JOIN mdstat s ON md.uuid=s.uuid
$sth = $this->db->prepare($sql); LEFT JOIN geonetworkmetadata g ON g.uuid=md.uuid
$sth->execute(); LEFT JOIN mdstatus st ON md.uuid=st.uuid
$rows = $sth->fetchAll(); LEFT JOIN dataset ds ON md.uuid=ds.uuid and ds.lang in ('','cn')
left join en.geonetworkmetadata gen on gen.uuid=md.uuid
$paginator = Zend_Paginator::factory($rows); left join (select count(uuid) as stid,uuid from dataspatial group by uuid) as spatial on spatial.uuid=md.uuid
$paginator->setCurrentPageNumber($this->_getParam('page')); $sourceJoin
$paginator->setItemCountPerPage($this->view->config->page->max); $sourceSql
$paginator->setView($this->view); ORDER BY md.id DESC";
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); $sth = $this->db->prepare($sql);
$this->view->paginator=$paginator; $sth->execute();
$rows = $sth->fetchAll();
view::addPaginator($rows, $this, 10);
} }
}//mdAction 元数据管理 }//mdAction 元数据管理

View File

@ -36,7 +36,13 @@
<span class="input-group-btn"><button class="btn btn-default" value="搜索">搜索</button></span> <span class="input-group-btn"><button class="btn btn-default" value="搜索">搜索</button></span>
</form> </form>
</div><!-- search DIV --> </div><!-- search DIV -->
<p><a href="/admin/data/md/down/1">下载全部xml元数据</a></p> <p>
<a href="/admin/data/md/down/1" class="btn btn-default">下载全部xml元数据</a>
<a href="/admin/data/md/1" class="btn btn-default">所有元数据</a>
<a href="/admin/data/md/source/9" class="btn btn-default">三极元数据</a>
<a href="/admin/data/md/source/10" class="btn btn-default">泛三极元数据</a>
<a href="/admin/data/md/source/11" class="btn btn-default">三江源元数据</a>
</p>
<?php if (count($this->paginator)): ?> <?php if (count($this->paginator)): ?>
<div class="datalist"> <div class="datalist">
<ul class="list-unstyled"> <ul class="list-unstyled">

View File

@ -16,4 +16,34 @@ Host sj
拷贝公钥到服务器下,然后运行部署命令即可部署,无需登录服务器 拷贝公钥到服务器下,然后运行部署命令即可部署,无需登录服务器
`shipit main deploy` or `npm run d` `shipit main deploy` or `npm run d`
### 时空三极网站数据库
创建用户: `gis`,密码: `gispassword`
```sql
CREATE DATABASE geonetwork
WITH
OWNER = gis
ENCODING = 'UTF8'
CONNECTION LIMIT = -1;
CREATE DATABASE metadata
WITH
OWNER = gis
ENCODING = 'UTF8'
CONNECTION LIMIT = -1;
```
然后在两个数据库中分别运行
```sql
CREATE EXTENSION dblink;
CREATE EXTENSION hstore;
CREATE EXTENSION pgcrypto;
CREATE EXTENSION "uuid-ossp";
CREATE EXTENSION postgis;
CREATE EXTENSION tablefunc;
```