1 23 24 package org.infoglue.deliver.taglib.content; 25 26 import javax.servlet.jsp.JspException ; 27 import javax.servlet.jsp.JspTagException ; 28 29 import org.infoglue.deliver.taglib.component.ComponentLogicTag; 30 31 41 42 public class AssetThumbnailUrlTag extends ComponentLogicTag 43 { 44 private static final long serialVersionUID = 3978145452350648625L; 45 46 private String propertyName; 47 private String assetKey; 48 private int width; 49 private int height; 50 private boolean useInheritance = true; 51 52 public AssetThumbnailUrlTag() 53 { 54 super(); 55 } 56 57 public int doEndTag() throws JspException 58 { 59 try 60 { 61 if(assetKey != null) 62 write(getComponentLogic().getAssetThumbnailUrl(propertyName, assetKey, width, height, useInheritance)); 63 else 64 write(getComponentLogic().getAssetThumbnailUrl(propertyName, width, height, useInheritance)); 65 } 66 catch(Exception e) 67 { 68 e.printStackTrace(); 69 throw new JspTagException ("ComponentLogic.getAssetThumbnailUrl error: " + e.getMessage()); 70 } 71 return EVAL_PAGE; 72 } 73 74 public void setAssetKey(String assetKey) 75 { 76 this.assetKey = assetKey; 77 } 78 79 public void setHeight(int height) 80 { 81 this.height = height; 82 } 83 84 public void setPropertyName(String propertyName) throws JspException 85 { 86 this.propertyName = evaluateString("assetThumbnailUrl", "propertyName", propertyName); 87 } 88 89 public void setUseInheritance(boolean useInheritance) 90 { 91 this.useInheritance = useInheritance; 92 } 93 94 public void setWidth(int width) 95 { 96 this.width = width; 97 } 98 } | Popular Tags |