1. Fixed the old way of rendering sparklines for profile to use the freemarkerized one as well. Earlier the broken code lead to non-loading of old profile pages.
This commit is contained in:
parent
c7b9c208ef
commit
8e9c69cd24
1 changed files with 143 additions and 142 deletions
|
@ -1,143 +1,144 @@
|
||||||
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
|
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
|
||||||
|
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ApplicationBean"%>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ApplicationBean"%>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.VClass" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.VClass" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.flags.PortalFlagChoices" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.flags.PortalFlagChoices" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
|
||||||
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
|
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
|
||||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||||
<%@ page errorPage="/error.jsp"%>
|
<%@ page errorPage="/error.jsp"%>
|
||||||
<% /***********************************************
|
<% /***********************************************
|
||||||
Displays the sparkline visualizations on individual profile pages
|
Displays the sparkline visualizations on individual profile pages
|
||||||
|
|
||||||
request.attributes:
|
request.attributes:
|
||||||
an Entity object with the name "entity"
|
an Entity object with the name "entity"
|
||||||
|
|
||||||
|
|
||||||
request.parameters:
|
request.parameters:
|
||||||
None, should only work with requestScope attributes for security reasons.
|
None, should only work with requestScope attributes for security reasons.
|
||||||
|
|
||||||
Consider sticking < % = MiscWebUtils.getReqInfo(request) % > in the html output
|
Consider sticking < % = MiscWebUtils.getReqInfo(request) % > in the html output
|
||||||
for debugging info.
|
for debugging info.
|
||||||
|
|
||||||
**********************************************/
|
**********************************************/
|
||||||
Individual entity = (Individual)request.getAttribute("entity");
|
Individual entity = (Individual)request.getAttribute("entity");
|
||||||
boolean displayVisualization = false;
|
boolean displayVisualization = false;
|
||||||
|
|
||||||
if (entity == null){
|
if (entity == null){
|
||||||
String e = "sparklineVisuzalition.jsp expects that request attribute 'entity' be set to the Entity object to display.";
|
String e = "sparklineVisuzalition.jsp expects that request attribute 'entity' be set to the Entity object to display.";
|
||||||
displayVisualization = false;
|
displayVisualization = false;
|
||||||
throw new JspException(e);
|
throw new JspException(e);
|
||||||
} else {
|
} else {
|
||||||
for (VClass currClass : entity.getVClasses()) {
|
for (VClass currClass : entity.getVClasses()) {
|
||||||
if ("http://xmlns.com/foaf/0.1/Person".equalsIgnoreCase(currClass.getURI())) {
|
if ("http://xmlns.com/foaf/0.1/Person".equalsIgnoreCase(currClass.getURI())) {
|
||||||
displayVisualization = true;
|
displayVisualization = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//System.out.println("visualization is supposed to be displayed? > " + displayVisualization);
|
//System.out.println("visualization is supposed to be displayed? > " + displayVisualization);
|
||||||
if (displayVisualization) {
|
if (displayVisualization) {
|
||||||
|
|
||||||
%>
|
%>
|
||||||
|
|
||||||
|
|
||||||
<c:set var='portalBean' value='${currentPortal}'/>
|
<c:set var='portalBean' value='${currentPortal}'/>
|
||||||
<c:set var="themeDir"><c:out value="${portalBean.themeDir}" /></c:set>
|
<c:set var="themeDir"><c:out value="${portalBean.themeDir}" /></c:set>
|
||||||
<c:url var="loadingImageLink" value="/${themeDir}site_icons/visualization/ajax-loader.gif"></c:url>
|
<c:url var="loadingImageLink" value="/${themeDir}site_icons/visualization/ajax-loader.gif"></c:url>
|
||||||
|
|
||||||
<!-- START Visualization Code -->
|
<!-- START Visualization Code -->
|
||||||
<c:url var="visualizationURL" value="/visualization">
|
<c:url var="visualizationURL" value="/visualizationAjax">
|
||||||
<c:param name="render_mode" value="dynamic"/>
|
<c:param name="container" value="vis_container"/>
|
||||||
<c:param name="container" value="vis_container"/>
|
<c:param name="vis" value="person_pub_count"/>
|
||||||
<c:param name="vis" value="person_pub_count"/>
|
<c:param name="vis_mode" value="short"/>
|
||||||
<c:param name="vis_mode" value="short"/>
|
<c:param name="uri" value="${entity.URI}"/>
|
||||||
<c:param name="uri" value="${entity.URI}"/>
|
</c:url>
|
||||||
</c:url>
|
|
||||||
|
<%-- PDF Visualization URL
|
||||||
<%-- PDF Visualization URL
|
|
||||||
|
For now we have disabled this.
|
||||||
For now we have disabled this.
|
|
||||||
|
<c:url var="pdfURL" value="/visualization">
|
||||||
<c:url var="pdfURL" value="/visualization">
|
<c:param name="render_mode" value="pdf"/>
|
||||||
<c:param name="render_mode" value="pdf"/>
|
<c:param name="container" value="vis_container"/>
|
||||||
<c:param name="container" value="vis_container"/>
|
<c:param name="vis" value="person_pub_count"/>
|
||||||
<c:param name="vis" value="person_pub_count"/>
|
<c:param name="vis_mode" value="full"/>
|
||||||
<c:param name="vis_mode" value="full"/>
|
<c:param name="uri" value="${entity.URI}"/>
|
||||||
<c:param name="uri" value="${entity.URI}"/>
|
</c:url>
|
||||||
</c:url>
|
|
||||||
|
--%>
|
||||||
--%>
|
|
||||||
|
<style type="text/css">
|
||||||
<style type="text/css">
|
#vis_container {
|
||||||
#vis_container {
|
cursor:pointer;
|
||||||
cursor:pointer;
|
/*height:36px;
|
||||||
/*height:36px;
|
margin-left:24%;
|
||||||
margin-left:24%;
|
margin-top:-2%;
|
||||||
margin-top:-2%;
|
position:absolute;*/
|
||||||
position:absolute;*/
|
/*width:380px;*/
|
||||||
/*width:380px;*/
|
}
|
||||||
}
|
</style>
|
||||||
</style>
|
|
||||||
|
<script type="text/javascript" src="https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22packages%22%3A%5B%22imagesparkline%22%5D%7D%5D%7D"></script>
|
||||||
<script type="text/javascript">
|
|
||||||
<!--
|
<script type="text/javascript">
|
||||||
|
<!--
|
||||||
$(document).ready(function() {
|
|
||||||
|
$(document).ready(function() {
|
||||||
function renderVisualization(visualizationURL) {
|
|
||||||
<%--
|
function renderVisualization(visualizationURL) {
|
||||||
$("#vis_container").empty().html('<img src="${loadingImageLink}" />');
|
<%--
|
||||||
--%>
|
$("#vis_container").empty().html('<img src="${loadingImageLink}" />');
|
||||||
$.ajax({
|
--%>
|
||||||
url: visualizationURL,
|
$.ajax({
|
||||||
dataType: "html",
|
url: visualizationURL,
|
||||||
success:function(data){
|
dataType: "html",
|
||||||
$("#vis_container").html(data);
|
success:function(data){
|
||||||
|
$("#vis_container").html(data);
|
||||||
}
|
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
renderVisualization('${visualizationURL}');
|
|
||||||
|
renderVisualization('${visualizationURL}');
|
||||||
});
|
|
||||||
|
});
|
||||||
//-->
|
|
||||||
</script>
|
//-->
|
||||||
|
</script>
|
||||||
<div id="vis_container"> </div>
|
|
||||||
|
<div id="vis_container"> </div>
|
||||||
<!--[if lte IE 7]>
|
|
||||||
<style type="text/css">
|
<!--[if lte IE 7]>
|
||||||
|
<style type="text/css">
|
||||||
#vis_container a{
|
|
||||||
padding-bottom:5px;
|
#vis_container a{
|
||||||
}
|
padding-bottom:5px;
|
||||||
|
}
|
||||||
.vis_link a{
|
|
||||||
margin-top: 15px;
|
.vis_link a{
|
||||||
padding:10px;
|
margin-top: 15px;
|
||||||
display: block;
|
padding:10px;
|
||||||
}
|
display: block;
|
||||||
</style>
|
}
|
||||||
<![endif]-->
|
</style>
|
||||||
|
<![endif]-->
|
||||||
<%--
|
|
||||||
|
<%--
|
||||||
For now we have disabled PDF report vis.
|
|
||||||
|
For now we have disabled PDF report vis.
|
||||||
<div id="pdf_url">
|
|
||||||
This is the <a href="${pdfURL}">link</a> to PDF report.
|
<div id="pdf_url">
|
||||||
</div>
|
This is the <a href="${pdfURL}">link</a> to PDF report.
|
||||||
|
</div>
|
||||||
--%>
|
|
||||||
|
--%>
|
||||||
<!-- END Visualization Code -->
|
|
||||||
|
<!-- END Visualization Code -->
|
||||||
<%
|
|
||||||
|
<%
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
%>
|
%>
|
Loading…
Add table
Reference in a new issue