1 23 package org.infoglue.cms.taglib.content; 24 25 import javax.servlet.jsp.JspException ; 26 import javax.servlet.jsp.JspTagException ; 27 28 import org.infoglue.cms.controllers.kernel.impl.simple.DigitalAssetController; 29 import org.infoglue.deliver.taglib.AbstractTag; 30 31 34 public class DigitalAssetUrlTag extends AbstractTag 35 { 36 39 private static final long serialVersionUID = -3648763492131170473L; 40 41 44 private Integer digitalAssetId; 45 46 47 50 public DigitalAssetUrlTag() 51 { 52 super(); 53 } 54 55 58 public int doEndTag() throws JspException 59 { 60 setResultAttribute(getDigitalAssetUrl()); 61 return super.doEndTag(); 62 } 63 64 67 private String getDigitalAssetUrl() throws JspException 68 { 69 try 70 { 71 return DigitalAssetController.getDigitalAssetUrl(digitalAssetId); 72 } 73 catch(Exception e) 74 { 75 e.printStackTrace(); 76 throw new JspTagException (e.getMessage()); 77 } 78 } 79 80 83 public void setDigitalAssetId(final String digitalAssetId) throws JspException  84 { 85 this.digitalAssetId = evaluateInteger("digitalAssetUrl", "digitalAssetId", digitalAssetId); 86 } 87 88 } 89 | Popular Tags |