Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
7c325d1a
Commit
7c325d1a
authored
Sep 02, 2014
by
Matija Obreza
Browse files
Country and Institute overviews
parent
889e36af
Changes
9
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/servlet/controller/CountryController.java
View file @
7c325d1a
...
...
@@ -16,8 +16,12 @@
package
org.genesys2.server.servlet.controller
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
org.genesys2.server.model.impl.Country
;
import
org.genesys2.server.model.impl.FaoInstitute
;
import
org.genesys2.server.service.ContentService
;
...
...
@@ -25,6 +29,9 @@ import org.genesys2.server.service.FilterConstants;
import
org.genesys2.server.service.GenesysService
;
import
org.genesys2.server.service.GeoService
;
import
org.genesys2.server.service.InstituteService
;
import
org.genesys2.server.service.impl.FilterHandler
;
import
org.genesys2.server.service.impl.FilterHandler.AppliedFilter
;
import
org.genesys2.server.service.impl.FilterHandler.AppliedFilters
;
import
org.genesys2.spring.ResourceNotFoundException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
...
...
@@ -130,4 +137,19 @@ public class CountryController extends BaseController {
return
"redirect:/explore"
;
}
@RequestMapping
(
"/{country}/overview"
)
public
String
viewData
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"country"
)
String
countryStr
)
throws
UnsupportedEncodingException
{
_logger
.
debug
(
"Viewing country "
+
countryStr
);
final
Country
country
=
geoService
.
getCountry
(
countryStr
);
if
(
country
==
null
)
{
throw
new
ResourceNotFoundException
();
}
AppliedFilters
appliedFilters
=
new
AppliedFilters
();
appliedFilters
.
add
(
new
AppliedFilter
().
setFilterName
(
FilterConstants
.
ORGCTY_ISO3
).
addFilterValue
(
new
FilterHandler
.
LiteralValueFilter
(
country
.
getCode3
())));
return
"forward:/explore/overview?filter="
+
URLEncoder
.
encode
(
appliedFilters
.
toString
(),
"UTF8"
);
}
}
src/main/java/org/genesys2/server/servlet/controller/ExplorerController.java
View file @
7c325d1a
...
...
@@ -452,7 +452,7 @@ public class ExplorerController extends BaseController {
// JSP works with JsonObject
final
Map
<
String
,
List
<
String
>>
filters
=
mapper
.
readValue
(
appliedFilters
.
toString
(),
Map
.
class
);
model
.
addAttribute
(
"filters"
,
filters
);
model
.
addAttribute
(
"jsonFilter"
,
appliedFilters
.
toString
());
// Composition overview
overviewInstitutes
(
model
,
appliedFilters
);
...
...
src/main/java/org/genesys2/server/servlet/controller/WiewsController.java
View file @
7c325d1a
...
...
@@ -18,10 +18,13 @@ package org.genesys2.server.servlet.controller;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.genesys2.server.model.genesys.Taxonomy2
;
...
...
@@ -199,6 +202,21 @@ public class WiewsController extends BaseController {
model
.
addAttribute
(
"page"
,
page
);
return
"redirect:/explore"
;
}
@RequestMapping
(
"/{wiewsCode}/overview"
)
public
String
viewData
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"wiewsCode"
)
String
wiewsCode
)
throws
UnsupportedEncodingException
{
_logger
.
debug
(
"Viewing institute overview "
+
wiewsCode
);
final
FaoInstitute
faoInstitute
=
instituteService
.
getInstitute
(
wiewsCode
);
if
(
faoInstitute
==
null
)
{
throw
new
ResourceNotFoundException
();
}
AppliedFilters
appliedFilters
=
new
AppliedFilters
();
appliedFilters
.
add
(
new
AppliedFilter
().
setFilterName
(
FilterConstants
.
INSTCODE
).
addFilterValue
(
new
FilterHandler
.
LiteralValueFilter
(
faoInstitute
.
getCode
())));
return
"forward:/explore/overview?filter="
+
URLEncoder
.
encode
(
appliedFilters
.
toString
(),
"UTF8"
);
}
@RequestMapping
(
"/{wiewsCode}/t/{genus}"
)
public
String
viewDataByGenusSpecies
(
ModelMap
model
,
@PathVariable
(
value
=
"wiewsCode"
)
String
wiewsCode
,
@PathVariable
(
value
=
"genus"
)
String
genus
,
...
...
src/main/resources/content/language.properties
View file @
7c325d1a
...
...
@@ -165,8 +165,8 @@ faoInstitute.requests.mailto=Email address for material requests:
faoInstitute.allow.requests
=
Allow material requests
faoInstitute.sgsv
=
Code SGSV
view.accessions
=
View
accessions
...
view.datasets
=
View datasets
...
view.accessions
=
Browse
accessions
view.datasets
=
View datasets
paged.pageOfPages
=
Page {0} of {1}
paged.totalElements
=
{0} entries
...
...
@@ -525,7 +525,7 @@ stats.number-of-countries={0} Countries
stats.number-of-institutes
=
{0} Institutes
stats.number-of-accessions
=
{0} Accessions
navigate.back
=
Back
navigate.back
=
\u
21E0
Back
content.page.list.title
=
Article list
...
...
@@ -546,5 +546,5 @@ data-overview.sources=Sources of material
data-overview.management
=
Collection management
data-overview.availability
=
Availability of material
data-overview.otherCount
=
Other
data-overview.missingCount
=
Not
provid
ed
data-overview.missingCount
=
Not
specifi
ed
data-overview.totalCount
=
Total
src/main/webapp/WEB-INF/jsp/accession/map.jsp
View file @
7c325d1a
...
...
@@ -22,7 +22,7 @@
</form>
</div>
<div
class=
"results"
>
<a
href=
"javascript: window.history.go(-1);"
><spring:message
code=
"navigate.back"
/></a>
<a
class=
"btn btn-default"
href=
"javascript: window.history.go(-1);"
><spring:message
code=
"navigate.back"
/></a>
</div>
</div>
</div>
...
...
src/main/webapp/WEB-INF/jsp/accession/overview.jsp
View file @
7c325d1a
...
...
@@ -12,9 +12,13 @@
</h1>
<div
class=
"main-col-header clearfix"
>
<div
class=
"nav-header"
>
<div
class=
"results"
>
<a
href=
"javascript: window.history.go(-1);"
><spring:message
code=
"navigate.back"
/></a>
<div
class=
"row"
>
<div
class=
"col-xs-9 pull-right text-right"
>
<a
class=
"btn btn-default"
href=
"
<c:url
value=
"/explore"
><c:param
name=
"filter"
value=
"
${
jsonFilter
}
"
/></c:url>
"
><span
class=
"glyphicon glyphicon-eye-open"
></span><span
style=
"margin-left: 0.5em;"
><spring:message
code=
"view.accessions"
/></span></a>
<a
class=
"btn btn-default"
href=
"
<c:url
value=
"/explore/map"
><c:param
name=
"filter"
value=
"
${
jsonFilter
}
"
/></c:url>
"
><span
class=
"glyphicon glyphicon-globe"
></span><span
style=
"margin-left: 0.5em;"
><spring:message
code=
"maps.view-map"
/></span></a>
</div>
<div
class=
"col-xs-3 results"
>
<a
class=
"btn btn-default"
href=
"javascript: window.history.go(-1);"
><spring:message
code=
"navigate.back"
/></a>
</div>
</div>
</div>
...
...
src/main/webapp/WEB-INF/jsp/country/details.jsp
View file @
7c325d1a
...
...
@@ -26,6 +26,7 @@
<spring:message
code=
"country.stat.countByOrigin"
arguments=
"
${
countByOrigin
}
"
/>
<c:if
test=
"
${
countByOrigin
gt
0
}
"
>
<a
href=
"
<c:url
value=
"/geo/${country.code3}/data"
/>
"
><spring:message
code=
"view.accessions"
/></a>
<a
href=
"
<c:url
value=
"/geo/${country.code3}/overview"
/>
"
><spring:message
code=
"data-overview.short"
/></a>
</c:if>
</div>
...
...
src/main/webapp/WEB-INF/jsp/wiews/details.jsp
View file @
7c325d1a
...
...
@@ -30,7 +30,9 @@
<spring:message
code=
"faoInstitutes.stat.accessionCount"
arguments=
"
${
countByInstitute
}
"
/>
<c:if
test=
"
${
countByInstitute
gt
0
}
"
>
<a
href=
"
<c:url
value=
"/wiews/${faoInstitute.code}/data"
/>
"
><spring:message
code=
"view.accessions"
/></a>
<a
href=
"
<c:url
value=
"/wiews/${faoInstitute.code}/overview"
/>
"
><spring:message
code=
"data-overview.short"
/></a>
</c:if>
<br
/>
<spring:message
code=
"faoInstitutes.stat.datasetCount"
arguments=
"
${
datasetCount
}
"
/>
<c:if
test=
"
${
datasetCount
gt
0
}
"
>
<a
href=
"
<c:url
value=
"/wiews/${faoInstitute.code}/datasets"
/>
"
><spring:message
code=
"view.datasets"
/></a>
...
...
src/main/webapp/html/css/custom.css
View file @
7c325d1a
...
...
@@ -2010,4 +2010,10 @@ html[dir="rtl"] .text-left {
table
.terms-table
td
{
padding
:
4px
10px
;
}
\ No newline at end of file
}
.jumbotron
{
padding-top
:
24px
;
padding-bottom
:
24px
;
line-height
:
1.5
;
}
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