NIHVIVO-2309 Fix propStatement-educationalTraining.ftl to handle coming from propDelete, where individual is not defined in the data model
This commit is contained in:
parent
6b7c12d3a3
commit
4f003dc668
2 changed files with 8 additions and 2 deletions
|
@ -127,7 +127,7 @@ public class IndividualController extends FreemarkerHttpServlet {
|
||||||
body.put("temporalVisualizationEnabled", getTemporalVisualizationFlag());
|
body.put("temporalVisualizationEnabled", getTemporalVisualizationFlag());
|
||||||
body.put("verbosePropertySwitch", getVerbosePropertyValues(vreq));
|
body.put("verbosePropertySwitch", getVerbosePropertyValues(vreq));
|
||||||
|
|
||||||
IndividualTemplateModel itm = getIndividualTemplateModel(vreq, individual);
|
IndividualTemplateModel itm = getIndividualTemplateModel(individual, vreq);
|
||||||
/* We need to expose non-getters in displaying the individual's property list,
|
/* We need to expose non-getters in displaying the individual's property list,
|
||||||
* since it requires calls to methods with parameters.
|
* since it requires calls to methods with parameters.
|
||||||
* This is still safe, because we are only putting BaseTemplateModel objects
|
* This is still safe, because we are only putting BaseTemplateModel objects
|
||||||
|
@ -248,7 +248,7 @@ public class IndividualController extends FreemarkerHttpServlet {
|
||||||
return linkTag;
|
return linkTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IndividualTemplateModel getIndividualTemplateModel(VitroRequest vreq, Individual individual)
|
private IndividualTemplateModel getIndividualTemplateModel(Individual individual, VitroRequest vreq)
|
||||||
throws ServletException, IOException {
|
throws ServletException, IOException {
|
||||||
|
|
||||||
IndividualDao iwDao = vreq.getWebappDaoFactory().getIndividualDao();
|
IndividualDao iwDao = vreq.getWebappDaoFactory().getIndividualDao();
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils" %>
|
||||||
<%@ page import="com.hp.hpl.jena.rdf.model.Model" %>
|
<%@ page import="com.hp.hpl.jena.rdf.model.Model" %>
|
||||||
<%@page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils"%>
|
<%@page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils"%>
|
||||||
|
<%@page import="edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.IndividualTemplateModel" %>
|
||||||
<%@page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerConfigurationLoader"%>
|
<%@page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerConfigurationLoader"%>
|
||||||
<%@page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet"%>
|
<%@page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet"%>
|
||||||
<%@page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.TemplateProcessingHelper"%>
|
<%@page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.TemplateProcessingHelper"%>
|
||||||
|
@ -116,6 +117,11 @@ public WebappDaoFactory getUnfilteredDaoFactory() {
|
||||||
String statementDisplay = null;
|
String statementDisplay = null;
|
||||||
if (! statement.isEmpty()) {
|
if (! statement.isEmpty()) {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
/* Some propStatements (propStatement-educationalTraining.ftl) make reference to the individual,
|
||||||
|
* but instead of adding it to the data model we'll test in the template for non-existence. IF
|
||||||
|
* this becomes more common, add it here instead.
|
||||||
|
*/
|
||||||
|
//map.put("individual", new IndividualTemplateModel(subject, vreq));
|
||||||
map.put("statement", statement);
|
map.put("statement", statement);
|
||||||
map.putAll(FreemarkerHttpServlet.getDirectives());
|
map.putAll(FreemarkerHttpServlet.getDirectives());
|
||||||
map.putAll(FreemarkerHttpServlet.getMethods());
|
map.putAll(FreemarkerHttpServlet.getMethods());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue