1 23 24 package org.infoglue.deliver.taglib.structure; 25 26 import javax.servlet.jsp.JspException ; 27 28 import org.infoglue.deliver.taglib.component.ComponentLogicTag; 29 30 public class ComponentPropertyValueTag extends ComponentLogicTag 31 { 32 private static final long serialVersionUID = 4050206323348354355L; 33 34 private Integer siteNodeId; 35 private String propertyName; 36 private boolean useLanguageFallback = true; 37 private boolean useInheritance = true; 38 39 40 public ComponentPropertyValueTag() 41 { 42 super(); 43 } 44 45 public int doEndTag() throws JspException 46 { 47 try 48 { 49 if(siteNodeId == null) 50 { 51 String propertyValue = getComponentLogic().getPropertyValue(propertyName, useLanguageFallback, useInheritance); 52 setResultAttribute(propertyValue); 53 } 54 else 55 { 56 String propertyValue = getComponentLogic().getPropertyValue(siteNodeId, propertyName, useLanguageFallback, useInheritance); 57 setResultAttribute(propertyValue); 58 } 59 } 60 catch(Exception e) 61 { 62 e.printStackTrace(); 63 } 64 65 return EVAL_PAGE; 66 } 67 68 public void setSiteNodeId(String siteNodeId) throws JspException 69 { 70 this.siteNodeId = evaluateInteger("componentPropertyValue", "siteNodeId", siteNodeId); 71 } 72 73 public void setPropertyName(String propertyName) throws JspException 74 { 75 this.propertyName = evaluateString("componentPropertyValue", "propertyName", propertyName); 76 } 77 78 public void setUseInheritance(boolean useInheritance) 79 { 80 this.useInheritance = useInheritance; 81 } 82 83 } 84 | Popular Tags |