NIHVIVO-1380 On individual page, add rdf link tag for discoverable rdf
This commit is contained in:
parent
dc27a74a8a
commit
be8930ea5c
3 changed files with 24 additions and 11 deletions
|
@ -331,7 +331,8 @@ public class FreemarkerHttpServlet extends VitroHttpServlet {
|
|||
return map;
|
||||
}
|
||||
|
||||
// Add variables that should be available only to the page's root map, not to the body.
|
||||
// Add variables that are needed to generate the page template (they will also be accessible
|
||||
// to the body template).
|
||||
// RY This is protected instead of private so FreeMarkerComponentGenerator can access.
|
||||
// Once we don't need that (i.e., jsps have been eliminated) we can make it private.
|
||||
protected Map<String, Object> getPageTemplateValues(VitroRequest vreq) {
|
||||
|
|
|
@ -121,13 +121,15 @@ public class IndividualController extends FreemarkerHttpServlet {
|
|||
|
||||
body.put("relatedSubject", getRelatedSubject(vreq));
|
||||
|
||||
IndividualTemplateModel ind = getIndividualTemplateModel(vreq, individual);
|
||||
body.put("headContent", getRdfLinkTag(individual));
|
||||
|
||||
IndividualTemplateModel itm = getIndividualTemplateModel(vreq, individual);
|
||||
/* We need to expose non-getters in displaying the individual's property list,
|
||||
* since it requires calls to methods with parameters.
|
||||
* This is still safe, because we are only putting BaseTemplateModel objects
|
||||
* into the data model: no real data can be modified.
|
||||
*/
|
||||
body.put("individual", getNonDefaultBeansWrapper(BeansWrapper.EXPOSE_SAFE).wrap(ind));
|
||||
body.put("individual", getNonDefaultBeansWrapper(BeansWrapper.EXPOSE_SAFE).wrap(itm));
|
||||
|
||||
body.put("localName", new IndividualLocalNameMethod());
|
||||
|
||||
|
@ -192,6 +194,14 @@ public class IndividualController extends FreemarkerHttpServlet {
|
|||
return map;
|
||||
}
|
||||
|
||||
//<link rel="alternate" type="application/rdf+xml" href="http://vivo.cornell.edu/individual/n337/n337.rdf" />
|
||||
private String getRdfLinkTag(Individual individual) {
|
||||
String href = individual.getURI() + "/" + individual.getLocalName() + ".rdf";
|
||||
String linkTag = "<link rel=\"alternate\" type=\"application/rdf+xml\" href=\"" +
|
||||
href + "\" /> ";
|
||||
return linkTag;
|
||||
}
|
||||
|
||||
private IndividualTemplateModel getIndividualTemplateModel(VitroRequest vreq, Individual individual)
|
||||
throws ServletException, IOException {
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<!-- Google Chrome Frame open source plug-in brings Google Chrome's open web technologies and speedy JavaScript engine to Internet Explorer-->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta charset="utf-8" />
|
||||
<!-- Google Chrome Frame open source plug-in brings Google Chrome's open web technologies and speedy JavaScript engine to Internet Explorer-->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
|
||||
<#include "title.ftl">
|
||||
<#include "title.ftl">
|
||||
|
||||
<#include "stylesheets.ftl">
|
||||
<#include "stylesheets.ftl">
|
||||
|
||||
<#include "headScripts.ftl">
|
||||
<#include "headScripts.ftl">
|
||||
|
||||
${headContent!}
|
Loading…
Add table
Reference in a new issue