Skip to content
GitLab
Menu
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
cc2d9ee3
Commit
cc2d9ee3
authored
Jan 10, 2014
by
Matija Obreza
Browse files
View datasets by instCode
parent
34283223
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/GenesysService.java
View file @
cc2d9ee3
...
...
@@ -69,6 +69,7 @@ public interface GenesysService {
List
<
Metadata
>
listMetadata
(
Accession
accession
);
Page
<
Metadata
>
listMetadata
(
Pageable
pageable
);
Page
<
Metadata
>
listDatasets
(
FaoInstitute
faoInstitute
,
Pageable
pageable
);
Metadata
getMetadata
(
long
metadataId
);
...
...
@@ -128,4 +129,5 @@ public interface GenesysService {
void
refreshMetadataMethods
();
}
src/main/java/org/genesys2/server/service/impl/GenesysServiceImpl.java
View file @
cc2d9ee3
...
...
@@ -271,6 +271,11 @@ public class GenesysServiceImpl implements GenesysService, TraitService, Dataset
return
metadataRepository
.
findAll
(
pageable
);
}
@Override
public
Page
<
Metadata
>
listDatasets
(
FaoInstitute
faoInstitute
,
Pageable
pageable
)
{
return
metadataRepository
.
findByInstituteCode
(
faoInstitute
.
getCode
(),
pageable
);
}
@Override
public
Metadata
getMetadata
(
long
metadataId
)
{
return
metadataRepository
.
findOne
(
metadataId
);
...
...
@@ -708,7 +713,7 @@ public class GenesysServiceImpl implements GenesysService, TraitService, Dataset
zos
.
finish
();
}
@Override
@Transactional
@PreAuthorize
(
"hasRole('ADMINISTRATOR')"
)
...
...
src/main/java/org/genesys2/server/servlet/controller/WiewsController.java
View file @
cc2d9ee3
...
...
@@ -85,7 +85,7 @@ public class WiewsController extends BaseController {
@RequestMapping
(
"/{wiewsCode}"
)
public
String
view
(
ModelMap
model
,
@PathVariable
(
value
=
"wiewsCode"
)
String
wiewsCode
)
{
_logger
.
debug
(
"Viewing
country
"
+
wiewsCode
);
_logger
.
debug
(
"Viewing
institute
"
+
wiewsCode
);
FaoInstitute
faoInstitute
=
instituteService
.
getInstitute
(
wiewsCode
);
if
(
faoInstitute
==
null
)
{
throw
new
ResourceNotFoundException
();
...
...
@@ -105,6 +105,19 @@ public class WiewsController extends BaseController {
return
"/wiews/details"
;
}
@RequestMapping
(
"/{wiewsCode}/datasets"
)
public
String
viewDatasets
(
ModelMap
model
,
@PathVariable
(
value
=
"wiewsCode"
)
String
wiewsCode
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
)
{
_logger
.
debug
(
"Viewing datasets for instCode="
+
wiewsCode
);
FaoInstitute
faoInstitute
=
instituteService
.
getInstitute
(
wiewsCode
);
if
(
faoInstitute
==
null
)
{
throw
new
ResourceNotFoundException
();
}
model
.
addAttribute
(
"faoInstitute"
,
faoInstitute
);
model
.
addAttribute
(
"pagedData"
,
genesysService
.
listDatasets
(
faoInstitute
,
new
PageRequest
(
page
-
1
,
30
)));
return
"/metadata/index"
;
}
@PreAuthorize
(
"hasRole('ADMINISTRATOR')"
)
@RequestMapping
(
"/{wiewsCode}/edit"
)
public
String
edit
(
ModelMap
model
,
@PathVariable
(
value
=
"wiewsCode"
)
String
wiewsCode
)
{
...
...
Write
Preview
Supports
Markdown
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