1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
|
<html>
<head>
<title>SiteMesh Tag Reference</title>
</head>
<body>
<p><b>SiteMesh</b> is bundled with 2 tag-libraries.</p>
<p>For installation instructions, see <a href="install.html">Installation and Configuration</a>, and for usage instructions and examples see <a href="decorators.html">Building Decorators</a>.</p>
<p>Note that the tags below are listed without the namespace prefixes as these are defined by the user when importing the tag library into the JSP page.</p>
<table align="center" width="80%" style="background: #eeeeee; border: 1 black solid;">
<tr>
<td valign="top">
<b>Decorator Tags</b>
</td>
<td valign="top">
<b>Page Tags</b>
</td>
</tr>
<tr>
<td valign="top">
Used to create decorator pages.
</td>
<td valign="top">
Used to access decorators from content pages.
</td>
</tr>
<tr>
<td valign="top">
<a href="#decorator:head"><code><decorator:head /></code></a><br>
<a href="#decorator:body"><code><decorator:body /></code></a><br>
<a href="#decorator:title"><code><decorator:title /></code></a><br>
<a href="#decorator:getProperty"><code><decorator:getProperty /></code></a><br>
<a href="#decorator:usePage"><code><decorator:usePage /></code></a><br>
</td>
<td valign="top">
<a href="#page:applyDecorator"><code><page:applyDecorator /></code></a><br>
<a href="#page:param"><code><page:param /></code></a><br>
</td>
</tr>
</table>
<h2>Decorator Tags</h2>
<p>
These tags are used to create page Decorators.
A Decorator is typically built up from an HTML layout (or
whatever is appropriate for the original page content-type)
with these tags inserted to provide place-holders for the
data from the original (undecorated) page.
</p>
<p>
For more details, see <a href="decorators.html">Building Decorators</a>.
<h4><a name="decorator:head"><decorator:head /></a></h4>
<div class="tagDef">
<p><b>Description:</b></p>
<blockquote>
Insert contents of original page's HTML <code><head></code>
tag. The enclosing tag will not be be written, but its
contents will.
</blockquote>
<p><b>Attributes:</b></p>
<ul>
<li><i>None</i></li>
</ul>
</div>
<h4><a name="decorator:body"><decorator:body /></a></h4>
<div class="tagDef">
<p><b>Description:</b></p>
<blockquote>
Insert contents of original page's HTML <code><body></code>
tag. The enclosing tag will not be be written, but its
contents will.<br>
<br>
Note: the content of the body onload and onunload events (and other body attributes) can be included in the decorator
by getting the property <code>body.onload</code> and <code>body.onunload</code> (the named attributes).<br>
For example (the decorator): <code><body onload="<decorator:getProperty property="body.onload" />"></code><br>
<br>
For more information: see <a href="#decorator:getProperty">getProperty</a>.
</blockquote>
<p><b>Attributes:</b></p>
<ul>
<li><i>None</i></li>
</ul>
</div>
<h4><a name="decorator:title"><decorator:title [ default="..." ] /></a></h4>
<div class="tagDef">
<p><b>Description:</b></p>
<blockquote>
Insert title of original page (obtained from
<code><title></code> tag).
will be used instead.
</blockquote>
<p><b>Attributes:</b></p>
<ul>
<li>
<p>
<b>default</b> <i>(optional)</i><br>
Value to be inserted if title not found.
</p>
</li>
</ul>
</div>
<h4><a name="decorator:getProperty"><decorator:getProperty property="..." [ default="..." ] [ writeEntireProperty="..." ]/></a></h4>
<div class="tagDef">
<p><b>Description:</b></p>
<blockquote>
Insert property of original page. See API reference for
<a href="api/com/opensymphony/module/sitemesh/HTMLPage.html">HTMLPage</a> for details
of how properties are obtained from a page.
</blockquote>
<p><b>Attributes:</b></p>
<ul>
<li>
<p>
<b>property</b> <i>(required)</i><br>
Name (key) of property to insert.
</p>
</li>
<li>
<p>
<b>default</b> <i>(optional)</i><br>
Value to be inserted if property not found.
</p>
</li>
<li>
<p>
<b>writeEntireProperty</b> <i>(optional)</i><br>
This writes the property with a <strong>space in front</strong> including the name ( propertyName="propertyValue")<br>
Accepted values are <code>true</code>, <code>yes</code> and <code>1</code>.<br>
For example:<br>
The decorator: <code><body bgcolor="White"<decorator:getProperty property="body.onload" writeEntireProperty="true" />></code><br>
The undecorated page: <code><body onload="document.someform.somefield.focus();"></code><br>
The decorated page: <code><body bgcolor="White" onload="document.someform.somefield.focus();"></code>
</p>
</li>
</ul>
</div>
<h4><a name="decorator:usePage"><decorator:usePage id="..." /></a><br></h4>
<div class="tagDef">
<p><b>Description:</b></p>
<blockquote>
Expose the <a href="api/com/opensymphony/module/sitemesh/Page.html">Page</a> object as
a variable to the decorator JSP.
</blockquote>
<p><b>Attributes:</b></p>
<ul>
<li>
<p>
<b>id</b> <i>(required)</i><br>
Name of variable to assign to.
</p>
</li>
</ul>
<p><b>Example:</b></p>
<blockquote>
<code>
<decorator:usePage id="myPage" /><br>
<% if ( myPage.getIntProperty("rating") == 10 ) { %><br>
<b>10 out of 10!</b><br>
<% } %><br>
</code>
</blockquote>
</div>
<h2>Page Tags</h2>
<p>The page tags, are used to apply decorators to inline or external content from within the current page.</p>
<h4><a name="page:applyDecorator"><page:applyDecorator name="..." [ page="..." title="..." ] ><br>
.....<br></page:applyDecorator></a></h4>
<div class="tagDef">
<p><b>Description:</b></p>
<blockquote>
Apply a Decorator to specified content. The content can either be inline by specifying a body to the tag,
<i>or</i> by using the result of another page by specifying the <code>page</code> attribute.<br>
</blockquote>
<p><b>Attributes:</b></p>
<ul>
<li>
<p>
<b>name</b> <i>(required)</i><br>
Name of the Decorator to apply to the included page.
</p>
</li>
<li>
<p>
<b>page</b> <i>(optional)</i><br>
Points to the external resource
which should expose an entire page (<i>e.g.</i> another JSP file producing
a valid page). This attribute can be relative to the page it is being called
from, or an absolute path from the context-root.
</p>
</li>
<li>
<p>
<b>title</b> <i>(optional)</i><br>
Override the title of the page available as <nobr><code>Page.getTitle()</code></nobr>
or <code><decorator:title/></code> from within the Decorator. This is identical to
specifying <code><page:param name="title">...<page:param></code>.
</p>
</li>
</ul>
<p><b>Body:</b></p>
<blockquote>
The content to have the Decorator applied to.
</blockquote>
</div>
<h4><a name="page:param"><page:param name="..."> ... </page:param></a></h4>
<div class="tagDef">
<p><b>Description:</b></p>
<blockquote>
Pass a parameter to a Decorator. This will override the value called from <nobr><code>Page.getProperty()</code></nobr>
or <code><decorator:getProperty/></code>. This tag is only valid inside a <code><page:applyDecorator></code>
tag.
</blockquote>
<p><b>Attributes:</b></p>
<ul>
<li>
<p>
<b>name</b> <i>(required)</i><br>
The name of the parameter to override.
</p>
</li>
</ul>
<p><b>Body:</b></p>
<blockquote>
The value of the parameter.
</blockquote>
</div>
</body>
</html>
|