blob: 539e95e42c2b8473d8e1f025ddbb12df4ea8f855 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- $Id$ -->
<html>
<head>
<title>Shell</title>
<link rel="stylesheet" type="text/css" href="Tapestry.css" title="style">
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left"><A href="ServiceLink.html"><IMG alt=ServiceLink src="common-images/prev.png"></A></td>
<td align="middle"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></A></td>
<td align="right"><A href="Submit.html"><IMG alt=Submit src="common-images/next.png"></A></td>
<tr>
<tr>
<td colspan="3"><hr></td>
</tr>
<tr>
<td colspan="3">
<table border="0" cellpadding="4" cellspacing="4" width="100%">
<tr valign="top">
<td>
<table>
<tr>
<td><font size="+2"><b>Shell</b></font></td>
</tr>
<tr>
<td>
<A href="../api/org/apache/tapestry/html/Shell.html">
org.apache.tapestry.html.Shell</A>
</td>
</tr>
</table>
</td>
<td>
<table align="right" valign="middle" bgcolor="#c0c0c0" cellpadding="8">
<tr>
<td>Non Visual Component</td>
</tr>
</table>
</td>
</tr>
<tr valign="center">
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">
<b>Description</b>
<br>
Provides the outer 'shell' of a page, including the &lt;html&gt;, &lt;head&gt;
and &lt;title&gt; tags, but not the &lt;body&gt; tag which is typically
provided by a <A href="Body.html">Body</A> component.
<p>
Most Tapestry pages will include a Shell component followed by a Body
component. The Shell is used to resolve the page's HTML stylesheet and the Body
component manages dynamically generated JavaScript.
<p>
When designing the look and feel of a
Tapestry page, include the normal HTML elements before the Shell
component, including a &lt;link rel="stylesheet"&gt; element, so
that the page will render normally in a web browser, but use a
&lt;span jwcid="$content$"&gt; around the actual content.</p>
</td>
</tr>
<tr>
<td colspan="2">
<b>See Also</b>
<br>
<A href="Body.html">Body</A>,
<A href="Script.html">Script</A>
</td>
</tr>
<tr>
<td colspan="2">
<b>Parameters</b>
<br>
<table border="1" cellpadding="4" cellspacing="4" class="parameters">
<tr>
<th>Name</th>
<th>Type</th>
<th>Direction</th>
<th>Required</th>
<th>Default</th>
<th>Description</th>
</tr>
<tr>
<td>title</td>
<td>String</td>
<td>in</td>
<td>yes</td>
<td>&nbsp;</td>
<td>Used to provide the window title for the page.</td>
</tr>
<tr>
<td>stylesheet</td>
<td><A href="../api/org/apache/tapestry/IAsset.html"><tt>IAsset</tt></A></td>
<td>in</td>
<td>no</td>
<td>&nbsp;</td>
<td>Creates a &lt;link rel="stylesheet"&gt; element.</td>
</tr>
<tr>
<td>stylesheets</td>
<td>Array or collection of <A href="../api/org/apache/tapestry/IAsset.html"><tt>IAsset</tt></A></td>
<td>in</td>
<td>no</td>
<td>&nbsp;</td>
<td>Creates a series of &lt;link rel="stylesheet"&gt; element, one for each asset.</td>
</tr>
<tr>
<td>refresh</td>
<td>int</td>
<td>in</td>
<td>no</td>
<td>&nbsp;</td>
<td>
If provided (and non-zero), then a &lt;meta http-equiv="Refresh"&gt; element
is included in the header. The refresh interval is the value provided
(which is the time to display the page, in seconds).
<p>
The refresh will be the same page (not necessarily the same URL as that
which initially presented the page, since the page will often be initially
displayed because of a link or form submission).
<p>
Note that to the <meta> tag, a refresh of zero means refresh
immediately. For this component, a refresh of zero is the same
as unspecified: no automatic refresh.</p>
</td>
</tr>
<tr>
<td>doctype</td>
<td>String</td>
<td>in</td>
<td>no</td>
<td style="font-size: xx-small;">
HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"
</td>
<td>
Used to specify the full definition of the DOCTYPE element in the response page.
For example, setting this parameter to
<pre>math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd"</pre>
will make the component generate
<pre>&lt;!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd"&gt;</pre>
<p>
The list of currently valid DOCTYPE settings can be found here:
http://www.w3.org/QA/2002/04/valid-dtd-list.html
<p>
If the parameter is null or empty, no DOCTYPE tag will be rendered
</td>
</tr>
<tr>
<td>DTD</td>
<td>String</td>
<td>in</td>
<td>no</td>
<td>null</td>
<td>
Used to specify the DOCTYPE DTD of the generated HTML document.
<p>
This parameter is deprecated. Please use the doctype parameter instead.
</td>
</tr>
<tr>
<td>delegate</td>
<td><A href="../api/org/apache/tapestry/IRender.html"><tt>IRender</tt></A></td>
<td>in</td>
<td>no</td>
<td>&nbsp;</td>
<td>
If specified, the delegate is invoked just before the &lt;/head&gt; tag.
This allows the delegate to write additional tags, often meta tags of
various types.
</td>
</tr>
<tr>
<td>renderContentType</td>
<td>boolean</td>
<td>in</td>
<td>no</td>
<td>true</td>
<td>Determines whether the component will render an http-equiv element with
the Content Type of this response. It is necessary to render this element to ensure
that the browser will encode the POST parameters using the encoding
defined in the Content Type. Otherwise the browsers may use the default encoding
of the client machine, which cannot be known by the server.
If you set this parameter to false, please make sure that you can decode
the HTTP request parameters correctly.</td>
</tr>
</table>
<P>Body: <STRONG>rendered<BR></STRONG>Informal parameters:
<STRONG>allowed (applied to &lt;html&gt; tag)</STRONG>
<br>
Reserved parameters: <EM>none</EM>
</P>
</td>
</tr>
<tr>
<td colspan="2">
<b>Examples</b>
<p>
The Shell component is used here to provide the page's stylesheet and title.
<p>
Note in this example a common stylesheet file <tt>style.css</tt> is located in
the class path directory <tt>/com/mycorp/pages/</tt> while the page's class is
in <tt>/com/mycorp/pages/customer/login/</tt>. The HTML header uses a relative
path to resolve the stylesheet.
<p>
<table class="examples" cellpadding="24">
<tr>
<td>
<h2><i><font color="navy">Customer Login</font></i></h2>
Welcome to MyCorp's Customer Portal secure login page.
<p>
<font color="red"><i>Please call 1800 230 187 for TR-2 recall information.</i></font></p>
<td></td>
</tr>
</table>
<pre>
&lt;html&gt;
&lt;head&gt;
&lt;link rel="stylesheet" type="text/css" <b>href="../../style.css"</b> title="style"&gt;
&lt;title&gt;MyCorp Customer Login&lt;/title&gt;
&lt;/head&gt;
&lt;span jwcid="$content$"&gt;
&lt;span jwcid="<span class="jwcid">@<a href="Shell.html">Shell</a></span>" stylesheet="ognl:assets.stylesheet" title="MyCorp Customer Login"&gt;
&lt;body jwcid="@<a href="Body.html">Body</a>"&gt;
&lt;h1&gt;Customer Login&lt;/h1&gt;
Welcome to MyCorp's Customer Portal secure login page.
&lt;p&gt;
&lt;span jwcid="@<a href="Insert.html">Insert</a>" value="ognl:dailyMessage" class="ognl:messageClass"/&gt;
&lt;/body&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;/html&gt;
&lt;property-specification name=&quot;dailyMessage&quot; type=&quot;java.lang.String&quot;/&gt;
&lt;property-specification name=&quot;messageClass&quot; type=&quot;java.lang.String&quot;/&gt;
&lt;private-asset name="stylesheet" resource-path="/com/mycorp/pages/style.css"/&gt;
package com.mycorp.pages.customer.login;
public abstract class CustomerLoginPage extends BasePage {
public abstract String getDailyMessage();
public abstract String getMessageClass();
}
</pre>
</td>
</tr></table>
</td></tr>
<tr>
<td colspan="3"><hr></td>
</tr>
<tr>
<td align="left"><A href="ServiceLink.html"><IMG alt=ServiceLink src="common-images/prev.png"></A></td>
<td align="middle"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></A></td>
<td align="right"><A href="Submit.html"><IMG alt=Submit src="common-images/next.png"></A></td>
</tr>
</table>
</body>
</html>