1. Converted co-authorship to use the new vis arhitecture & freemarker.

This commit is contained in:
cdtank 2010-12-17 16:46:05 +00:00
parent 85db89c47a
commit 36a5f5ad0c
3 changed files with 298 additions and 16 deletions

View file

@ -1,2 +1,241 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#assign visImageContextPath = "${urls.images}/visualization/" >
<#assign loadingImageLink = "${visImageContextPath}ajax-loader.gif">
<#assign egoVivoProfileURL = "${urls.base}/individual?uri=${egoURI}">
<#assign egoSparklineDataURL = '${urls.base}${dataVisualizationURLRoot}?vis=person_pub_count&uri=${egoURI}&labelField=label'>
<#assign coAuthorshipDownloadFile = '${urls.base}${dataVisualizationURLRoot}?vis=person_level&uri=${egoURI}&labelField=label'>
<div id="body">
<#--
Support for this has ended. Only created for the VIVO Conf Demo.
<style type="text/css">
#profileImage img{
width: 90px;
height: auto;
}
#body h1 {
margin:0.0em;
}
.sparkline_wrapper_table {
display: inline;
vertical-align: bottom;
}
.author_name {
color: #13968c;
font-weight: bold;
}
.neutral_author_name {
color: black;
font-weight: bold;
}
.author_moniker {
color: #9C9C9C;
}
.sub_headings {
color: #121b3c;
padding-top: 10px;
margin-bottom: 0.3em;
}
.sub_headings a {
font-size:0.7em;
font-weight:normal;
}
table.sparkline_wrapper_table td, th {
vertical-align: bottom;
}
.inline_href {
}
#ego_profile {
padding-left:10px;
padding-top:10px;
min-height: 100px;
}
#ego_label {
font-size:1.1em;
}
#ego_profile_image {
float:left;
padding-right: 5px;
}
#ego_profile_image img{
width: 90px;
height: auto;
}
#ego_sparkline {
cursor:pointer;
height:36px;
width:471px;
}
#coauthorships_table th {
vertical-align: top;
}
</style>
<!--[if IE]>
<style type="text/css">
#${egoPubSparklineContainerID},
#${uniqueCoauthorsSparklineVisContainerID} {
padding-bottom:15px;
}
#ego_label {
margin-left:-3px;
}
</style>
<![endif]-->
<div id="ego_profile">
<%-- Image --%>
<div id="ego_profile_image" class="thumbnail"></div>
<%-- Label --%>
<a href="${egoVivoProfileURL}"><h1><span id="ego_label" class="author_name"></span></h1></a>
<%-- Moniker--%>
<span id="ego_moniker" class="author_moniker"></span>
<div style="clear:both;"></div>
<c:choose>
<c:when test='${numOfAuthors > 0}'>
<div id="incomplete-data">This information is based solely on publications which have been loaded into the VIVO system.
This may only be a small sample of the person's total work. </div>
<h2 class="sub_headings">Co-Author Network
<c:choose>
<c:when test="${numOfCoAuthorShips > 0 || numOfAuthors > 0}">
<a href="${coAuthorshipDownloadFile}">(GraphML File)</a></h2>
</c:when>
<c:otherwise>
</h2>
<c:if test='${numOfAuthors > 0}'>
<c:set var='authorsText' value='multi-author' />
</c:if>
<span id="no_coauthorships">Currently there are no ${authorsText} papers for
<a href="${egoVivoProfileURL}"><span id="no_coauthorships_person" class="author_name">this author</span></a> in the VIVO database.</span>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<span id="no_coauthorships">Currently there are no papers for <a href="${egoVivoProfileURL}"><span id="no_coauthorships_person" class="author_name">
this author</span></a> in the VIVO database.</span>
</c:otherwise>
</c:choose>
</div>
<c:if test='${numOfCoAuthorShips > 0 || numOfAuthors > 0}'>
<div id="bodyPannel">
<div id="visPanel" style="float: left; width: 600px;">
<script language="JavaScript" type="text/javascript">
<!--
renderCoAuthorshipVisualization();
//-->
</script>
</div>
<div id="dataPanel">
<br />
<br />
<div id="profileImage" class="thumbnail"></div>
<div class="bold"><strong><span id="authorName" class="neutral_author_name">&nbsp;</span></strong></div>
<div class="italicize"><span id="profileMoniker" class="author_moniker"></span></div>
<div><a href="#" id="profileUrl">VIVO profile</a> | <a href="#" id="coAuthorshipVisUrl">Co-author network</a></div>
<br />
<div class="author_stats" id="num_works"><span class="numbers" style="width: 40px;" id="works"></span>&nbsp;&nbsp;<span class="author_stats_text">Publication(s)</span></div>
<div class="author_stats" id="num_authors"><span class="numbers" style="width: 40px;" id="coAuthors"></span>&nbsp;&nbsp;<span class="author_stats_text">Co-author(s)</span></div>
<div class="author_stats" id="fPub" style="visibility:hidden"><span class="numbers" style="width:40px;" id="firstPublication"></span>&nbsp;&nbsp;<span>First Publication</span></div>
<div class="author_stats" id="lPub" style="visibility:hidden"><span class="numbers" style="width:40px;" id="lastPublication"></span>&nbsp;&nbsp;<span>Last Publication</span></div>
</div>
</div>
</c:if>
<c:if test='${numOfCoAuthorShips > 0}'>
<div class="vis_stats">
<h2 class="sub_headings">Table</h2>
<c:if test='${numOfCoAuthorShips > 0}'>
<div class="vis-tables">
<p id="coauth_table_container" class="datatable"></p>
</div>
</c:if>
<div style="clear:both;"></div>
</div>
</c:if>
</div>
<script language="JavaScript" type="text/javascript">
$(document).ready(function(){
<c:if test='${numOfCoAuthorShips > 0}'>
$("#coauth_table_container").empty().html('<img id="loadingData" with="auto" src="${loadingImageLink}" />');
</c:if>
processProfileInformation("ego_label",
"ego_moniker",
"ego_profile_image",
jQuery.parseJSON(getWellFormedURLs("${requestScope.egoURIParam}", "profile_info")));
<c:if test='${empty numOfCoAuthorShips || empty numOfAuthors}'>
if ($('#ego_label').text().length > 0) {
setProfileName('no_coauthorships_person', $('#ego_label').text());
}
</c:if>
});
</script>
-->

View file

@ -1,17 +1,53 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#assign visualizationURLRoot ="/visualization">
<#assign standardVisualizationURLRoot ="/visualizationfm">
<#assign ajaxVisualizationURLRoot ="/visualizationAjax">
<#assign dataVisualizationURLRoot ="/visualizationData">
<#assign egoURI ="${egoURIParam?url}">
<#assign egoCoAuthorshipDataFeederURL = '${urls.base}${visualizationURLRoot}?vis=coauthorship&uri=${egoURI}&render_mode=data&labelField=label'>
<#assign egoCoPIDataFeederURL = '${urls.base}${visualizationURLRoot}?vis=coprincipalinvestigator&uri=${egoURI}&render_mode=data&labelField=label'>
<#assign egoCoAuthorsListDataFileURL = '${urls.base}${visualizationURLRoot}?vis=person_level&uri=${egoURI}&render_mode=data&vis_mode=coauthors'>
<#assign egoCoAuthorshipDataFeederURL = '${urls.base}${dataVisualizationURLRoot}?vis=coauthorship&uri=${egoURI}&labelField=label'>
<#assign egoCoPIDataFeederURL = '${urls.base}${dataVisualizationURLRoot}?vis=coprincipalinvestigator&uri=${egoURI}&labelField=label'>
<#assign egoCoAuthorsListDataFileURL = '${urls.base}${dataVisualizationURLRoot}?vis=person_level&uri=${egoURI}&vis_mode=coauthors'>
<#assign swfLink = '${urls.images}/visualization/coauthorship/EgoCentric.swf'>
<#assign adobeFlashDetector = '${urls.base}/js/visualization/coauthorship/AC_OETags.js'>
<#assign googleVisualizationAPI = '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'>
<#assign coAuthorShipJavaScript = '${urls.base}/js/visualization/personlevel/person_level.js'>
<c:url var="adobeFlashDetector" value="/js/visualization/coauthorship/AC_OETags.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"/>
<c:url var="coAuthorShipJavaScript" value="/js/visualization/personlevel/person_level.js" />
<script type="text/javascript" src="${adobeFlashDetector}"></script>
<script type="text/javascript" src="${jquery}"></script>
<script type="text/javascript" src="${googleVisualizationAPI}"></script>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 10;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------
var swfLink = "${swfLink}";
var egoURI = "${egoURI}";
var egoCoAuthorshipDataFeederURL = "${egoCoAuthorshipDataFeederURL}";
var egoCoAuthorsListDataFileURL = "${egoCoAuthorsListDataFileURL}";
var egoCoPIDataFeederURL = "${egoCoPIDataFeederURL}";
var domainParam = "${completeURL}";
var visMode = "${visMode}";
// -->
</script>
<script type="text/javascript" src="${coAuthorShipJavaScript}"></script>
<c:url var="coAuthorStyle" value="/${themeDir}css/visualization/personlevel/coauthor_style.css" />
<c:url var="pageStyle" value="/${themeDir}css/visualization/personlevel/page.css" />
<c:url var="vizStyle" value="/${themeDir}css/visualization/visualization.css" />
<link href="${coAuthorStyle}" rel="stylesheet" type="text/css" />
<link href="${pageStyle}" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="${vizStyle}" />

View file

@ -91,7 +91,11 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler {
DataSource dataSource)
throws MalformedQueryParametersException {
String egoURI = vitroRequest.getParameter(
/*
* Support for this has ceased to exist. Standalone mode was created only for demo
* purposes for VIVO Conf.
* */
/* String egoURI = vitroRequest.getParameter(
VisualizationFrameworkConstants
.INDIVIDUAL_URI_KEY);
@ -104,11 +108,14 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler {
return prepareStandaloneResponse(egoURI,
authorNodesAndEdges,
vitroRequest);
vitroRequest);*/
throw new UnsupportedOperationException("CoAuthorship does not provide Standalone Response.");
}
private String getCoauthorsPerYearCSVContent(Map<String, Set<Node>> yearToCoauthors) {
StringBuilder csvFileContent = new StringBuilder();