Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
5d66ca13
Commit
5d66ca13
authored
Jan 11, 2014
by
Matija Obreza
Browse files
Display count of, and link to institute datasets
parent
6e2c385e
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/persistence/domain/MetadataRepository.java
View file @
5d66ca13
...
...
@@ -30,4 +30,7 @@ public interface MetadataRepository extends JpaRepository<Metadata, Long> {
List
<
Metadata
>
findByIds
(
List
<
Long
>
oids
);
Page
<
Metadata
>
findByInstituteCode
(
String
wiewsCode
,
Pageable
pageable
);
@Query
(
"select count(m) from Metadata m where m.instituteCode = ?1"
)
long
countByInstituteCode
(
String
instCode
);
}
src/main/java/org/genesys2/server/service/GenesysService.java
View file @
5d66ca13
...
...
@@ -132,4 +132,6 @@ public interface GenesysService {
void
refreshMetadataMethods
();
long
countDatasets
(
FaoInstitute
faoInstitute
);
}
src/main/java/org/genesys2/server/service/impl/GenesysServiceImpl.java
View file @
5d66ca13
...
...
@@ -275,6 +275,11 @@ public class GenesysServiceImpl implements GenesysService, TraitService, Dataset
public
Page
<
Metadata
>
listDatasets
(
FaoInstitute
faoInstitute
,
Pageable
pageable
)
{
return
metadataRepository
.
findByInstituteCode
(
faoInstitute
.
getCode
(),
pageable
);
}
@Override
public
long
countDatasets
(
FaoInstitute
faoInstitute
)
{
return
metadataRepository
.
countByInstituteCode
(
faoInstitute
.
getCode
());
}
@Override
public
Metadata
getMetadata
(
long
metadataId
)
{
...
...
src/main/java/org/genesys2/server/servlet/controller/WiewsController.java
View file @
5d66ca13
...
...
@@ -96,6 +96,7 @@ public class WiewsController extends BaseController {
model
.
addAttribute
(
"blurp"
,
contentService
.
getArticle
(
faoInstitute
,
"blurp"
,
getLocale
()));
model
.
addAttribute
(
"countByInstitute"
,
genesysService
.
countByInstitute
(
faoInstitute
));
model
.
addAttribute
(
"datasetCount"
,
genesysService
.
countDatasets
(
faoInstitute
));
// model.addAttribute("statisticsCrop",
// genesysService.statisticsCropByInstitute(faoInstitute, new
// PageRequest(0, 30)));
...
...
src/main/resources/content/language.properties
View file @
5d66ca13
...
...
@@ -124,6 +124,7 @@ select-country=Select country
faoInstitutes.page.list.title
=
WIEWS Institutes
faoInstitutes.page.profile.title
=
WIEWS {0}
faoInstitutes.stat.accessionCount
=
Accessions in Genesys: {0}.
faoInstitutes.stat.datasetCount
=
Additional datasets in Genesys: {0}.
faoInstitute.stat-by-crop
=
Most represented Crops
faoInstitute.stat-by-genus
=
Most represented Genera
faoInstitute.stat-by-species
=
Most represented Species
...
...
@@ -142,6 +143,7 @@ faoInstitute.url=Web link
faoInstitute.member-of-organizations-and-networks
=
Organizations and Networks:
view.accessions
=
View accessions...
view.datasets
=
View datasets...
paged.pageOfPages
=
Page {0} of {1}
paged.totalElements
=
{0} entries
...
...
src/main/webapp/WEB-INF/jsp/wiews/details.jsp
View file @
5d66ca13
...
...
@@ -24,6 +24,11 @@
<c:if
test=
"
${
countByInstitute
gt
0
}
"
>
<a
href=
"
<c:url
value=
"/wiews/${faoInstitute.code.toLowerCase()}/data"
/>
"
><spring:message
code=
"view.accessions"
/></a>
</c:if>
<spring:message
code=
"faoInstitutes.stat.datasetCount"
arguments=
"
${
datasetCount
}
"
/>
<c:if
test=
"
${
datasetCount
gt
0
}
"
>
<a
href=
"
<c:url
value=
"/wiews/${faoInstitute.code.toLowerCase()}/datasets"
/>
"
><spring:message
code=
"view.datasets"
/></a>
</c:if>
</div>
<div
class=
""
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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