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
a4f4cbf3
Commit
a4f4cbf3
authored
Nov 12, 2013
by
Matija Obreza
Browse files
CDN configuration (flags)
parent
cbd19451
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/servlet/filter/EnvVariablesFilter.java
View file @
a4f4cbf3
...
...
@@ -34,13 +34,27 @@ public class EnvVariablesFilter extends OncePerRequestFilter {
@Value
(
"${google.analytics.account}"
)
private
String
googleAnalyticsAccount
;
@Value
(
"${cdn.flags.url}"
)
private
String
cdnFlagsUrl
;
@Override
public
void
afterPropertiesSet
()
throws
ServletException
{
super
.
afterPropertiesSet
();
cdnFlagsUrl
=
StringUtils
.
defaultIfBlank
(
cdnFlagsUrl
,
null
);
googleAnalyticsAccount
=
StringUtils
.
defaultIfBlank
(
googleAnalyticsAccount
,
null
);
}
@Override
protected
void
doFilterInternal
(
HttpServletRequest
request
,
HttpServletResponse
response
,
FilterChain
filterChain
)
throws
ServletException
,
IOException
{
if
(
StringUtils
.
isNotBlank
(
googleAnalyticsAccount
)
)
{
if
(
googleAnalyticsAccount
!=
null
)
{
request
.
setAttribute
(
"googleAnalyticsAccount"
,
googleAnalyticsAccount
);
}
if
(
cdnFlagsUrl
!=
null
)
{
request
.
setAttribute
(
"cdnFlagsUrl"
,
cdnFlagsUrl
);
}
filterChain
.
doFilter
(
request
,
response
);
}
...
...
src/main/resources/spring/spring.properties
View file @
a4f4cbf3
...
...
@@ -24,7 +24,7 @@ db.url=jdbc:mysql://127.0.0.1/genesys2?useUnicode=true&characterEncoding=UTF-8&u
db.driverClassName
=
com.mysql.jdbc.Driver
db.username
=
root
db.password
=
db.showSql=
tru
e
db.showSql=
fals
e
db.hbm2ddl
=
do-nothing
c3p0.acquireIncrement
=
1
...
...
@@ -44,3 +44,6 @@ download.files.dir=./data/
# GA Account
google.analytics.account
=
# CDN
cdn.base
=
http://cdn.sandbox.genesys-pgr.org
cdn.flags.url
=
${cdn.base}/flags
src/main/webapp/WEB-INF/jsp/accession/details.jsp
View file @
a4f4cbf3
...
...
@@ -73,7 +73,7 @@
<c:if
test=
"
${
accession
.
countryOfOrigin
ne
null
}
"
>
<tr>
<td><spring:message
code=
"accession.origin"
/></td>
<td><img
src=
"
http://genesys-pgr.org/images/flags
/${accession.origin.toUpperCase()}.png"
/>
<a
href=
"
<c:url
value=
"/geo/${accession.origin.toLowerCase()}"
/>
"
>
<c:out
value=
"
${
accession
.
countryOfOrigin
.
getName
(
pageContext
.
response
.
locale
)
}
"
/>
<td><img
src=
"
${cdnFlagsUrl}
/${accession.origin.toUpperCase()}.png"
/>
<a
href=
"
<c:url
value=
"/geo/${accession.origin.toLowerCase()}"
/>
"
>
<c:out
value=
"
${
accession
.
countryOfOrigin
.
getName
(
pageContext
.
response
.
locale
)
}
"
/>
</a></td>
</tr>
</c:if>
...
...
src/main/webapp/WEB-INF/jsp/country/details.jsp
View file @
a4f4cbf3
...
...
@@ -9,7 +9,7 @@
<body>
<h1>
<c:out
value=
"
${
country
.
getName
(
pageContext
.
response
.
locale
)
}
"
/>
<img
class=
"country-flag bigger"
src=
"
http://genesys-pgr.org/images/flags
/${country.code3.toUpperCase()}.png"
/>
<img
class=
"country-flag bigger"
src=
"
${cdnFlagsUrl}
/${country.code3.toUpperCase()}.png"
/>
</h1>
<c:if
test=
"
${
not
country
.
current
}
"
>
...
...
src/main/webapp/WEB-INF/jsp/country/edit.jsp
View file @
a4f4cbf3
...
...
@@ -10,7 +10,7 @@
<body>
<h1>
<c:out
value=
"
${
country
.
getName
(
pageContext
.
response
.
locale
)
}
"
/>
<img
class=
"country-flag bigger"
src=
"
http://genesys-pgr.org/images/flags
/${country.code3.toUpperCase()}.png"
/>
<img
class=
"country-flag bigger"
src=
"
${cdnFlagsUrl}
/${country.code3.toUpperCase()}.png"
/>
</h1>
<form
role=
"form"
class=
""
action=
"
<c:url
value=
"/geo/${country.code3.toLowerCase()}/update"
/>
"
method=
"post"
>
...
...
src/main/webapp/WEB-INF/jsp/wiews/details.jsp
View file @
a4f4cbf3
...
...
@@ -8,7 +8,7 @@
</head>
<body>
<h1>
<img
class=
"country-flag bigger"
src=
"
http://genesys-pgr.org/images/flags
/${faoInstitute.country.code3.toUpperCase()}.png"
/>
<img
class=
"country-flag bigger"
src=
"
${cdnFlagsUrl}
/${faoInstitute.country.code3.toUpperCase()}.png"
/>
<c:out
value=
"
${
faoInstitute
.
fullName
}
"
/>
<small><c:out
value=
"
${
faoInstitute
.
code
}
"
/></small>
</h1>
...
...
@@ -38,7 +38,7 @@
<div
class=
"row"
style=
""
>
<div
class=
"col-sm-4"
>
<spring:message
code=
"faoInstitute.country"
/>
:
<%-- <img src="
http://genesys-pgr.org/images/flags
/${faoInstitute.country.code3.toUpperCase()}.png" /> --%>
<%-- <img src="
${cdnFlagsUrl}
/${faoInstitute.country.code3.toUpperCase()}.png" /> --%>
<a
href=
"
<c:url
value=
"/geo/${faoInstitute.country.code3.toLowerCase()}"
/>
"
><c:out
value=
"
${
faoInstitute
.
country
.
getName
(
pageContext
.
response
.
locale
)
}
"
/></a>
</div>
<%-- <div class="col-sm-4">
...
...
src/main/webapp/WEB-INF/jsp/wiews/edit.jsp
View file @
a4f4cbf3
...
...
@@ -9,7 +9,7 @@
</head>
<body>
<h1>
<img
class=
"country-flag bigger"
src=
"
http://genesys-pgr.org/images/flags
/${faoInstitute.country.code3.toUpperCase()}.png"
/>
<img
class=
"country-flag bigger"
src=
"
${cdnFlagsUrl}
/${faoInstitute.country.code3.toUpperCase()}.png"
/>
<c:out
value=
"
${
faoInstitute
.
fullName
}
"
/>
<small><c:out
value=
"
${
faoInstitute
.
code
}
"
/></small>
</h1>
...
...
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