NIVIVO - 1732 For temporal graph vis if an organization does not have any publications then there is no option to switch to "by Grants" mode

This commit is contained in:
bkoniden 2011-01-19 21:45:43 +00:00
parent 5c43a368a5
commit 239b6d40d7
3 changed files with 38 additions and 2 deletions

View file

@ -1,15 +1,47 @@
<#-- $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$ -->
<#assign standardVisualizationURLRoot ="/visualization">
<#assign ajaxVisualizationURLRoot ="/visualizationAjax">
<#assign dataVisualizationURLRoot ="/visualizationData">
<#assign organizationURI ="${organizationURI?url}"> <#assign organizationURI ="${organizationURI?url}">
<#assign organizationVivoProfileURL = "${urls.base}/individual?uri=${organizationURI}"> <#assign organizationVivoProfileURL = "${urls.base}/individual?uri=${organizationURI}">
<#assign visualizationType = "${visualization}">
<#assign TemporalGraphGrantsURL = '${urls.base}${standardVisualizationURLRoot}?vis=entity_grant_count&uri=${organizationURI}&labelField=label'>
<#assign TemporalGraphPubsURL = '${urls.base}${standardVisualizationURLRoot}?vis=entity_comparison&uri=${organizationURI}&labelField=label'>
<#-- variables passed from server-side code --> <#-- variables passed from server-side code -->
<script language="JavaScript" type="text/javascript"> <script language="JavaScript" type="text/javascript">
var contextPath = "${urls.base}"; var contextPath = "${urls.base}";
var visualization = "${visualizationType}";
var temporalGraphGrantsURL = "${TemporalGraphGrantsURL}";
var temporalGraphPubsURL = "${TemporalGraphPubsURL}";
var visualizationURL = "", visualizationString = "";
</script> </script>
<script type="text/javascript">
$(document).ready(function() {
if(visualization == "ENTITY_PUB_COUNT"){
visualizationURL = temporalGraphGrantsURL;
visualizationString = "grants";
} else {
visualizationURL = temporalGraphPubsURL;
visualizationString = "publications";
}
$("a#visualizationID").text(visualizationString);
$("a#visualizationID").attr("href", visualizationURL);
});
</script>
<div id="body"> <div id="body">
<p>Visit the Temporal Graph for <a id ="visualizationID" href="">grants</a> of the Organization</p>
<p>This Organization has neither Sub-Organizations nor People. Please visit the Organization's <a href="${organizationVivoProfileURL}">profile page.</a></p> <p>This Organization has neither Sub-Organizations nor People. Please visit the Organization's <a href="${organizationVivoProfileURL}">profile page.</a></p>
</div> </div>

View file

@ -164,12 +164,14 @@ public class EntityPublicationCountRequestHandler implements
VitroRequest vitroRequest, String entityURI) { VitroRequest vitroRequest, String entityURI) {
Portal portal = vitroRequest.getPortal(); Portal portal = vitroRequest.getPortal();
String visualization = "ENTITY_PUB_COUNT";
String standaloneTemplate = "entityComparisonErrorActivator.ftl"; String standaloneTemplate = "entityComparisonErrorActivator.ftl";
Map<String, Object> body = new HashMap<String, Object>(); Map<String, Object> body = new HashMap<String, Object>();
body.put("portalBean", portal); body.put("portalBean", portal);
body.put("title", "Temporal Graph Visualization"); body.put("title", "Temporal Graph Visualization");
body.put("organizationURI", entityURI); body.put("organizationURI", entityURI);
body.put("visualization", visualization);
return new TemplateResponseValues(standaloneTemplate, body); return new TemplateResponseValues(standaloneTemplate, body);

View file

@ -163,12 +163,14 @@ public class EntityGrantCountRequestHandler implements
VitroRequest vitroRequest, String entityURI) { VitroRequest vitroRequest, String entityURI) {
Portal portal = vitroRequest.getPortal(); Portal portal = vitroRequest.getPortal();
String visualization = "ENTITY_GRANT_COUNT";
String standaloneTemplate = "entityComparisonErrorActivator.ftl"; String standaloneTemplate = "entityComparisonErrorActivator.ftl";
Map<String, Object> body = new HashMap<String, Object>(); Map<String, Object> body = new HashMap<String, Object>();
body.put("portalBean", portal); body.put("portalBean", portal);
body.put("title", "Temporal Graph Visualization"); body.put("title", "Temporal Graph Visualization");
body.put("organizationURI", entityURI); body.put("organizationURI", entityURI);
body.put("visualization", visualization);
return new TemplateResponseValues(standaloneTemplate, body); return new TemplateResponseValues(standaloneTemplate, body);