01: package com.opensymphony.module.sitemesh.tapestry;
02:
03: import org.apache.tapestry.Tapestry;
04:
05: /**
06: * Because Tapestry templating works differently than JSP taglibs,
07: * the writeEntireProperty feature is not implemented here. The built-in
08: *
09: * @Body component is most frequently used, to do something like
10: * this taglib example:
11: * <p/>
12: * <body bgcolor="White"<decorator:getProperty property="body.onload" writeEntireProperty="true" />>
13: * <p/>
14: * it would be done like this in Tapestry:
15: * <p/>
16: * <body jwcid="@Body" bgcolor="White" onload="ognl:@org.opensymphony.module.sitemesh.tapestry@Util.getProperty('onload', requestCycle)"/>
17: *
18: * @author Erik Hatcher
19: */
20: public abstract class Property extends SiteMeshBase {
21:
22: public abstract String getProperty();
23:
24: public abstract String getDefault();
25:
26: public String getValue() {
27: String propertyName = getProperty();
28: String propertyValue = getSiteMeshPage().getProperty(
29: propertyName);
30:
31: if (Tapestry.isBlank(propertyValue)) {
32: propertyValue = getDefault();
33: }
34:
35: return propertyValue;
36: }
37: }
|