Sun Java System Portal Server 7 Developer Sample Guide

Chapter 5 Customizing Channels

This chapter describes how to customize channels. This chapter contains the following sections:

Customizing Channel Refresh Times and Container Caching

The refreshTime property controls how often a channel’s content is reloaded. When refreshTime is set to 0 (the default) for the container, the browser refresh (or reload) causes the page to be reloaded and the getContent() method is called again for every channel.

The following applies to a single channel:

The following applies to controlling and configuring container caching:


Note –

If you have a large number of channels, utilize the provider caching by setting the refreshTime to a large number so that the portal page can use cached content. This makes sense when most of your channels have static content. The way the refreshTime works is if the container’s refreshTime is set, it will use it. If refreshTime is set to an empty string, it will try to get and use the minimum of the refreshTime of its selected channels.


Customizing Window Preference

For channels that include links that launch another browser, you can control how this browser window is opened.

ProcedureTo Customize the Channel Window Preference

Steps
  1. Define the display profile (either for the channel, to make the change for only that channel, or for the provider, to make the change for every channel that uses the provider) so that it includes the windowPref property.

    For example:


    <Properties>
    	...
    	<String name="windowPref" value="all_new"/>
    	...
    </Properties>

    The values are:

    • all_new (New window is opened for every link)

    • one_new (All links open on the same new window)

    • same (Desktop window)

  2. Load the display profile into LDAP by using the psadmin subcommand or via the Portal Server management console.


    Note –

    The intelligence has to be built with the help of JavaScript for that particular channel.


Removing a Button

ProcedureTo Remove a Button From All Channels in a Container

Steps
  1. Find the container you want to work with. If you are working with one of the sample portals, you need to modify the appropriate “contained” container, which is part of the top-level container.

  2. Add the appropriate property (within the <Properties></Properties>) tags from Removing a Button to the container’s display profile for the button you want to remove. This two column table lists the button in the first column and the property to hide the button in the second column.

    The order of the buttons in this table corresponds to the order they appear in the channel, from left to right: Minimize, Maximize, Help, Edit, Detach, and Remove.

    Button 

    Property to Hide the Button  

    Minimize 

    <Boolean name="defaultChannelIsMinimizable" value="false"/>

    Maximize 

    <Boolean name="defaultChannelIsMaximizable" value="false"/>

    Help 

    <String name="helpURL" value=""/>

    Edit 

    <Boolean name="isEditable" value="false"/>

    Detach 

    <Boolean name="defaultChannelIsDetachable" value="false"/>

    Remove 

    <Boolean name="defaultChannelIsRemovable" value="false"/>


    Note –

    For the Help and Edit buttons, You must insert the respective property for each channel. You cannot insert the property within the container’s <Properties></Properties> tags.


    Make sure the following properties are not defined in the container:


    <Collection name="channelsIsRemovable">..</Collection>
    <Collection name="channelsIsMinimizable"/>..</Collection>
    <Collection name="channelsIsMaximizable"/>..</Collection>
    <Collection name="channelsIsDetachable"/>..</Collection>
  3. Load the display profile into LDAP by using the psadmin subcommand or via the Portal Server management console.

ProcedureTo Remove a Button From a Single Channel

Steps
  1. For the channel from which you want to remove a button, add the appropriate property to a Collection tag in the container that contains the channel. See Removing a Button, for the button you want to remove. This two column table lists the button in the first column and the property to hide the button in the second column

    The order of the buttons in this table corresponds to the order they appear in the channel, from left to right: Minimize, Maximize, Help, Edit, Detach, and Remove.

    Button 

    Property to Hide the Button  

    Minimize 

    <Collection name="channelsIsMinimizable">

    <Boolean name="channelname" value="false"/>

    </Collection>

    Maximize 

    <Collection name="channelsIsMaximizable">

    <Boolean name="channelname" value="false"/>

    </Collection>

    Detach 

    <Collection name="channelsIsDetachable">

    <Boolean name="channelname" value="false"/>

    </Collection>

    Remove 

    <Collection name="channelsIsRemovable">

    <Boolean name="channelname" value="false"/>

    </Collection>

  2. For the channel in which you want to remove a button, add the appropriate property to a Collection tag in the controlling container.

    For example, use the following XML to hide the Remove button for the Sample JSP channel in the JSP table container, MyFrontPageTabPanelContainer, whose container is JSPTabContainer.


    <Container name="MyFrontPageFramePanelContainer" provider="JSPTableContainerProvider">
    	<Properties>
    		...
    		<Collection name="channelsIsRemovable">
    		<Boolean name="SampleJSP” value="false”/>
    		</Collection>
    	</Properties>
    	...
  3. Load the display profile into LDAP by using the psadmin subcommand or via the Portal Server management console.

Changing the Channel Layout for a Table Container

ProcedureTo Change the Channel Layout for a Table Container

Steps
  1. You can change the layout for a particular table container by modifying (or adding) the following property in the table container’s display profile:


    <Integer name="layout" value="value"/>

    where value is:

    1 = Thin-wide, two columns

    2 = Wide-thin, two columns

    3 = Thin-wide-thin, three columns

  2. Reload the display profile to LDAP by running the psadmin with the modify-display-profile sub-command, loading it at the top-most node in the directory by using the -g option.

    See the Sun Java System Portal Server 7 Command-Line Reference for more information on the psadmin subcommand.

Removing the Title Bar from a Channel

ProcedureTo Remove the Title Bar from a Channel

Steps
  1. Add the following to the table container display profile in which the channel is present.


    <Collection name="channelsHasFrame">
    <Boolean name="channelname" value="false"/>
    </Collection>
  2. Load the display profile into LDAP by using the psadmin subcommand or via the Portal Server management console.

Changing the Channel Border Width and/or Color

You can change the borderWidth property and borderColor property for the GlobalThemes collection. This changes the width and the color of the channel borders respectively for a theme. Users can then select the theme from the Themes page.

ProcedureTo Change the Border Width and Color for all Channels in a Container

Steps
  1. Log in to the Portal Server management console and select Portals, portal-ID, Developer Sample (from the Select DN pull-down menu), and Manage Channels and Containers.

  2. Select DP XML Tree in the View drop-down menu.

  3. Select DP_Root, GlobalThemes, and SunTheme.

  4. Modify the borderWidth and borderColor settings and save.