merging in http://svn.mannlib.cornell.edu/svn/vitro/branches/iu-vis-vitro-1.1-pre-release from r4966 to r5166
This commit is contained in:
commit
0d09bcf546
56 changed files with 9118 additions and 1 deletions
|
@ -122,6 +122,10 @@ if (VitroRequestPrep.isSelfEditing(request) || LoginFormBean.loggedIn(request, L
|
|||
</c:choose>
|
||||
</div> <!-- end labelAndMoniker -->
|
||||
|
||||
<!-- START Sparkline Visualization -->
|
||||
<jsp:include page="sparklineVisualization.jsp"/>
|
||||
<!-- END Sparkline Visualization -->
|
||||
|
||||
<%-- Links --%>
|
||||
<c:if test="${ showEdits || !empty entity.url || !empty entity.linksList }">
|
||||
<div id="dprop-vitro-links" class="propsItem ${editingClass}">
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
<c:url var="vitroControls" value="/js/controls.js"/>
|
||||
<c:url var="jqueryForm" value="/js/jquery_plugins/jquery.form.js"/>
|
||||
<c:url var="tinyMCE" value="/js/tiny_mce/tiny_mce.js"/>
|
||||
<c:url var="googleVisualizationAPI" value="http://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%22areachart%22%2C%22imagesparkline%22%5D%7D%5D%7D"/>
|
||||
|
||||
<script type="text/javascript" src="${jquery}"></script>
|
||||
<script type="text/javascript" src="${getURLParam}"></script>
|
||||
|
@ -34,3 +35,4 @@
|
|||
<script type="text/javascript" src="${jqueryForm}"></script>
|
||||
<script type="text/javascript" src="${tinyMCE}"></script>
|
||||
<script type="text/javascript" src="${vitroControls}"></script>
|
||||
<script type="text/javascript" src="${googleVisualizationAPI}"></script>
|
||||
|
|
156
webapp/web/templates/entity/sparklineVisualization.jsp
Normal file
156
webapp/web/templates/entity/sparklineVisualization.jsp
Normal file
|
@ -0,0 +1,156 @@
|
|||
<%@ 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.VClass" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.flags.PortalFlagChoices" %>
|
||||
<%@ 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/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ page errorPage="/error.jsp"%>
|
||||
<% /***********************************************
|
||||
Displays the little group of things at the bottom of the page
|
||||
for administrators and editors.
|
||||
|
||||
request.attributes:
|
||||
an Entity object with the name "entity"
|
||||
|
||||
|
||||
request.parameters:
|
||||
None, should only work with requestScope attributes for security reasons.
|
||||
|
||||
Consider sticking < % = MiscWebUtils.getReqInfo(request) % > in the html output
|
||||
for debugging info.
|
||||
|
||||
bdc34 2006-01-22 created
|
||||
**********************************************/
|
||||
Individual entity = (Individual)request.getAttribute("entity");
|
||||
boolean displayVisualization = false;
|
||||
|
||||
|
||||
|
||||
if (entity == null){
|
||||
String e = "sparklineVisuzalition.jsp expects that request attribute 'entity' be set to the Entity object to display.";
|
||||
displayVisualization = false;
|
||||
throw new JspException(e);
|
||||
} else {
|
||||
for (VClass currClass : entity.getVClasses()) {
|
||||
//System.out.println(">> " + currClass.getName());
|
||||
if (currClass.getName().equalsIgnoreCase("Person")) {
|
||||
displayVisualization = true;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//System.out.println("visualization is supposed to be displayed? > " + displayVisualization);
|
||||
if (displayVisualization) {
|
||||
|
||||
%>
|
||||
|
||||
|
||||
<c:set var='portalBean' value='${currentPortal}'/>
|
||||
<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>
|
||||
|
||||
<!-- START Visualization Code -->
|
||||
<c:url var="visualizationURL" value="/admin/visQuery">
|
||||
<c:param name="render_mode" value="dynamic"/>
|
||||
<c:param name="container" value="vis_container"/>
|
||||
<c:param name="vis" value="person_pub_count"/>
|
||||
<c:param name="vis_mode" value="short"/>
|
||||
<c:param name="uri" value="${entity.URI}"/>
|
||||
</c:url>
|
||||
|
||||
<%-- PDF Visualization URL
|
||||
|
||||
For now we have disabled this.
|
||||
|
||||
<c:url var="pdfURL" value="/admin/visQuery">
|
||||
<c:param name="render_mode" value="pdf"/>
|
||||
<c:param name="container" value="vis_container"/>
|
||||
<c:param name="vis" value="person_pub_count"/>
|
||||
<c:param name="vis_mode" value="full"/>
|
||||
<c:param name="uri" value="${entity.URI}"/>
|
||||
</c:url>
|
||||
|
||||
--%>
|
||||
|
||||
<style type="text/css">
|
||||
#vis_container {
|
||||
cursor:pointer;
|
||||
/*height:36px;
|
||||
margin-left:24%;
|
||||
margin-top:-2%;
|
||||
position:absolute;*/
|
||||
/*width:380px;*/
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
function renderVisualization(visualizationURL) {
|
||||
|
||||
$("#vis_container").empty().html('<img src="${loadingImageLink}" />');
|
||||
|
||||
$.ajax({
|
||||
url: visualizationURL,
|
||||
dataType: "html",
|
||||
success:function(data){
|
||||
$("#vis_container").html(data);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
renderVisualization('${visualizationURL}');
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
//-->
|
||||
</script>
|
||||
<div id="vis_container">
|
||||
${entity.URI}
|
||||
</div>
|
||||
|
||||
|
||||
<!--[if IE]>
|
||||
<style type="text/css">
|
||||
|
||||
#vis_container a{
|
||||
padding-bottom:5px;
|
||||
}
|
||||
|
||||
.vis_link a{
|
||||
padding:10px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<![endif]-->
|
||||
|
||||
<%--
|
||||
|
||||
For now we have disabled PDF report vis.
|
||||
|
||||
<div id="pdf_url">
|
||||
This is the <a href="${pdfURL}">link</a> to PDF report.
|
||||
</div>
|
||||
|
||||
--%>
|
||||
|
||||
<!-- END Visualization Code -->
|
||||
|
||||
<%
|
||||
|
||||
}
|
||||
|
||||
%>
|
Loading…
Add table
Add a link
Reference in a new issue