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
34283223
Commit
34283223
authored
Jan 10, 2014
by
Matija Obreza
Browse files
Include GA trackers
parent
b0c79e71
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/servlet/controller/DatasetController.java
View file @
34283223
...
...
@@ -23,8 +23,10 @@ import javax.servlet.http.HttpServletResponse;
import
org.genesys2.server.model.genesys.Accession
;
import
org.genesys2.server.model.genesys.Metadata
;
import
org.genesys2.server.model.impl.FaoInstitute
;
import
org.genesys2.server.service.DatasetService
;
import
org.genesys2.server.service.GenesysService
;
import
org.genesys2.server.service.InstituteService
;
import
org.genesys2.spring.ResourceNotFoundException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Scope
;
...
...
@@ -58,6 +60,9 @@ public class DatasetController extends BaseController {
@Autowired
private
Validator
validator
;
@Autowired
private
InstituteService
instituteService
;
@RequestMapping
(
"/"
)
public
String
index
(
ModelMap
model
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
)
{
model
.
addAttribute
(
"pagedData"
,
genesysService
.
listMetadata
(
new
PageRequest
(
page
-
1
,
50
)));
...
...
@@ -75,6 +80,9 @@ public class DatasetController extends BaseController {
model
.
addAttribute
(
"metadata"
,
metadata
);
model
.
addAttribute
(
"methods"
,
genesysService
.
listMethods
(
metadata
));
FaoInstitute
faoInstitute
=
instituteService
.
getInstitute
(
metadata
.
getInstituteCode
());
model
.
addAttribute
(
"faoInstitute"
,
faoInstitute
);
Page
<
Accession
>
accessions
=
genesysService
.
listMetadataAccessions
(
metadata
.
getId
(),
new
PageRequest
(
page
-
1
,
50
));
model
.
addAttribute
(
"pagedData"
,
accessions
);
...
...
src/main/webapp/WEB-INF/jsp/accession/details.jsp
View file @
34283223
...
...
@@ -274,10 +274,7 @@
});
</c:if>
<%-- // institute GA --%>
<c:if
test=
"
${
faoInstitute
.
settings
[
'googleAnalytics.tracker'
]
ne
null
}
"
>
_pageTrackers
=
[
"
${faoInstitute.settings['googleAnalytics.tracker'].value}
"
];
</c:if>
<%@include
file=
"/WEB-INF/jsp/wiews/ga.jsp"
%>
_pageDim
=
{
institute
:
'
${accession.instituteCode}
'
,
genus
:
'
${accession.taxonomy.genus}
'
};
</script>
</body>
...
...
src/main/webapp/WEB-INF/jsp/metadata/view.jsp
View file @
34283223
...
...
@@ -16,6 +16,12 @@
<fmt:formatDate
value=
"
${
metadata
.
lastModifiedDate
}
"
type=
"both"
/>
</div>
<c:if
test=
"
${
faoInstitute
ne
null
}
"
>
<p>
<a
class=
""
href=
"
<c:url
value=
"/wiews/${faoInstitute.code.toLowerCase()}"
/>
"
><b><c:out
value=
"
${
faoInstitute
.
code
}
"
/></b>
<c:out
value=
"
${
faoInstitute
.
fullName
}
"
/></a>
</p>
</c:if>
<c:if
test=
"
${
page
eq
1
}
"
>
<table>
<thead>
...
...
@@ -36,6 +42,7 @@
</c:forEach>
</tbody>
</table>
<p>
<c:out
value=
"
${
metadata
.
description
}
"
/>
</p>
...
...
@@ -115,5 +122,9 @@
</tbody>
</table>
</div>
<script
type=
"text/javascript"
>
<%@include
file=
"/WEB-INF/jsp/wiews/ga.jsp"
%>
</script>
</body>
</html>
\ No newline at end of file
src/main/webapp/WEB-INF/jsp/wiews/details.jsp
View file @
34283223
...
...
@@ -126,20 +126,19 @@
</div>
<c:if
test=
"
${
faoInstitute
.
latitude
ne
null
}
"
>
<script
type=
"text/javascript"
>
jQuery
(
document
).
ready
(
function
()
{
<c:if
test=
"
${
faoInstitute
.
latitude
ne
null
}
"
>
var
map
=
GoogleMaps
.
map
(
"
${pageContext.response.locale.language}
"
,
$
(
"
#map
"
),
{
maxZoom
:
6
,
/* WIEWS does not provide enough detail */
center
:
new
GoogleMaps
.
LatLng
(
$
{
faoInstitute
.
latitude
},
$
{
faoInstitute
.
longitude
}),
markerTitle
:
"
<spring:escapeBody
javaScriptEscape=
"true"
>
${faoInstitute.fullName}
</spring:escapeBody>
"
});
</c:if>
});
<%-- // institute GA --%
>
<c:if
test=
"
${
faoInstitute
.
settings
[
'googleAnalytics.tracker'
]
ne
null
}
"
>
_pageTrackers
=
[
"
${faoInstitute.settings['googleAnalytics.tracker'].value}
"
];
<
/c:if
>
</script
>
<
/
c:if>
<script
type=
"text/javascript"
>
<
%@include
file=
"/WEB-INF/jsp/wiews/ga.jsp"
%
>
_pageDim
=
{
institute
:
'
${faoInstitute.code}
'
};
</script>
</body>
...
...
src/main/webapp/WEB-INF/jsp/wiews/ga.jsp
0 → 100644
View file @
34283223
<%@ taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%>
<c:if
test=
"
${
faoInstitute
.
settings
[
'googleAnalytics.tracker'
]
ne
null
}
"
>
_pageTrackers=["${faoInstitute.settings['googleAnalytics.tracker'].value}"];
</c:if>
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