Shell

Provides the outer 'shell' of a page, including the <html>, <head> and <title> tags, but not the <body> tag (which is typically provided by a Body component).

Most Tapestry pages will include a Shell component enclosing a Body component. The Shell is used to resolve the page's HTML stylesheet and the Body component manages dynamically generated JavaScript.

When designing the look and feel of a Tapestry page, include the normal HTML elements before the Shell component, including a <link rel="stylesheet"> element, so that the page will render normally in a web browser, but use a <span jwcid="$content$"> around the actual content.

See also: org.apache.tapestry.html.Shell , Body , PageLink

Parameters

Name Type Direction Required Default Description
title String in yes The title for the page, used to render the <title> tag.
raw boolean in no false If false (the default), then HTML characters in the title are escaped. If true, then value is emitted exactly as is.
stylesheet IAsset in no If provided, then a <link> to the stylesheet is generated.
stylesheets Array or collection of IAsset in no If provided, then <link> elements are created for each stylesheet asset.
doctype String in no HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" Used to specify the full definition of the DOCTYPE element in the response page.
renderContentType boolean in no true If true (the default), then a <meta> tag will be written to set the content type of the page.
refresh int in no If provided, then a <meta> tag will be written to cause a page refresh. The parameter value is the number of seconds before the refresh.
disableCaching boolean in no false If provided, then a <meta> tag will be written setting the content="nocache" value to try and prevent browser caching of page.
delegate IRender in no If specified, the delegate is rendered before the close of the <head> tag. Typically, this is used to provide additional <meta> tags.
renderBaseTag boolean in no true Specifies whether or not to render the html BASE tag element in the document HEAD.
ajaxDelegate IRender in no AjaxShellDelegate If specified, allows for the default ajaxDelegate that renders the dojo script includes to be overriden.
browserLogLevel String - One of [DEBUG,INFO,WARNING,ERROR,CRITICAL] in no WARNING Sets the default browser based javascript log level to use to debug client side interactions. If you specify an html element id to place the debug content it will be written there. Otherwise, the default is to write to an element with id "debug", or append to the document body if none exists.

See the dojo docs for more information about logging, but the basic idea is that you can write statements like dojo.log.info("Doing some operation"); in javascript and have them appropriately filtered based on the log level used.

debugEnabled boolean in no true Turns browser level logging completely on/off.
debugContainerId String in no debug Sets the html element node id of the element you would like all browser debug content to go to, if you have logging turned on.

For example, if you had an element on your html page with id="myElement" you would set the debugContainerId to "myElement".

parseWidgets boolean in no false Tells dojo whether or not to parse widgets by traversing the entire dom node of your document. It is highly reccomended that you keep this at its default value of false.
tapestrySource IAsset in false classpath:/tapestry/core.js Controls what the root source inclusion is for tapestry javascript packages. Override if you want to replace the built in defaults with a version of your own.
dojoSource IAsset in false classpath:/dojo/dojo.js Controls what the root source inclusion is for the dojo javascript packages. Override if you want to replace the built in defaults with a version of your own.
dojoPath IAsset in false classpath:/dojo/ Specifies the default path to the root dojo folder, not the dojo.js file itself. This is used by the djConfig.baseRelativePath javascript configuration property in dojo to resolve relative resource includes - like widgets/images/js/css/etc..

Body: allowed

Informal parameters: forbidden

Reserved parameters: none

Examples

The Shell component is used here to provide the page's stylesheet and title.

In this example, the Login.html template is in the login subdirectory of the root application context. The stylesheet is within the styles directory, below the root application context.

login/Login.html:

<html>
<head>
 <link rel="stylesheet" type="text/css" href="../styles/style.css"/>
 <title>MyCorp Customer Login</title>
</head>

<span jwcid="$content$">
<span jwcid="@Shell" stylesheet="asset:stylesheet" title="MyCorp Customer Login">
<body jwcid="@Body">

<h1>Customer Login</h1>
Welcome to MyCorp's Customer Portal secure login page.

. . .

</body>
</span>
</span>
</html>

WEB-INF/login/Login.page:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE page-specification PUBLIC 
  "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
  "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
  
<page-specification>

  . . .
  
  <asset name="stylesheet" path="styles/style.css"/>
   
</page-specification>

Note that for page and component specifications stored in the web application context (even under WEB-INF), relative asset paths are computed from the root application context directory .