From 239b6d40d701490f2ee890fd3d79afdd9f01370b Mon Sep 17 00:00:00 2001 From: bkoniden Date: Wed, 19 Jan 2011 21:45:43 +0000 Subject: [PATCH] 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 --- .../entityComparisonErrorActivator.ftl | 34 ++++++++++++++++++- .../EntityPublicationCountRequestHandler.java | 4 ++- .../EntityGrantCountRequestHandler.java | 2 ++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonErrorActivator.ftl b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonErrorActivator.ftl index 36e91d0d..2c83b04f 100644 --- a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonErrorActivator.ftl +++ b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonErrorActivator.ftl @@ -1,15 +1,47 @@ <#-- $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 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 --> + +
+

Visit the Temporal Graph for grants of the Organization

This Organization has neither Sub-Organizations nor People. Please visit the Organization's profile page.

-
\ No newline at end of file + + diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountRequestHandler.java index ac0f0f74..6d8c1ef6 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountRequestHandler.java @@ -164,13 +164,15 @@ public class EntityPublicationCountRequestHandler implements VitroRequest vitroRequest, String entityURI) { Portal portal = vitroRequest.getPortal(); + String visualization = "ENTITY_PUB_COUNT"; String standaloneTemplate = "entityComparisonErrorActivator.ftl"; Map body = new HashMap(); body.put("portalBean", portal); body.put("title", "Temporal Graph Visualization"); body.put("organizationURI", entityURI); - + body.put("visualization", visualization); + return new TemplateResponseValues(standaloneTemplate, body); } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountRequestHandler.java index 924d3e20..f85d66f9 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountRequestHandler.java @@ -163,12 +163,14 @@ public class EntityGrantCountRequestHandler implements VitroRequest vitroRequest, String entityURI) { Portal portal = vitroRequest.getPortal(); + String visualization = "ENTITY_GRANT_COUNT"; String standaloneTemplate = "entityComparisonErrorActivator.ftl"; Map body = new HashMap(); body.put("portalBean", portal); body.put("title", "Temporal Graph Visualization"); body.put("organizationURI", entityURI); + body.put("visualization", visualization); return new TemplateResponseValues(standaloneTemplate, body);