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