From 28278b5d6b43e88c59e1d923f2d2f4b149026e9c Mon Sep 17 00:00:00 2001 From: j2blake Date: Thu, 10 Nov 2011 22:04:51 +0000 Subject: [PATCH] NIHVIVO-2343 Proxies get a placeholder image in the basic info. Don't step on it in the more info. --- .../manageproxies/ajax/MoreProxyInfo.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/manageproxies/ajax/MoreProxyInfo.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/manageproxies/ajax/MoreProxyInfo.java index 27cab1a28..62bf141a4 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/manageproxies/ajax/MoreProxyInfo.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/manageproxies/ajax/MoreProxyInfo.java @@ -25,6 +25,9 @@ import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyStatementDao; /** * Get more information (class label and image URL) about a selected proxy. + * + * If there is no image URL, just omit it from the result. The proxy already has + * a placeholder image. */ public class MoreProxyInfo extends AbstractAjaxResponder { private static final Log log = LogFactory.getLog(MoreProxyInfo.class); @@ -65,7 +68,10 @@ public class MoreProxyInfo extends AbstractAjaxResponder { Individual profileInd = inds.get(0); Map map = new HashMap(); - map.put("imageUrl", getFullImageUrl(profileInd)); + String imagePath = profileInd.getThumbUrl(); + if ((imagePath != null) && (!imagePath.isEmpty())) { + map.put("imageUrl", UrlBuilder.getUrl(imagePath)); + } map.put("classLabel", getMostSpecificTypeLabel(profileInd.getURI())); JSONArray jsonArray = new JSONArray(); @@ -86,12 +92,4 @@ public class MoreProxyInfo extends AbstractAjaxResponder { } } - private String getFullImageUrl(Individual ind) { - String thumbnailUrl = ind.getThumbUrl(); - if ((thumbnailUrl == null) || thumbnailUrl.isEmpty()) { - return ""; - } else { - return UrlBuilder.getUrl(thumbnailUrl); - } - } }