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
280d16e0
Commit
280d16e0
authored
Nov 06, 2014
by
Matija Obreza
Browse files
More of <c:url
parent
b6a046ab
Changes
14
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/servlet/filter/LocaleURLFilter.java
View file @
280d16e0
...
...
@@ -110,7 +110,7 @@ public class LocaleURLFilter implements Filter {
if
(!
localeAllowed
)
{
LOG
.
warn
(
"Locale not allowed. Temporary redirect to default locale."
);
httpResponse
.
sendRedirect
(
remainingUrl
);
httpResponse
.
sendRedirect
(
getInternalUrl
(
remainingUrl
,
httpRequest
.
getQueryString
())
);
return
;
}
}
...
...
@@ -155,7 +155,9 @@ public class LocaleURLFilter implements Filter {
LOG
.
debug
(
"No match on url "
+
url
);
}
httpRequest
.
setAttribute
(
REQUEST_INTERNAL_URL
,
getInternalUrl
(
url
,
httpRequest
.
getQueryString
()));
filterChain
.
doFilter
(
servletRequest
,
servletResponse
);
LocaleWrappedServletResponse
localeResponse
=
new
LocaleWrappedServletResponse
(
httpResponse
,
localeUrlMatcher
,
null
,
defaultLocale
.
toLanguageTag
());
filterChain
.
doFilter
(
servletRequest
,
localeResponse
);
}
}
...
...
src/main/java/org/genesys2/server/servlet/filter/LocaleWrappedServletResponse.java
View file @
280d16e0
...
...
@@ -45,7 +45,7 @@ public class LocaleWrappedServletResponse extends HttpServletResponseWrapper {
public
String
encodeURL
(
String
url
)
{
if
(
isExcluded
(
url
))
{
if
(
url
.
startsWith
(
defaultLanguagePrefix
))
{
return
super
.
encodeURL
(
url
.
substring
(
3
));
return
super
.
encodeURL
(
url
.
substring
(
defaultLanguagePrefix
.
length
()
-
1
));
}
return
super
.
encodeURL
(
url
);
}
else
{
...
...
src/main/webapp/WEB-INF/decorator/footer.jsp
View file @
280d16e0
...
...
@@ -34,7 +34,7 @@
<div
style=
"display: none"
id=
"session_expired_popup"
title=
"
<spring:message
code=
"session.expiry-warning-title"
/>
"
>
<div
style=
"margin-bottom: 1em;"
><spring:message
code=
"session.expiry-warning"
/></div>
<a
class=
"btn btn-primary"
href=
"
<c:
out
value=
"/"
/>
"
><spring:message
code=
"session.expiry-extend"
/></a>
<a
class=
"btn btn-primary"
href=
"
<c:
url
value=
"/"
/>
"
><spring:message
code=
"session.expiry-extend"
/></a>
</div>
<!-- Bootstrap core JavaScript
...
...
src/main/webapp/WEB-INF/decorator/header.jsp
View file @
280d16e0
...
...
@@ -20,7 +20,7 @@
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
><spring:message
code=
"page.login"
/></a>
<ul
class=
"dropdown-menu pull-left"
>
<li>
<form
role=
"form"
method=
"post"
action=
"/login-attempt"
>
<form
role=
"form"
method=
"post"
action=
"
<c:url
value=
"
/login-attempt"
/>
"
>
<div
class=
"form-group"
>
<label
for=
"username"
><spring:message
code=
"login.username"
/>
:
</label>
<input
type=
"email"
class=
"form-control"
id=
"username"
name=
"j_username"
placeholder=
"
<spring:message
code=
"login.username"
/>
"
/>
...
...
@@ -97,7 +97,7 @@
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
><spring:message
code=
"page.login"
/></a>
<ul
class=
"dropdown-menu pull-left"
>
<li>
<form
role=
"form"
method=
"post"
action=
"/login-attempt"
>
<form
role=
"form"
method=
"post"
action=
"
<c:url
value=
"
/login-attempt"
/>
"
>
<div
class=
"form-group"
>
<label
for=
"username"
><spring:message
code=
"login.username"
/>
:
</label>
<input
type=
"email"
class=
"form-control"
id=
"username"
name=
"j_username"
placeholder=
"
<spring:message
code=
"login.username"
/>
"
/>
...
...
src/main/webapp/WEB-INF/jsp/accession/additional-filter.jsp
View file @
280d16e0
...
...
@@ -64,7 +64,7 @@
<div
class=
"ui-front"
>
<div
class=
"form-group input-group"
>
<span
class=
"input-group-btn"
>
<input
id=
"${normalizedKey}_input"
class=
"span2 form-control autocomplete-filter string-type"
x-source=
"${filter.autocompleteUrl}"
placeholder=
"
<spring:message
code=
"filter.autocomplete-placeholder"
/>
"
type=
"text"
/>
<input
id=
"${normalizedKey}_input"
class=
"span2 form-control autocomplete-filter string-type"
x-source=
"
<c:url
value=
"
${
filter
.
autocompleteUrl
}
"
/>
"
placeholder=
"
<spring:message
code=
"filter.autocomplete-placeholder"
/>
"
type=
"text"
/>
<button
class=
"btn notimportant filter-auto"
norm-key=
"
<c:out
value=
"
${
normalizedKey
}
"
/>
"
i-key=
"
<c:out
value=
"
${
filter
.
key
}
"
/>
"
>
+
</button>
</span>
</div>
...
...
src/main/webapp/WEB-INF/jsp/accession/explore-es.jsp
View file @
280d16e0
...
...
@@ -131,7 +131,7 @@
<div
class=
"ui-front"
>
<div
class=
"form-group input-group"
>
<span
class=
"input-group-btn"
>
<input
id=
"
<c:out
value=
"
${
normalizedKey
}
"
/>
_input"
class=
"span2 form-control autocomplete-filter string-type"
x-source=
"${filter.autocompleteUrl}"
placeholder=
"
<spring:message
code=
"filter.autocomplete-placeholder"
/>
"
type=
"text"
/>
<input
id=
"
<c:out
value=
"
${
normalizedKey
}
"
/>
_input"
class=
"span2 form-control autocomplete-filter string-type"
x-source=
"
<c:url
value=
"
${
filter
.
autocompleteUrl
}
"
/>
"
placeholder=
"
<spring:message
code=
"filter.autocomplete-placeholder"
/>
"
type=
"text"
/>
<button
class=
"btn notimportant filter-auto"
norm-key=
"
<c:out
value=
"
${
normalizedKey
}
"
/>
"
i-key=
"
<c:out
value=
"
${
filter
.
key
}
"
/>
"
>
+
</button>
</span>
</div>
...
...
@@ -299,7 +299,7 @@
$
(
"
#menu2
"
).
on
(
"
click
"
,
function
()
{
$
.
ajax
(
"
/modal
"
,
{
$
.
ajax
(
"
<c:url
value=
"
/modal"
/>
"
,
{
type
:
'
GET
'
,
data
:
"
shortName=
"
+
jsonData
.
crops
,
success
:
function
(
data
)
{
...
...
@@ -377,13 +377,13 @@
});
$
(
"
body
"
).
on
(
"
click
"
,
"
.apply
"
,
function
()
{
GenesysFilterUtil
.
submitJson
(
'
/explore-es
'
,
jsonData
);
GenesysFilterUtil
.
submitJson
(
'
<c:url
value=
"
/explore-es
"
/>
'
,
jsonData
);
});
$
(
"
body
"
).
on
(
"
click
"
,
"
.remove-filter
"
,
function
()
{
var
key
=
$
(
this
).
parents
(
"
.filter-block
"
).
attr
(
"
i-key
"
);
delete
jsonData
[
key
];
GenesysFilterUtil
.
submitJson
(
'
/explore-es
'
,
jsonData
);
GenesysFilterUtil
.
submitJson
(
'
<c:url
value=
"
/explore-es
"
/>
'
,
jsonData
);
});
$
(
"
body
"
).
on
(
"
click
"
,
"
.edit-fil
"
,
function
()
{
...
...
@@ -407,7 +407,7 @@
GenesysFilterUtil
.
removeValue
(
value
,
key
,
jsonData
);
if
(
!
$
(
this
).
parents
(
"
.filter-block
"
).
hasClass
(
"
filter-edit
"
))
{
GenesysFilterUtil
.
submitJson
(
'
/explore-es
'
,
jsonData
);
GenesysFilterUtil
.
submitJson
(
'
<c:url
value=
"
/explore-es
"
/>
'
,
jsonData
);
}
$
(
this
).
remove
();
...
...
src/main/webapp/WEB-INF/jsp/accession/explore.jsp
View file @
280d16e0
...
...
@@ -31,7 +31,7 @@
</div>
<div
class=
"col-sm-12 col-md-6"
style=
"text-align: right; padding-top: 12px"
>
<c:if
test=
"
${
pagedData
.
totalElements
le
100000
}
"
>
<form
style=
"display: inline-block"
method=
"post"
action=
"/explore/dwca"
>
<form
style=
"display: inline-block"
method=
"post"
action=
"
<c:url
value=
"
/explore/dwca"
/>
"
>
<input
type=
"hidden"
name=
"${_csrf.parameterName}"
value=
"${_csrf.token}"
/>
<input
type=
"hidden"
name=
"filter"
value=
"
<c:out
value=
"
${
jsonFilter
}
"
/>
"
/>
<button
class=
"btn btn-default"
type=
"submit"
><spring:message
code=
"filter.download-dwca"
/></button>
...
...
@@ -132,7 +132,7 @@
<div
class=
"ui-front"
>
<div
class=
"form-group input-group"
>
<span
class=
"input-group-btn"
>
<input
id=
"
<c:out
value=
"
${
normalizedKey
}
"
/>
_input"
class=
"span2 form-control autocomplete-filter string-type"
x-source=
"${filter.autocompleteUrl}"
placeholder=
"
<spring:message
code=
"filter.autocomplete-placeholder"
/>
"
type=
"text"
/>
<input
id=
"
<c:out
value=
"
${
normalizedKey
}
"
/>
_input"
class=
"span2 form-control autocomplete-filter string-type"
x-source=
"
<c:url
value=
"
${
filter
.
autocompleteUrl
}
"
/>
"
placeholder=
"
<spring:message
code=
"filter.autocomplete-placeholder"
/>
"
type=
"text"
/>
<button
class=
"btn notimportant filter-auto"
norm-key=
"
<c:out
value=
"
${
normalizedKey
}
"
/>
"
i-key=
"
<c:out
value=
"
${
filter
.
key
}
"
/>
"
>
+
</button>
</span>
</div>
...
...
@@ -300,7 +300,7 @@
$
(
"
#menu2
"
).
on
(
"
click
"
,
function
()
{
$
.
ajax
(
"
/modal
"
,
{
$
.
ajax
(
"
<c:url
value=
"
/modal"
/>
"
,
{
type
:
'
GET
'
,
data
:
"
shortName=
"
+
jsonData
.
crops
,
success
:
function
(
data
)
{
...
...
@@ -378,13 +378,13 @@
});
$
(
"
body
"
).
on
(
"
click
"
,
"
.apply
"
,
function
()
{
GenesysFilterUtil
.
submitJson
(
'
/explore
'
,
jsonData
);
GenesysFilterUtil
.
submitJson
(
'
<c:url
value=
"
/explore
"
/>
'
,
jsonData
);
});
$
(
"
body
"
).
on
(
"
click
"
,
"
.remove-filter
"
,
function
()
{
var
key
=
$
(
this
).
parents
(
"
.filter-block
"
).
attr
(
"
i-key
"
);
delete
jsonData
[
key
];
GenesysFilterUtil
.
submitJson
(
'
/explore
'
,
jsonData
);
GenesysFilterUtil
.
submitJson
(
'
<c:url
value=
"
/explore
"
/>
'
,
jsonData
);
});
$
(
"
body
"
).
on
(
"
click
"
,
"
.edit-fil
"
,
function
()
{
...
...
@@ -408,7 +408,7 @@
GenesysFilterUtil
.
removeValue
(
value
,
key
,
jsonData
);
if
(
!
$
(
this
).
parents
(
"
.filter-block
"
).
hasClass
(
"
filter-edit
"
))
{
GenesysFilterUtil
.
submitJson
(
'
/explore
'
,
jsonData
);
GenesysFilterUtil
.
submitJson
(
'
<c:url
value=
"
/explore
"
/>
'
,
jsonData
);
}
$
(
this
).
remove
();
...
...
src/main/webapp/WEB-INF/jsp/accession/map.jsp
View file @
280d16e0
...
...
@@ -15,7 +15,7 @@
<div
class=
"nav-header"
>
<div
class=
"pull-right"
>
<a
class=
"btn btn-default"
href=
"
<c:url
value=
"/explore"
/>
"
id=
"selectArea"
><spring:message
code=
"view.accessions"
/></a>
<form
style=
"display: inline-block"
method=
"post"
action=
"/explore/kml"
>
<form
style=
"display: inline-block"
method=
"post"
action=
"
<c:url
value=
"
/explore/kml"
/>
"
>
<input
type=
"hidden"
name=
"${_csrf.parameterName}"
value=
"${_csrf.token}"
/>
<input
type=
"hidden"
name=
"filter"
value=
"
<c:out
value=
"
${
jsonFilter
}
"
/>
"
/>
<button
class=
"btn btn-default"
type=
"submit"
><spring:message
code=
"download.kml"
/></button>
...
...
src/main/webapp/WEB-INF/jsp/acl/editor.jsp
View file @
280d16e0
...
...
@@ -76,7 +76,7 @@
var
object
=
{
"
oid
"
:
$
{
aclObjectIdentity
.
objectIdIdentity
},
"
clazz
"
:
"
${aclObjectIdentity.aclClass.aclClass}
"
,
"
uuid
"
:
$
(
"
#permissionAdder input[type=text]
"
)[
0
].
value
,
"
principal
"
:
true
,
"
create
"
:
create
,
"
read
"
:
read
,
"
write
"
:
write
,
"
delete
"
:
remove
,
"
manage
"
:
manage
};
//debugger;
$
.
ajax
(
"
/json/v0/permission/add
"
,
{
$
.
ajax
(
"
<c:url
value=
"
/json/v0/permission/add"
/>
"
,
{
type
:
'
POST
'
,
dataType
:
'
json
'
,
contentType
:
'
application/json; charset=utf-8
'
,
...
...
src/main/webapp/WEB-INF/jsp/login.jsp
View file @
280d16e0
...
...
@@ -15,7 +15,7 @@
<div
class=
"alert alert-danger"
><spring:message
code=
"login.invalid-token"
/></div>
</c:if>
<form
role=
"form"
method=
"POST"
action=
"/login-attempt"
class=
"form-horizontal"
>
<form
role=
"form"
method=
"POST"
action=
"
<c:url
value=
"
/login-attempt"
/>
"
class=
"form-horizontal"
>
<div
class=
"form-group"
>
<label
for=
"j_username"
class=
"col-lg-2 control-label"
><spring:message
code=
"login.username"
/></label>
<div
class=
"col-lg-3"
>
...
...
src/main/webapp/WEB-INF/jsp/metadata/view.jsp
View file @
280d16e0
...
...
@@ -61,7 +61,7 @@
<div>
<form
class=
"form-horizontal"
method=
"post"
action=
"/data/view/${metadata.id}/dwca"
>
<form
class=
"form-horizontal"
method=
"post"
action=
"
<c:url
value=
"
/data/view/${metadata.id}/dwca"
/>
"
>
<input
type=
"hidden"
name=
"${_csrf.parameterName}"
value=
"${_csrf.token}"
/>
<div
class=
"row"
style=
"margin-top: 2em;"
>
<div
class=
"col-sm-4"
>
...
...
src/main/webapp/WEB-INF/jsp/selection/index.jsp
View file @
280d16e0
...
...
@@ -21,7 +21,7 @@
<div
class=
"main-col-header clearfix"
>
<div
class=
"nav-header"
>
<form
class=
"pull-right form-horizontal"
method=
"post"
action=
"/sel/dwca"
>
<form
class=
"pull-right form-horizontal"
method=
"post"
action=
"
<c:url
value=
"
/sel/dwca"
/>
"
>
<input
type=
"hidden"
name=
"${_csrf.parameterName}"
value=
"${_csrf.token}"
/>
<div
class=
"row"
style=
"margin-top: 2em;"
>
<div
class=
"col-sm-4"
>
...
...
src/main/webapp/WEB-INF/jsp/wiews/details.jsp
View file @
280d16e0
...
...
@@ -193,8 +193,8 @@
</script>
<script>
jQuery
(
document
).
ready
(
function
()
{
GenesysChart
.
chart
(
"
#chartStatsByGenus
"
,
"
/wiews/${faoInstitute.code}/stat-genus
"
,
null
,
null
,
function
(
genus
)
{
window
.
location
=
window
.
location
.
pathname
+
"
/t/
"
+
genus
;
});
GenesysChart
.
chart
(
"
#chartStatsBySpecies
"
,
"
/wiews/${faoInstitute.code}/stat-species
"
,
null
,
function
(
taxonomy
)
{
return
taxonomy
.
taxonName
;
},
function
(
taxonomy
)
{
window
.
location
=
window
.
location
.
pathname
+
"
/t/
"
+
taxonomy
.
genus
+
"
/
"
+
taxonomy
.
species
;
});
GenesysChart
.
chart
(
"
#chartStatsByGenus
"
,
"
<c:url
value=
"/wiews/${faoInstitute.code}/stat-genus"
/>
"
,
null
,
null
,
function
(
genus
)
{
window
.
location
=
window
.
location
.
pathname
+
"
/t/
"
+
genus
;
});
GenesysChart
.
chart
(
"
#chartStatsBySpecies
"
,
"
<c:url
value=
"/wiews/${faoInstitute.code}/stat-species"
/>
"
,
null
,
function
(
taxonomy
)
{
return
taxonomy
.
taxonName
;
},
function
(
taxonomy
)
{
window
.
location
=
window
.
location
.
pathname
+
"
/t/
"
+
taxonomy
.
genus
+
"
/
"
+
taxonomy
.
species
;
});
});
</script>
</content>
...
...
src/main/webapp/html/js/crophub.js
View file @
280d16e0
...
...
@@ -459,7 +459,7 @@ GenesysFilterUtil = {
return
;
}
$
.
ajax
(
"
/additional-filter
"
,
{
$
.
ajax
(
"
/
"
+
document
.
documentElement
.
lang
+
"
/additional-filter
"
,
{
type
:
'
GET
'
,
data
:
"
filter=
"
+
filter
,
...
...
@@ -484,7 +484,7 @@ GenesysFilterUtil = {
jQuery
(
document
).
ready
(
function
()
{
$
(
"
body
"
).
on
(
"
click
"
,
"
.get_widget
"
,
function
()
{
var
clientId
=
$
(
this
).
val
();
$
.
ajax
(
"
/get_widget
"
,
{
$
.
ajax
(
"
/
"
+
document
.
documentElement
.
lang
+
"
/get_widget
"
,
{
type
:
'
GET
'
,
data
:
'
clientId=
'
+
clientId
,
success
:
function
(
data
)
{
...
...
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