创建自己的视图¶
如果您不想编辑共享的默认文件,或者如果您想要一个真正不同的UI,最好的方法是创建您自己的自定义视图。
添加新视图¶
如前一节所述,您需要设置多个文件来加载新的UI视图。
在中创建新文件夹
web-ui/src/main/resources/catalog/views/
.添加一个
templates/index.html
在这个文件夹里。添加一个javascript文件加载您的主要AngularJS模块
添加较少的文件
自定义视图¶
假设要创建自定义视图名称 geoportal .
您需要创建一个新文件夹
web-ui/src/main/resources/catalog/views/geoportal
.添加新文件
web-ui/src/main/resources/catalog/views/geoportal/templates/index.html
包含
<div class="geoportal">Welcome to geoportal</div>
添加新文件
web-ui/src/main/resources/catalog/views/geoportal/search.js
包含
(function() {
goog.provide('gn_search_geoportal');
goog.require('gn_search');
var module = angular.module('gn_search_geoportal', ['gn_search']);
})();
注解
你必须包括 gn_search
模块。
添加新文件
web-ui/src/main/resources/catalog/geoportal/views/geoportal/less/gn_search_geoportal.less
包含
.geoportal {
font-size: 36px;
font-weight: bold;
}
启动视图¶
要查看新视图,可以启动 catalog.search 使用新参数视图的服务:http://localhost/本地主机:8080/地理网络/srv/eng/目录搜索?视图=地理位置
或者,进入管理员设置页面并设置 system/ui/defaultView
( User interface configuration -> Choose the user interface to use )至 geoportal
。