NIHVIVO-650: Links and image display; fixed a bug in admin panel display.

This commit is contained in:
rjy7 2010-09-21 19:49:43 +00:00
parent e2407f7b01
commit 7b58a73c67
4 changed files with 26 additions and 15 deletions

View file

@ -12,9 +12,7 @@ import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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.controller.Controllers;
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.ObjectPropertyDao;
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.jsptags.StringProcessorTag;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.IndividualTemplateModel;
import freemarker.template.Configuration;
/**
* Handles requests for entity information.
@ -243,7 +239,7 @@ public class IndividualController extends FreemarkerHttpServlet {
// }
map.put("individual", new IndividualTemplateModel(individual));
//setup highlighter for search terms
//checkForSearch(vreq, individual);

View file

@ -38,10 +38,6 @@ public class IndividualTemplateModel extends BaseTemplateModel {
// 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() {
String profileUrl = null;
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
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() {
return individual.getName();
}

View file

@ -3,6 +3,7 @@
<#-- Template for individual profile page -->
<#import "lib-property.ftl" as p>
<#import "lib-list.ftl" as l>
<#assign editingClass>
<#if editStatus.showEditLinks>editing<#else></#if>
@ -36,6 +37,7 @@
<#include "individual-sparklineVisualization.ftl">
<#-- Thumbnail -->
<div id="dprop-vitro-image" class="propsItem ${editingClass}">
<#if individual.thumbUrl??>
<@p.dataPropsWrapper id="thumbnail">
@ -47,14 +49,28 @@
</@p.dataPropsWrapper>
<#elseif individual.person>
<@p.dataPropsWrapper id="thumbnail">
<img src="${urls.images}/dummyImages/person.thumbnail.jpg"
alt="placeholder image" width="115" />
<img src="${urls.images}/dummyImages/person.thumbnail.jpg"
title = "no image" alt="placeholder image" width="115" />
</@p.dataPropsWrapper>
</#if>
</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> <!-- #personWrap -->

View file

@ -6,6 +6,6 @@
<h3 class="toggle">Admin Panel</h3>
<div class="panelContents">
<a href="${editStatus.editingUrl}"> edit this individual</a>
<p>Resource URI: ${individual.URI}</p>
<p>Resource URI: ${individual.uri}</p>
</div>
</div>