1. Making a change to send an organization label to the error response for temporal graoph vis. If the organization uri is invalid then we send "Unknown Organization"
This commit is contained in:
parent
9e50f212d0
commit
24795af665
3 changed files with 32 additions and 4 deletions
|
@ -6,6 +6,8 @@
|
||||||
<#assign temporalGraphURL = '${urls.base}${standardVisualizationURLRoot}?vis=${otherVisType}&uri=${organizationURI}&labelField=label'>
|
<#assign temporalGraphURL = '${urls.base}${standardVisualizationURLRoot}?vis=${otherVisType}&uri=${organizationURI}&labelField=label'>
|
||||||
|
|
||||||
<div id="error-body">
|
<div id="error-body">
|
||||||
|
|
||||||
|
${organizationLabel}
|
||||||
<p>Visit the Temporal Graph for <a href="${temporalGraphURL}">${textForOtherEntityComparisonType}</a> of the Organization.</p>
|
<p>Visit the Temporal Graph for <a href="${temporalGraphURL}">${textForOtherEntityComparisonType}</a> of the Organization.</p>
|
||||||
<p>This Organization has neither Sub-Organizations nor People with ${textForCurrentEntityComparisonType} in VIVO. Please visit the
|
<p>This Organization has neither Sub-Organizations nor People with ${textForCurrentEntityComparisonType} in VIVO. Please visit the
|
||||||
Organization's <a href="${organizationVivoProfileURL}">profile page.</a></p>
|
Organization's <a href="${organizationVivoProfileURL}">profile page.</a></p>
|
||||||
|
|
|
@ -23,12 +23,14 @@ import com.hp.hpl.jena.rdf.model.Model;
|
||||||
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.ConfigurationProperties;
|
import edu.cornell.mannlib.vitro.webapp.ConfigurationProperties;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Portal;
|
import edu.cornell.mannlib.vitro.webapp.beans.Portal;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
|
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
|
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.DataVisualizationController;
|
import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.DataVisualizationController;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.VisualizationFrameworkConstants;
|
import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.VisualizationFrameworkConstants;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants;
|
import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
|
import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.Entity;
|
import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.Entity;
|
||||||
|
@ -237,10 +239,20 @@ public class EntityPublicationCountRequestHandler implements
|
||||||
|
|
||||||
Portal portal = vitroRequest.getPortal();
|
Portal portal = vitroRequest.getPortal();
|
||||||
String standaloneTemplate = "entityPublicationComparisonError.ftl";
|
String standaloneTemplate = "entityPublicationComparisonError.ftl";
|
||||||
|
|
||||||
Map<String, Object> body = new HashMap<String, Object>();
|
Map<String, Object> body = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
IndividualDao iDao = vitroRequest.getWebappDaoFactory().getIndividualDao();
|
||||||
|
Individual ind = iDao.getIndividualByURI(entityURI);
|
||||||
|
|
||||||
|
String organizationLabel = "Unknown Organization";
|
||||||
|
|
||||||
|
if (ind != null) {
|
||||||
|
organizationLabel = ind.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
body.put("organizationLabel", organizationLabel);
|
||||||
body.put("portalBean", portal);
|
body.put("portalBean", portal);
|
||||||
body.put("title", "Temporal Graph Visualization");
|
body.put("title", organizationLabel + " - Temporal Graph Visualization");
|
||||||
body.put("organizationURI", entityURI);
|
body.put("organizationURI", entityURI);
|
||||||
|
|
||||||
return new TemplateResponseValues(standaloneTemplate, body);
|
return new TemplateResponseValues(standaloneTemplate, body);
|
||||||
|
|
|
@ -22,12 +22,14 @@ import com.hp.hpl.jena.query.Dataset;
|
||||||
import com.hp.hpl.jena.rdf.model.Model;
|
import com.hp.hpl.jena.rdf.model.Model;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.ConfigurationProperties;
|
import edu.cornell.mannlib.vitro.webapp.ConfigurationProperties;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Portal;
|
import edu.cornell.mannlib.vitro.webapp.beans.Portal;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
|
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
|
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.DataVisualizationController;
|
import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.DataVisualizationController;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.VisualizationFrameworkConstants;
|
import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.VisualizationFrameworkConstants;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants;
|
import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
|
import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.entitycomparison.EntityComparisonUtilityFunctions;
|
import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.entitycomparison.EntityComparisonUtilityFunctions;
|
||||||
|
@ -236,10 +238,22 @@ public class EntityGrantCountRequestHandler implements
|
||||||
|
|
||||||
Portal portal = vitroRequest.getPortal();
|
Portal portal = vitroRequest.getPortal();
|
||||||
String standaloneTemplate = "entityGrantComparisonError.ftl";
|
String standaloneTemplate = "entityGrantComparisonError.ftl";
|
||||||
|
|
||||||
Map<String, Object> body = new HashMap<String, Object>();
|
Map<String, Object> body = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
IndividualDao iDao = vitroRequest.getWebappDaoFactory().getIndividualDao();
|
||||||
|
Individual ind = iDao.getIndividualByURI(entityURI);
|
||||||
|
|
||||||
|
String organizationLabel = "Unknown Organization";
|
||||||
|
|
||||||
|
if (ind != null) {
|
||||||
|
organizationLabel = ind.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
body.put("organizationLabel", organizationLabel);
|
||||||
|
|
||||||
|
|
||||||
body.put("portalBean", portal);
|
body.put("portalBean", portal);
|
||||||
body.put("title", "Temporal Graph Visualization");
|
body.put("title", organizationLabel + " - Temporal Graph Visualization");
|
||||||
body.put("organizationURI", entityURI);
|
body.put("organizationURI", entityURI);
|
||||||
|
|
||||||
return new TemplateResponseValues(standaloneTemplate, body);
|
return new TemplateResponseValues(standaloneTemplate, body);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue