# Creating Shells

A shell represents the rendered area surrounding a portal desktop's main content area (books, pages, and portlets). Most importantly, a shell controls the content that appears in a desktop's header and footer regions.

You can configure a shell to use specific JSPs or HTML files to display content—especially personalized content—in a header or footer.

For each set of different header/footer combinations, create a new shell.

To create a shell

1. Make sure the server is running on your development machine. If it is not, open the portal application and choose Tools-->WebLogic Server-->Start WebLogic Server.
2. In WebLogic Workshop Platform Edition, open an existing shell (in the <project>\framework\markup\shell directory).
3. In the <netuix:shell> element, modify the title, description, and markupName attributes. The title attribute provides the name for selecting the shell in a drop-down menu; the markupName must be unique among the other shells.
4. Use the <netuix:header> or <netuix:footer> elements to point to the JSPs or HTML file you want to use for the header or footer using the following steps:
   1. Change the element from an empty element to one with opening and closing tags. For example:
      Change
      <netuix:header/>
      to
      <netuix:header>
      </netuix:header>
   2. Add the <netuix:jspContent conentUri=" "> tag to the <netuix:header> or <netuix:footer> tag, using the contentUri attribute to point to the JSP or HTML file you want to appear in the header or footer. The path to this file is relative to the project. For example, if you want your header to use the file <project>\my_jsps\campaign_header.jsp, set up your shell header as follows:
      <netuix:header>
      <netuix:jspContent contentUri="/my_jsps/campaign_header.jsp"/>
      </netuix:header>
      Make sure the JSP or HTML file does not contain <html>, <head>, <title>, or <body> HTML tags, because the file will be inserted into a single HTML file that already has these tags. You can format the file simply with <div>, <table>, <p>, or any other nested HTML tags.
   3. In the <netuix:jspContent> tag you can also point to an error JSP and a backing file to use for the header or footer JSP, using the following attributes:
      errorUri - Enter the path (relative to the project) to an error JSP to be used if there are problems with the contentUri JSP.
      backingFile - If you want to class for any preprocessing prior to the rendering of the header or footer JSP (for example, authentication), enter the fully qualified name of that class. That class should implement the interface com.bea.netuix.servlets.controls.content.backing.JspBacking or extend com.bea.netuix.servlets.controls.content.backing.AbstractJspBacking.
      The following example shows a shell header that uses a JSP, an error JSP, and a backing file:
      <netuix:header>
      <netuix:jspContent contentUri="/my_jsps/campaign_header.jsp" errorUri="/my_jsps/my_error.jsp"
      backingFile="custom.portal.backing.campaignBacking" />
      </netuix:header>
5. Save the shell file.
6. To select the shell for a desktop, select Desktop in the Document Structure window and select the shell in the Property Editor Shell field. (The name of the new shell will not appear if the server is not running.)

Selecting a Shell for a desktop in the Portal Designer simply gives the portal a default Shell setting. Portal administrators can use the WebLogic Administration Portal to change the Shell used for a desktop.

## Samples

See Portal Samples for instructions on viewing a sample portal file. The Sample Portal also includes an example of a shell that creates a left navigation frame.

Related Topics

The Portal User Interface Framework

Creating a Portal File

Adding Books and Pages to a Portal

Changing a Page Layout

Setting up Navigation

Building Portlets

Changing the Header and Footer