Sun Java logo     Previous      Contents      Index      Next     

Sun logo
Sun Java System Portal Server 6 2004Q2 Desktop Customization Guide 

Chapter 10
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:

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:

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 dpadmin command.

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 Portal Server 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

    To 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 in one of the wide columns.
    • 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.
  1. Load the display profile into LDAP by using the dpadmin command
  2. See Editing the Display Profile.

    To Change the Desktop Column Layout from the Administration Console
  1. Log in to the Identity Server software administration console as administrator.
  2. Navigate to User Management by choosing View User Management.
  3. Select the appropriate organization or suborganization.
  4. Choose Services from the Show menu.
  5. Select the properties arrow next to Desktop in the navigation pane.
  6. The Desktop attributes appear in the data pane.

  7. Click Channel and Container Management.
  8. The Channels page appears, with the container path set at the root. The defined channels appear in a list.

  9. Select the Edit link beside the channel to be modified.
  10. The Properties page appears.

  11. Modify the width property.
  12. The possible values are thin, thick, full_top, and full_bottom.

  13. Click Save.
    To Modify Column Widths Directly (Using Scriptlets)

To modify the column widths directly, you can add the following code to the JSPTableContainerProvider/toptable.jsp file.

<%@ page import="com.sun.portal.search.providers.util.Layout"%>

<%

    JSPTableContainerProvider tcp = (JSPTableContainerProvider)pageContext.getAttribute("JSPProvider");

    int layout = tcp.getLayout();

    int centerWidth = -1;

    int rightWidth = -1;

    int leftWidth = -1;

    switch (layout) {

        case Layout.LAYOUT_THIN_THICK:

            leftWidth = 40;

            rightWidth = 60;

            break;

        case Layout.LAYOUT_THICK_THIN:

            rightWidth = 40;

            leftWidth = 60;

            break;

        case Layout.LAYOUT_THIN_THICK_THIN:

            rightWidth = 30;

            centerWidth= 40;

            leftWidth = 30;

            break;

        default:

            rightWidth = 40;

            leftWidth = 60;

            break;

    }

%>

and then replace the widths

<!-- BEGIN LEFT CHANNELS -->

<TD WIDTH="<%=leftWidth%>" VALIGN=TOP>

<!-- BEGIN CENTER CHANNELS -->

<TD WIDTH="<%=centerWidth%" VALIGN=TOP>

<!-- BEGIN RIGHT CHANNELS -->

<TD WIDTH="<%=rightWidth%>" VALIGN=TOP>



Previous      Contents      Index      Next     


Copyright 2004 Sun Microsystems, Inc. All rights reserved.