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:
cdtank 2011-02-10 16:19:16 +00:00
parent 9e50f212d0
commit 24795af665
3 changed files with 32 additions and 4 deletions

View file

@ -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.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.Portal;
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.TemplateResponseValues;
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.dao.IndividualDao;
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.freemarker.valueobjects.Entity;
@ -237,10 +239,20 @@ public class EntityPublicationCountRequestHandler implements
Portal portal = vitroRequest.getPortal();
String standaloneTemplate = "entityPublicationComparisonError.ftl";
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("title", "Temporal Graph Visualization");
body.put("title", organizationLabel + " - Temporal Graph Visualization");
body.put("organizationURI", entityURI);
return new TemplateResponseValues(standaloneTemplate, body);

View file

@ -22,12 +22,14 @@ import com.hp.hpl.jena.query.Dataset;
import com.hp.hpl.jena.rdf.model.Model;
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.controller.VitroRequest;
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.visualization.freemarker.DataVisualizationController;
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.exceptions.MalformedQueryParametersException;
import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.entitycomparison.EntityComparisonUtilityFunctions;
@ -236,10 +238,22 @@ public class EntityGrantCountRequestHandler implements
Portal portal = vitroRequest.getPortal();
String standaloneTemplate = "entityGrantComparisonError.ftl";
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("title", "Temporal Graph Visualization");
body.put("title", organizationLabel + " - Temporal Graph Visualization");
body.put("organizationURI", entityURI);
return new TemplateResponseValues(standaloneTemplate, body);