1 23 package org.infoglue.cms.taglib.content; 24 25 import java.util.List ; 26 27 import javax.servlet.jsp.JspException ; 28 import javax.servlet.jsp.JspTagException ; 29 30 import org.infoglue.cms.controllers.kernel.impl.simple.DigitalAssetController; 31 import org.infoglue.deliver.taglib.AbstractTag; 32 33 36 public class DigitalAssetsTag extends AbstractTag 37 { 38 41 private static final long serialVersionUID = -5895792525780372296L; 42 43 46 private Integer contentId; 47 48 51 private Integer languageId; 52 53 56 public DigitalAssetsTag() 57 { 58 super(); 59 } 60 61 64 public int doEndTag() throws JspException 65 { 66 setResultAttribute(getDigitalAssets()); 67 return super.doEndTag(); 68 } 69 70 73 private List getDigitalAssets() throws JspException 74 { 75 try 76 { 77 List assets = DigitalAssetController.getDigitalAssetVOList(contentId, languageId, false); 78 return assets.isEmpty() ? null : assets; 79 } 80 catch(Exception e) 81 { 82 e.printStackTrace(); 83 throw new JspTagException (e.getMessage()); 84 } 85 } 86 87 90 public void setContentId(final String contentId) throws JspException 91 { 92 this.contentId = evaluateInteger("digitalAssets", "contentId", contentId); 93 } 94 95 98 public void setLanguageId(final String languageId) throws JspException 99 { 100 this.languageId = evaluateInteger("digitalAssets", "languageId", languageId); 101 } 102 } 103 | Popular Tags |