NIHVIVO-650: Links and image display; fixed a bug in admin panel display.
This commit is contained in:
parent
e2407f7b01
commit
7b58a73c67
4 changed files with 26 additions and 15 deletions
|
@ -12,9 +12,7 @@ import java.util.Map;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import javax.servlet.RequestDispatcher;
|
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import javax.servlet.ServletOutputStream;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
@ -44,7 +42,6 @@ import edu.cornell.mannlib.vitro.webapp.beans.Portal;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet.ResponseValues;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration;
|
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration;
|
||||||
|
@ -58,7 +55,6 @@ import edu.cornell.mannlib.vitro.webapp.utils.NamespaceMapperFactory;
|
||||||
import edu.cornell.mannlib.vitro.webapp.web.ContentType;
|
import edu.cornell.mannlib.vitro.webapp.web.ContentType;
|
||||||
import edu.cornell.mannlib.vitro.webapp.web.jsptags.StringProcessorTag;
|
import edu.cornell.mannlib.vitro.webapp.web.jsptags.StringProcessorTag;
|
||||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.IndividualTemplateModel;
|
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.IndividualTemplateModel;
|
||||||
import freemarker.template.Configuration;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles requests for entity information.
|
* Handles requests for entity information.
|
||||||
|
|
|
@ -38,10 +38,6 @@ public class IndividualTemplateModel extends BaseTemplateModel {
|
||||||
// return StringUtils.isEmpty(tagline) ? individual.getVClass().getName() : tagline;
|
// return StringUtils.isEmpty(tagline) ? individual.getVClass().getName() : tagline;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Return link to individual's profile page.
|
|
||||||
// There may be other urls associated with the individual. E.g., we might need
|
|
||||||
// getEditUrl(), getDeleteUrl() to return the links computed by PropertyEditLinks.
|
|
||||||
// RY **** Need to account for everything in URLRewritingHttpServlet
|
|
||||||
public String getProfileUrl() {
|
public String getProfileUrl() {
|
||||||
String profileUrl = null;
|
String profileUrl = null;
|
||||||
String individualUri = individual.getURI();
|
String individualUri = individual.getURI();
|
||||||
|
@ -125,7 +121,10 @@ public class IndividualTemplateModel extends BaseTemplateModel {
|
||||||
|
|
||||||
/* These methods simply forward to the Individual methods. It would be desirable to implement a scheme
|
/* These methods simply forward to the Individual methods. It would be desirable to implement a scheme
|
||||||
for proxying or delegation so that the methods don't need to be simply listed here.
|
for proxying or delegation so that the methods don't need to be simply listed here.
|
||||||
A Ruby-style method missing method would be ideal. */
|
A Ruby-style method missing method would be ideal.
|
||||||
|
Update: DynamicProxy doesn't work because the proxied object is of type Individual, so we cannot
|
||||||
|
declare new methods here that are not declared in the Individual interface.
|
||||||
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return individual.getName();
|
return individual.getName();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<#-- Template for individual profile page -->
|
<#-- Template for individual profile page -->
|
||||||
|
|
||||||
<#import "lib-property.ftl" as p>
|
<#import "lib-property.ftl" as p>
|
||||||
|
<#import "lib-list.ftl" as l>
|
||||||
|
|
||||||
<#assign editingClass>
|
<#assign editingClass>
|
||||||
<#if editStatus.showEditLinks>editing<#else></#if>
|
<#if editStatus.showEditLinks>editing<#else></#if>
|
||||||
|
@ -36,6 +37,7 @@
|
||||||
|
|
||||||
<#include "individual-sparklineVisualization.ftl">
|
<#include "individual-sparklineVisualization.ftl">
|
||||||
|
|
||||||
|
<#-- Thumbnail -->
|
||||||
<div id="dprop-vitro-image" class="propsItem ${editingClass}">
|
<div id="dprop-vitro-image" class="propsItem ${editingClass}">
|
||||||
<#if individual.thumbUrl??>
|
<#if individual.thumbUrl??>
|
||||||
<@p.dataPropsWrapper id="thumbnail">
|
<@p.dataPropsWrapper id="thumbnail">
|
||||||
|
@ -48,13 +50,27 @@
|
||||||
<#elseif individual.person>
|
<#elseif individual.person>
|
||||||
<@p.dataPropsWrapper id="thumbnail">
|
<@p.dataPropsWrapper id="thumbnail">
|
||||||
<img src="${urls.images}/dummyImages/person.thumbnail.jpg"
|
<img src="${urls.images}/dummyImages/person.thumbnail.jpg"
|
||||||
alt="placeholder image" width="115" />
|
title = "no image" alt="placeholder image" width="115" />
|
||||||
</@p.dataPropsWrapper>
|
</@p.dataPropsWrapper>
|
||||||
</#if>
|
</#if>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<#-- Links -->
|
||||||
|
<#if individual.links?has_content>
|
||||||
|
<div id="dprop-vitro-links" class="propsItem ${editingClass}">
|
||||||
|
<ul class="externalLinks properties">
|
||||||
|
<#list individual.links as link>
|
||||||
|
<@l.firstLastList>
|
||||||
|
<li>
|
||||||
|
<span class="statementWrap">
|
||||||
|
<a class="externalLink" href="${link.url}">${link.anchor}</a>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
</@l.firstLastList>
|
||||||
|
</#list>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
</div> <!-- #contents -->
|
</div> <!-- #contents -->
|
||||||
|
|
||||||
</div> <!-- #personWrap -->
|
</div> <!-- #personWrap -->
|
||||||
|
|
|
@ -6,6 +6,6 @@
|
||||||
<h3 class="toggle">Admin Panel</h3>
|
<h3 class="toggle">Admin Panel</h3>
|
||||||
<div class="panelContents">
|
<div class="panelContents">
|
||||||
<a href="${editStatus.editingUrl}"> edit this individual</a>
|
<a href="${editStatus.editingUrl}"> edit this individual</a>
|
||||||
<p>Resource URI: ${individual.URI}</p>
|
<p>Resource URI: ${individual.uri}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
Loading…
Add table
Reference in a new issue