Sun Java System Portal Server 7.1 Developer Sample Guide

Chapter 4 Customizing Container Tabs

This chapter provides a variety of tasks to customize the container tabs. It contains the following sections:


Note –

The order that you list the tabs in the display profile is the order that tabs are displayed in the Desktop. So, to make a tab the first tab in the user’s Desktop, you need to move it to be first in the selected list in the display profile.


Adding a Tab to JSPTabContainer

A tab can be any container type, but, by default, the sample portal uses table container. To add a new tab, you must first define the container, then register that container in JSPTabContainer, which “houses” the tabs.

ProcedureTo Add a Tab to JSPTabContainer

  1. Create the necessary display profile.

    1. Define the new collection within <Collection name="TabProperties"> in JSPTabContainer. For example:


      ...
      <Collection name=" NewTabPanelContainer" >
      	<Boolean name=“removable” value=“false”/>
      	<Boolean name=renamable” value=“true/>
      	<Boolean name=predefined” value=“true/>
      </Collection>
      ... 
      </Collection> ...
    2. Add entries to the <Available> and <Selected> tags. For example:


      ...
      <Available>
      	<Reference value=”NewTabPanelContainer”/>
      	...
      </Available>
      ...
      <Selected>
      	<Reference value=”NewTabPanelContainer"/>
      	...
      </Selected>
      ...
    3. Define a container for NewTabPanelContainer. For example:


      <Container name="NewTabPanelContainer" provider="JSPTableContainerProvider"> 
      		<Properties> 
      			<String name="title" value="New Container Channel"/> 
      			<String name="contentPage" value="tabtable.jsp"/> 
      			<String name="description" value="This is a test for front table containers"/> 
      			<String name="Desktop-fontFace1" value="Sans-serif"/> 
      			<Collection name="categories"> 
      				<String value="Personal Channels"/> 
      				<String value="Sample Channels"/> 
      			</Collection> 
      			<Collection name="Personal Channels"> 
      				<String value="UserInfo"/> 
      				<String value="MailCheck"/> 
      			</Collection> 
      			<Collection name="Sample Channels"> 
      				<String value="SampleJSP"/> 
      				<String value="SampleXML"/> 
      			</Collection> 
      		</Properties> 
      		<Available> 
      			<Reference value="UserInfo"/> 
      			<Reference value="MailCheck"/> 
      			<Reference value="SampleJSP"/> 
      			<Reference value="SampleXML"/> 
      		</Available> 
      		<Selected> 
      			<Reference value="UserInfo"/> 
      			<Reference value="MailCheck"/> 
      			<Reference value="SampleJSP"/> 
      			<Reference value="SampleXML"/> 
      		</Selected> 
      		<Channels> 
      			... 
      		</Channels> 
      	</Container>
    4. If predefined property value is true in the TabProperties collection ( Adding a Tab to JSPTabContainer), then it is recommended to define a Provider for the container channel which is meant to be used as a predefined tab.

      For example, see below for the PredefinedNewTabPanelContainerProvider Display Profile Definition


      <Provider name="PredefinedNewTabPanelContainerProvider" class="com.sun.portal.providers.containers.jsp.table.JSPTableContainerProvider" version="2">
          <Properties>
              <ConditionalProperties condition="locale" value="en" >
                  <ConditionalProperties condition="locale" value="US" >
                      <String name="title" value="New Sample"/>
                      <String name="description" value="New Tab"/>
                  </ConditionalProperties>
              </ConditionalProperties>
              <String name="title" value="New Sample"/>
              <String name="description" value="New Tab"/>
              <String name="contentPage" value="tabtable.jsp"/>
              <String name="presetThemeChannel" value="JSPPresetThemeContainer" advanced="true"/>
              <String name="customThemeChannel" value="JSPCustomThemeContainer" advanced="true"/>
              <String name="parentTabContainer" value="JSPTabContainer" advanced="true"/>
              <String name="Desktop-fontFace1" value="Sans-serif"/>
              <String name="refreshTime" value="" advanced="true"/>
              <String name="width" value="thin" advanced="true"/>
              <String name="fontFace1" value="Sans-serif"/>
              <String name="productName" value="Sun Java System Portal Server"/>
              <String name="maximizedChannel" value=""/>
              <Integer name="timeout" value ="240"/>
              <Integer name="layout" value="1"/>
              <Boolean name="showExceptions" value="false"/>
              <Boolean name="parallelChannelsInit" value="false"/>
              <Boolean name="refreshParentContainerOnly" value="false" advanced="true"/>
              <Boolean name="isEditable" value="true" advanced="true"/>
              <String name="editType" value="edit_complete" advanced="true"/>
              <String name="editContainerName" value="JSPEditContainer" advanced="true"/>
              <Integer name="thin_popup_height" value="200"/>
              <Integer name="thin_popup_width" value="500"/>
              <Integer name="thick_popup_height" value="300"/>
              <Integer name="thick_popup_width" value="600"/>
              <Integer name="fullwidth_popup_height" value="500"/>
              <Integer name="fullwidth_popup_width" value="600"/>
              <Boolean name="defaultChannelIsMinimizable" value="true"/>
              <Boolean name="defaultChannelIsMaximizable" value="true"/>
              <Boolean name="defaultChannelIsMinimized" value="false" advanced="true"/>
              <Boolean name="defaultChannelIsDetached" value="false" advanced="true"/>
              <Boolean name="defaultChannelIsDetachable" value="true"/>
              <Boolean name="defaultChannelIsRemovable" value="true"/>
              <Boolean name="defaultChannelHasFrame" value="true" advanced="true"/>
              <Boolean name="defaultChannelIsMovable" value="true"/>
              <Boolean name="defaultBorderlessChannel" value="false" advanced="true"/>
              <String name="defaultChannelColumn" value="1" advanced="true"/>
              <String name="defaultChannelRow" value="1" advanced="true"/>
              <Collection name="categories">
                  <String value="Sample Channels"/>
              </Collection>
              <Collection name="Sample Channels">
                  <String value="SampleRSS"/>
                  <String value="SampleURLScraper"/>
                  <String value="Notes"/>
                  <String value="SampleSimpleWebService"/>
              </Collection>
              <Collection name="channelsColumn" advanced="true">
                  <String name="SampleURLScraper" value="2"/>
                  <String name="Notes" value="2"/>
                  <String name="SampleSimpleWebService" value="2"/>
              </Collection>
              <Collection name="channelsRow" advanced="true">
                  <String name="SampleURLScraper" value="2"/>
                  <String name="Notes" value="3"/>
                  <String name="SampleSimpleWebService" value="4"/>
              </Collection>
              <Collection name="channelsIsMinimized" advanced="true"/>
              <Collection name="channelsIsDetached" advanced="true"/>
              <Collection name="channelsHasFrame" advanced="true"/>
              <Collection name="channelsIsMinimizable"/>
              <Collection name="channelsIsMaximizable"/>
              <Collection name="channelsIsMovable"/>
              <Collection name="channelsIsRemovable"/>
              <Collection name="channelsIsDetachable"/>
              <Collection name="borderlessChannels"/>
          </Properties>
      </Provider>
    5. Define the container channel based on the PredefinedNewTabPanelContainerProvider.

      When the user creates a new tab based on the predefined tab, all the properties for this tab are picked up from the Provider definition. For example, see below for PredefinedNewTabPanelContainer Channel Properties.


      <Container name="PredefinedNewTabPanelContainer" provider="PredefinedNewTabPanelContainerProvider">
          <Properties/>
          <Available>
              <Reference value="SampleRSS"/>
              <Reference value="SampleURLScraper"/>
              <Reference value="Notes"/>
              <Reference value="SampleSimpleWebService"/>
          </Available>
          <Selected>
              <Reference value="SampleRSS"/>
              <Reference value="SampleURLScraper"/>
              <Reference value="Notes"/>
              <Reference value="SampleSimpleWebService"/>
          </Selected>
          <Channels>
          </Channels>
      </Container>
  2. Load the display profile into LDAP by using the psadmin subcommand.

  3. Bring up the Desktop and verify that the tab was added.

Creating a Tab Within a Tab

This is similar to Adding a Tab to JSPTabContainer, except that instead of defining the tab based on JSPTableContainerProvider, you base the new tab on JSPTabContainerProvider.

Stretching a Tab Across an Entire Container

This section includes instructions for creating a tab that spans an entire container. The top-level container is a tab container. Nested within it is a table container, and nested within that is a tab container, in which the tab spans the entire container.

ProcedureTo Stretch a Tab Across an Entire Container from the Command Line

  1. Edit the display profile and make the width of the Nested Tab Container full_top in the Table Container so that it stretches across the entire page.

  2. Load the display profile into LDAP by using the psadmin subcommand.

ProcedureTo Stretch a Tab Across an Entire Container from the Portal Server Management Console

  1. Log in to the Portal Server management console and select Portals and portalID.

  2. Select DeveloperSample [Org] from the Select DN drop down menu and select Manage Containers and Channels.

    Ensure that JSPTabContainer is selected.

  3. Click on New Channel or Container and create a new container by specifying the Container Provider (for example, JSPTableContainerProvider) and Name for the new container (for example, TestContainer).

  4. Select the container you just created (for example, TestContainer) and click New Channel or Container (in the container you just created).

  5. Create a new container by specifying the Container provider (for example, JSPTabContainerProvider, and Name for container (for example, TestTabContainer).

  6. Select the new tab container you just created (for example, TestTabContainer), specify the width property as full_top, and save the values.

  7. Create a new tab (for example, TestNewTab) for the tab container you just created (for example, TestTabContainer) by selecting New Tab.

Changing the Tab Image for JSP-based Tab Containers

You can customize the look of tabs as they use images.

ProcedureTo Change the Tab Image for JSP-based Tab Containers

  1. Log in to the Portal Server management console.

  2. Edit the display profile for the Developer Sample organization.

    To edit the display profile:

    1. Select Portals from the menu bar.

    2. Select a portal server and the desired organization or suborganization under Current Location.

    3. Click Manage Containers and Channels.

    4. Scroll to View Type and select DP XML tree.

  3. Select Global Themes and the theme you wish to modify in the DP XML Tree.

  4. Change the value of the tabNotchImage property to the new image name.

    By default, the value for this property is tabNotch.gif.

  5. Copy the new image into PortalServer-base/web-src/desktop/tabs/images directory.

  6. Run the PortalServer-base/bin/psadmin redeploy --adminuser amadmin --passwordfile passwordfile --portal portal-ID subcommand to deploy the new image.

  7. Reload the Desktop to verify the change.

Changing the Color of Tabs

The background color of tabs are part of the themes.

ProcedureTo Change the Color of Tabs

  1. Log in to the Portal Server administration console.

  2. Edit the display profile for the Developer Sample organization.

    To edit the display profile:

    1. Select Portals from the menu bar.

    2. Select a portal server and the desired organization or suborganization under Current Location.

    3. Click Manage Containers and Channels.

    4. Scroll to View Type and select DP XML tree.

  3. Select Global Themes and the theme you wish to modify in the DP XML Tree.

  4. Change the value of the titleBarColor property to change the color of the selected tab and/or change the value of tabColor property to change the color of an unselected tab.

    The selected tab background color is the same as the title bar color.

  5. Reload the Desktop to verify the change.

Making a Tab the Start Tab

The “Start tab” is the tab that is highlighted when user first logs in.

ProcedureTo make the tab the start tab

  1. Edit the display profile for the appropriate container.

  2. Change the startTab property to the tab to highlight when the user logs in. For example:


    <String name="startTab" value="MyFrontPageTabPanelContainer"/>
  3. Load the display profile into LDAP by using the psadmin command.

Adding a Channel to a User-defined Tab

Users can add a new tab to their Desktop by using the Tabs link and then by clicking the Make a New Tab link. The channel list that gets displayed on the content page which is shown when the user selects to create a new tab from scratch is picked up from the JSPTabCustomTableContainer’s Available list.