NIHVIVO-2343 Proxies get a placeholder image in the basic info. Don't step on it in the more info.
This commit is contained in:
parent
57c28c183f
commit
28278b5d6b
1 changed files with 7 additions and 9 deletions
|
@ -25,6 +25,9 @@ import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyStatementDao;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get more information (class label and image URL) about a selected proxy.
|
* 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 {
|
public class MoreProxyInfo extends AbstractAjaxResponder {
|
||||||
private static final Log log = LogFactory.getLog(MoreProxyInfo.class);
|
private static final Log log = LogFactory.getLog(MoreProxyInfo.class);
|
||||||
|
@ -65,7 +68,10 @@ public class MoreProxyInfo extends AbstractAjaxResponder {
|
||||||
Individual profileInd = inds.get(0);
|
Individual profileInd = inds.get(0);
|
||||||
|
|
||||||
Map<String, String> map = new HashMap<String, String>();
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
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()));
|
map.put("classLabel", getMostSpecificTypeLabel(profileInd.getURI()));
|
||||||
|
|
||||||
JSONArray jsonArray = new JSONArray();
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue