throws JspException
{
try
{
Context c = UIUtil.obtainContext(hrq);
Thumbnail thumbnail = ItemService.getThumbnail(c, item.getID(), linkToBitstream);
if (thumbnail == null)
{
return "";
}
StringBuffer thumbFrag = new StringBuffer();
if (linkToBitstream)
{
Bitstream original = thumbnail.getOriginal();
String link = hrq.getContextPath() + "/bitstream/" + item.getHandle() + "/" + original.getSequenceID() + "/" +
UIUtil.encodeBitstreamName(original.getName(), Constants.DEFAULT_ENCODING);
thumbFrag.append("<a target=\"_blank\" href=\"" + link + "\" />");
}
else
{
String link = hrq.getContextPath() + "/handle/" + item.getHandle();
thumbFrag.append("<a href=\"" + link + "\" />");
}
Bitstream thumb = thumbnail.getThumb();
String img = hrq.getContextPath() + "/retrieve/" + thumb.getID() + "/" +
UIUtil.encodeBitstreamName(thumb.getName(), Constants.DEFAULT_ENCODING);
String alt = thumb.getName();
String scAttr = getScalingAttr(hrq, thumb);
thumbFrag.append("<img src=\"")