Sun Java System Portal Server 7.1 Developer Sample Guide

Chapter 7 Modifying the Desktop Layout

This chapter describes how to modify the channel arrangement in the Desktop. It contains the following sections:

Deriving More Desktop Layouts

The Desktop Layout page provides a way for users to set the arrangement of the channels by moving them up or down, and right or left. The Desktop Layout page also provides users with the option to set column layout, where they can arrange columns by channel width.

Channel widths are defined as thin, wide, full_top, and full_bottom. A thin channel takes less Desktop area than a wide channel. A full_top channel spans the entire Desktop width above all the other channels. A full_bottom channel spans the entire Desktop width below all other channels. The available layouts, which use different combinations of channel widths, are:

thin-wide

Two columns

wide-thin

Two columns

thin-wide-thin

Three columns

full_top

One column spans the width of the Desktop at the top of the page

full_bottom

One column spans the width of the Desktop at the bottom of the page

You can derive more Desktop layouts from the existing layouts by modifying display profile properties and the JSPs for the table container, when one of the contained channel’s width is specified as either full_top or full_bottom.

For example, you could come up with the following:


full_top-thin-wide/full_top-wide-thin/full_top-thin-wide-thin
thin-wide-full_bottom
fulltop-thin-wide-full_bottom

Note –

The fulltop-thin-wide-full_bottom layout is a combination of the first two with full_top at the top and full_bottom at the bottom.


To do so involves modifying the appropriate display profile. That is, to derive more desktop layouts, use the appropriate display profile for the desired layout. After making a change to the display profile, load the display profile into LDAP by using the psadmin subcommand.

To use a full_top-thin-wide/full_top-wide-thin/full_top-thin-wide-thin layout, modify a channel’s width in the display profile as follows:


<Channel name="Search" provider="SearchProvider">
	<Properties>
		<String name="title" value="Search"/>
		<String name="description" value="This is a search provider example" />
		<String name="searchServer" value=""/>
		<String name=”width” value=”full_top”/>
	</Properties>
</Channel>

To use a thin-wide-full_bottom layout, modify a channel’s width in the display profile as follows:


<Channel name="Search" provider="SearchProvider">
	<Properties>
		<String name="title" value="Search"/>
		<String name="description" value="This is a search provider example" />  
		<String name="searchServer" value=""/>
		<String name="width" value="full_bottom"/>
	</Properties>
</Channel>

To use a full_top-thin-wide-full_bottom layout, modify the width of one of the channels as full_bottom and one of the other channels as full_top in the display profile.

Changing Content Layout to Support Categorizing the Available and Selected Lists

For sites with a great number of channels, and a need to categorize and sub-categorize these into a hierarchical kind of structure, to make channel selection easier to navigate, and channels easier to find, customization options include:

Customizing Existing JSPs

You can customize contentedit.jsp, which generates the Content page, and contentdoedit.jsp, which processes the page. The Content page uses categories to group channels into different sections. If you want this page to look different, for example, to use a pull-down menu instead of showing all the channels for one category, to save on page space, you can customize the two JSPs mentioned. (The main reason for a JSP-based content and layout channels is to support ease of customization.)

Writing a New Content Channel

You can write a new content channel by extending JSPSingleContainerProvider to support your site’s needs. You would then only need to modify the Content link in table.jsp under JSPTableContainerProvider to point to this new content channel. You can also create your own JSP to do whatever specific implementation you need, and change the link from table.jsp to new.jsp.

Adding New Layouts

The following example is intended to show some of the customization possibilities for the Desktop. Details are not provided. See the Sun Java System Portal Server 7.1 Developer’s Guide for more information on how to add new layouts.

In this scenario, the Desktop has three rows. The first row contains one full-width channel; the second row contains 2 channels, a thin plus a thick channel; and the third row contains 3 thin channels of equal width.

To create such a Desktop requires a custom container channel, created from the JSPs for the table container (JSPTableContainer).

To enable the Layout link to work with this container, you need a new layout channel with a customized JSP for editing and processing the Edit page. You build this by starting from the layoutedit.jsp and layoutdoedit.jsp files.

You also need to create a new custom table container provider by extending JSPTableContainerProvider.

Changing the Desktop Column Layout

ProcedureTo Change the Desktop Column Layout from the Command Line

  1. Modify the width property to change the layout of the channel column. Specify one of the following:

    thin

    The channel appears in one of the thin columns.

    thick

    The channel appears at the top spanning the entire horizontal space.

    full_top

    The channel appears at the top spanning the entire horizontal space.

    full_bottom

    The channel appears at the bottom spanning the entire horizontal space.

    For example, the following specifies that a channel appears at the top spanning the entire horizontal space:


    <String name="width" value="full_top”/>
  2. Load the display profile into LDAP by using the psadmin subcommand.

    See Editing the Display Profile and Sun Java System Portal Server 7.1 Command Line Reference.