Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
f6aeed5a
Commit
f6aeed5a
authored
Jul 23, 2018
by
Maxym Borodenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#272
JSP: Welcome page
parent
19cae7d7
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
54 additions
and
26 deletions
+54
-26
src/main/java/org/genesys/catalog/service/DatasetService.java
...main/java/org/genesys/catalog/service/DatasetService.java
+7
-0
src/main/java/org/genesys/catalog/service/impl/DatasetServiceImpl.java
.../org/genesys/catalog/service/impl/DatasetServiceImpl.java
+8
-0
src/main/java/org/genesys2/server/mvc/HtmlController.java
src/main/java/org/genesys2/server/mvc/HtmlController.java
+1
-0
src/main/java/org/genesys2/server/service/StatisticsService.java
...n/java/org/genesys2/server/service/StatisticsService.java
+7
-4
src/main/java/org/genesys2/server/service/impl/StatisticsServiceImpl.java
...g/genesys2/server/service/impl/StatisticsServiceImpl.java
+13
-3
src/main/java/org/genesys2/spring/AddStuffInterceptor.java
src/main/java/org/genesys2/spring/AddStuffInterceptor.java
+4
-0
src/main/resources/application.properties
src/main/resources/application.properties
+2
-0
src/main/resources/content/language.properties
src/main/resources/content/language.properties
+2
-1
src/main/resources/content/language_ar.properties
src/main/resources/content/language_ar.properties
+0
-1
src/main/resources/content/language_de.properties
src/main/resources/content/language_de.properties
+0
-1
src/main/resources/content/language_es.properties
src/main/resources/content/language_es.properties
+0
-1
src/main/resources/content/language_fa.properties
src/main/resources/content/language_fa.properties
+0
-1
src/main/resources/content/language_fr.properties
src/main/resources/content/language_fr.properties
+0
-1
src/main/resources/content/language_pt.properties
src/main/resources/content/language_pt.properties
+0
-1
src/main/resources/content/language_ru.properties
src/main/resources/content/language_ru.properties
+0
-1
src/main/resources/content/language_zh.properties
src/main/resources/content/language_zh.properties
+0
-1
src/main/webapp/WEB-INF/decorator/1/menu.jsp
src/main/webapp/WEB-INF/decorator/1/menu.jsp
+5
-5
src/main/webapp/WEB-INF/jsp/index.jsp
src/main/webapp/WEB-INF/jsp/index.jsp
+5
-5
No files found.
src/main/java/org/genesys/catalog/service/DatasetService.java
View file @
f6aeed5a
...
...
@@ -225,4 +225,11 @@ public interface DatasetService {
*/
Dataset
updateDatasetFile
(
Dataset
dataset
,
RepositoryFile
metadata
)
throws
NoSuchRepositoryFileException
;
/**
* Count the number of published datasets
*
* @return the number of published datasets
*/
long
countPublished
();
}
src/main/java/org/genesys/catalog/service/impl/DatasetServiceImpl.java
View file @
f6aeed5a
...
...
@@ -476,6 +476,14 @@ public class DatasetServiceImpl implements DatasetService {
return
lazyLoad
(
datasetRepository
.
save
(
loaded
));
}
/**
* {@inheritDoc}
*/
@Override
public
long
countPublished
()
{
return
datasetRepository
.
count
(
dataset
.
published
.
eq
(
true
));
}
/**
* Copy values.
*
...
...
src/main/java/org/genesys2/server/mvc/HtmlController.java
View file @
f6aeed5a
...
...
@@ -88,6 +88,7 @@ public class HtmlController extends BaseController {
model
.
addAttribute
(
"numberOfAccessions"
,
statisticsService
.
numberOfAccessions
());
model
.
addAttribute
(
"numberOfActiveAccessions"
,
statisticsService
.
numberOfActiveAccessions
());
model
.
addAttribute
(
"numberOfHistoricAccessions"
,
statisticsService
.
numberOfHistoricAccessions
());
model
.
addAttribute
(
"numberOfPublishedDatasets"
,
statisticsService
.
numberOfPublishedDatasets
());
model
.
addAttribute
(
"organizations"
,
organizationService
.
list
(
new
PageRequest
(
0
,
5
)));
...
...
src/main/java/org/genesys2/server/service/StatisticsService.java
View file @
f6aeed5a
/*
*
* Copyright 201
4
Global Crop Diversity Trust
/*
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -12,7 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
/
*/
package
org.genesys2.server.service
;
...
...
@@ -28,14 +28,17 @@ public interface StatisticsService {
long
numberOfInstitutes
();
long
numberOfAccessions
();
long
numberOfActiveAccessions
();
long
numberOfHistoricAccessions
();
long
numberOfPublishedDatasets
();
PDCIStatistics
statisticsPDCI
(
FaoInstitute
faoInstitute
);
PDCIStatistics
statisticsPDCI
(
Organization
organization
);
PhenoStatistics
statisticsPheno
(
FaoInstitute
faoInstitute
);
}
src/main/java/org/genesys2/server/service/impl/StatisticsServiceImpl.java
View file @
f6aeed5a
/*
*
* Copyright 201
4
Global Crop Diversity Trust
/*
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -12,7 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
/
*/
package
org.genesys2.server.service.impl
;
...
...
@@ -20,6 +20,7 @@ import org.genesys2.server.model.genesys.PDCIStatistics;
import
org.genesys2.server.model.genesys.PhenoStatistics
;
import
org.genesys2.server.model.impl.FaoInstitute
;
import
org.genesys2.server.model.impl.Organization
;
import
org.genesys.catalog.service.DatasetService
;
import
org.genesys2.server.service.GenesysService
;
import
org.genesys2.server.service.GeoService
;
import
org.genesys2.server.service.InstituteService
;
...
...
@@ -45,6 +46,9 @@ public class StatisticsServiceImpl implements StatisticsService {
@Autowired
private
GenesysService
genesysService
;
@Autowired
private
DatasetService
datasetService
;
@Override
@Cacheable
(
value
=
"statistics"
,
key
=
"'stats.' + #root.methodName"
)
public
long
numberOfCountries
()
{
...
...
@@ -75,6 +79,12 @@ public class StatisticsServiceImpl implements StatisticsService {
return
genesysService
.
countAllHistoric
();
}
@Override
@Cacheable
(
value
=
"statistics"
,
key
=
"'stats.' + #root.methodName"
)
public
long
numberOfPublishedDatasets
()
{
return
datasetService
.
countPublished
();
}
@Override
@Cacheable
(
unless
=
"#result == null"
,
value
=
"statistics"
,
key
=
"'stats.' + #root.methodName + '-' + #faoInstitute.id"
)
public
PDCIStatistics
statisticsPDCI
(
FaoInstitute
faoInstitute
)
{
...
...
src/main/java/org/genesys2/spring/AddStuffInterceptor.java
View file @
f6aeed5a
...
...
@@ -51,6 +51,9 @@ public class AddStuffInterceptor implements HandlerInterceptor, InitializingBean
@Value
(
"${google.analytics.account}"
)
private
String
googleAnalyticsAccount
;
@Value
(
"${genesys.catalog.url}"
)
private
String
genesysCatalogUrl
;
public
abstract
interface
RandomString
{
/// Get a random CDN server
public
String
getNext
();
...
...
@@ -108,6 +111,7 @@ public class AddStuffInterceptor implements HandlerInterceptor, InitializingBean
request
.
setAttribute
(
"cdnServers"
,
randomCdnServer
);
request
.
setAttribute
(
"baseUrl"
,
baseUrl
);
request
.
setAttribute
(
"currentYear"
,
LocalDate
.
now
().
getYear
());
request
.
setAttribute
(
"genesysCatalogUrl"
,
genesysCatalogUrl
);
if
(
googleAnalyticsAccount
!=
null
)
{
request
.
setAttribute
(
"googleAnalyticsAccount"
,
googleAnalyticsAccount
);
...
...
src/main/resources/application.properties
View file @
f6aeed5a
...
...
@@ -209,3 +209,5 @@ itpgrfa.glis.ratelimit=20
partner.primary.uuid
=
39d3022b-dfca-45d8-98f1-3eeaa6c3e605
default.jwt.signingKey
=
genesys-signing-key-changeme
# Genesys Catalog URL
genesys.catalog.url
=
http://localhost:3000
src/main/resources/content/language.properties
View file @
f6aeed5a
...
...
@@ -95,7 +95,7 @@ footer.copyright-statement=© 2013 - {0} Data Providers and the Crop Trust
menu.home
=
Home
menu.browse
=
Browse
menu.datasets
=
C&E Data
menu.datasets
=
Datasets
menu.descriptors
=
Descriptors
menu.countries
=
Countries
menu.institutes
=
Institutes
...
...
@@ -830,6 +830,7 @@ share.link.placeholder=Please wait...
share.link.text
=
Please use the shortened version of the full URL to this page:
welcome.read-more
=
Read more about Genesys
welcome.quick-overview
=
Quick overview
twitter.latest-on-twitter
=
Latest on Twitter
video.play-video
=
Play video
...
...
src/main/resources/content/language_ar.properties
View file @
f6aeed5a
...
...
@@ -89,7 +89,6 @@ footer.copyright-statement=© 2013 - {0} مقدمو البيانات وشر
menu.home
=
الرئيسية
menu.browse
=
تصفح
menu.datasets
=
بيانات التوصيف والتقييم
menu.descriptors
=
الواصفات
menu.countries
=
الدول
menu.institutes
=
المنشآت
...
...
src/main/resources/content/language_de.properties
View file @
f6aeed5a
...
...
@@ -89,7 +89,6 @@ footer.copyright-statement=© 2013 - {0} Datenanbieter und der Crop Trust
menu.home
=
Home
menu.browse
=
Browsen
menu.datasets
=
C&E-Daten
menu.descriptors
=
Deskriptoren
menu.countries
=
Länder
menu.institutes
=
Institute
...
...
src/main/resources/content/language_es.properties
View file @
f6aeed5a
...
...
@@ -89,7 +89,6 @@ footer.copyright-statement=© 2013 - {0} Proveedores de datos y el Crop Trus
menu.home
=
Página de inicio
menu.browse
=
Navegar
menu.datasets
=
Datos de C&E
menu.descriptors
=
Descriptores
menu.countries
=
Países
menu.institutes
=
Instituciones
...
...
src/main/resources/content/language_fa.properties
View file @
f6aeed5a
...
...
@@ -89,7 +89,6 @@ footer.copyright-statement=© 2013 - {0} Data Providers and the Crop Trus
menu.home
=
صفحه اصلی
menu.browse
=
مرور
menu.datasets
=
دادههای C&E
menu.descriptors
=
توصیفگرها
menu.countries
=
کشورها
menu.institutes
=
مؤسسات
...
...
src/main/resources/content/language_fr.properties
View file @
f6aeed5a
...
...
@@ -89,7 +89,6 @@ footer.copyright-statement=© 2013 - {0} Les fournisseurs de données et le
menu.home
=
Accueil
menu.browse
=
Naviguer
menu.datasets
=
Données C&E
menu.descriptors
=
Descripteurs
menu.countries
=
Pays
menu.institutes
=
Instituts
...
...
src/main/resources/content/language_pt.properties
View file @
f6aeed5a
...
...
@@ -89,7 +89,6 @@ footer.copyright-statement=© 2013 - {0} Provedores de dados e Crop Trust
menu.home
=
Início
menu.browse
=
Navegar
menu.datasets
=
Dados de caracterização e avaliação
menu.descriptors
=
Descritores
menu.countries
=
Países
menu.institutes
=
Institutos
...
...
src/main/resources/content/language_ru.properties
View file @
f6aeed5a
...
...
@@ -89,7 +89,6 @@ footer.copyright-statement=© 2013 - {0} Провайдеры данных
menu.home
=
На главную
menu.browse
=
Просмотреть
menu.datasets
=
Данные по характеристике и оценке
menu.descriptors
=
Дескрипторы
menu.countries
=
Страны
menu.institutes
=
Институты
...
...
src/main/resources/content/language_zh.properties
View file @
f6aeed5a
...
...
@@ -89,7 +89,6 @@ footer.copyright-statement=© 2013 - {0} 数据提供者与 Crop Trust
menu.home
=
首页
menu.browse
=
浏览
menu.datasets
=
评价鉴定数据
menu.descriptors
=
描述符
menu.countries
=
国家
menu.institutes
=
机构
...
...
src/main/webapp/WEB-INF/decorator/1/menu.jsp
View file @
f6aeed5a
...
...
@@ -25,10 +25,6 @@
</div>
<ul
class=
"nav navbar-nav nav-menu"
id=
"navigation-menu"
>
<li
class=
"pull-left menu-title"
id=
"home-li"
>
<a
class=
"menu-link"
href=
"
<c:url
value=
"/welcome"
/>
"
title=
"
<spring:message
code=
"menu.home"
/>
"
><spring:message
code=
"menu.home"
/>
</a>
</li>
<li
class=
"dropdown pull-left menu-title"
id=
"about-li"
>
<a
class=
"menu-link"
id=
"about-a"
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
role=
"button"
aria-haspopup=
"true"
aria-expanded=
"false"
>
<spring:message
code=
"menu.about"
/>
<span
class=
"caret"
></span>
</a>
...
...
@@ -89,7 +85,11 @@
<a
class=
"menu-link"
href=
"
<c:url
value=
"/explore"
/>
"
>
<spring:message
code=
"menu.browse"
/>
</a>
</li>
<%-- <li><a href="<c:url value="/data/" />"><spring:message code="menu.datasets" /></a></li> --%>
<li
class=
"pull-left menu-title"
id=
"datasets-li"
>
<a
class=
"menu-link"
href=
"
<c:url
value=
'
${
genesysCatalogUrl
}
/datasets'
/>
"
title=
"
<spring:message
code=
"menu.datasets"
/>
"
>
<spring:message
code=
"menu.datasets"
/>
</a>
</li>
<%-- <li><a href="<c:url value="/descriptors/" />"><spring:message code="menu.descriptors" /></a></li> --%>
<li
class=
"pull-left menu-title"
id=
"geo-id"
>
<a
class=
"menu-link"
href=
"
<c:url
value=
"/geo/"
/>
"
>
<spring:message
code=
"menu.countries"
/>
...
...
src/main/webapp/WEB-INF/jsp/index.jsp
View file @
f6aeed5a
...
...
@@ -28,7 +28,7 @@
<div
class=
"row no-space map"
>
<div
id=
"stats"
class=
"col-md-4 col-sm-12 col-xs-12"
>
<h2
class=
"short text-right pull-left"
>
<spring:message
code=
"
maps.accession-map
"
/>
<spring:message
code=
"
welcome.quick-overview
"
/>
</h2>
<div
class=
"stats-map"
>
...
...
@@ -39,11 +39,11 @@
<spring:message
code=
"stats.number-of-accessions"
arguments=
"
${
numberOfActiveAccessions
}
"
/>
</a>
</div>
<
%-- <
div class="one-stat">
<a href="<c:url value="
/explore"><c:param name="filter" value='{"historic":[true]}' /></c:url
>">
<spring:message code="stats.number-of-
historic-accessions" arguments="${numberOfHistoricAccession
s}" />
<div
class=
"one-stat"
>
<a
href=
"
<c:url
value=
"
${
genesysCatalogUrl
}
/datasets"
/
>
"
>
<spring:message
code=
"stats.number-of-
datasets"
arguments=
"
${
numberOfPublishedDataset
s
}
"
/>
</a>
</div>
--%>
</div>
<div
class=
"one-stat"
>
<a
href=
"
<c:url
value=
"/wiews/active"
/>
"
>
<spring:message
code=
"stats.number-of-institutes"
arguments=
"
${
numberOfInstitutes
}
"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment