Sun Java System Portal Server 6 2004Q2 Desktop Customization Guide |
Chapter 6
Customizing ChannelsThis chapter describes how to customize channels. This chapter contains the following sections:
See the Portal Server Administration Guide for instructions on adding a channel to the Desktop.
Customizing Channel Refresh Times and Container CachingThe 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:
- It is not possible to refresh only the content of the single channel within a container because a channel is an HTML table cell.
- It is possible to use the DesktopURL() method in the PAPI. The provider can use getDesktopURL() to get the Desktop servlet’s URL, append arguments to it, and generate a new URL (or link).
The following applies to controlling and configuring container caching:
- Use the refreshTime property for the container along with the refreshTime for individual channels within the container.
- If the refreshTime for the container is blank, it is calculated to be the minimum time for all of the contained channels. If you want to override that calculated time, set a refreshTime for the container and then the content for the whole container will be cached.
Customizing Window PreferenceFor channels that include links that launch another browser, you can control how this browser window is opened.
To Customize the Channel Window Preference
- Load the display profile into LDAP by using the dpadmin command.
See Editing the Display Profile.
Removing a ButtonTo Remove a Button From All Channels in a Container
- 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. See Chapter 4, "Internally Used Containers."
- Add the appropriate property (within the <Properties> </Properties>) tags from Table 6-1 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.
To Remove a Button From a Single Channel
- 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 Table 6-2, 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.
- 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.
- Load the display profile into LDAP by using the dpadmin command.
Changing the Channel Layout for a Table ContainerTo Change the Channel Layout for a Table Container
Removing the Title Bar from a ChannelTo Remove the Title Bar from a Channel
Changing the Channel Border WidthTo Change the Border Width for all Channels in a Container
- Change directories to the appropriate table container (JSPFrameCustomTableContainerProvider, JSPTabCustomTableContainerProvider, or JSPTableContainerProvider) for which you want to change the border width.
For example:
cd /etc/opt/SUNWps/desktop/default/JSPTableContainerProvider
- Edit the leafWrapper.jsp file.
Change the cellpadding to not use the borderWidth property from theme. The line to change is:
For example, you might use CELLPADDING=2 in place of this line.
- Run the touch command on the tablecolumn.jsp file, which includes leafWrapper.jsp.
touch tablecolumn.jsp
Note
You can also change the borderWidth property for the GlobalThemes Collection. This changes the width of the channel borders for a theme. Users can then select the theme from the Themes page. (This method removes the need to change JSPs.) After making the change to the display profile, which in the sample portal is dp-org.xml, you need to upload it to LDAP.
Customizing the Channel BorderTo Customize Channel Borders to Have Bevelled Edges, Shadows, Curved Corners, and So On
- Change directories to the appropriate table container (JSPFrameCustomTableContainerProvider, JSPTabCustomTableContainerProvider, or JSPTableContainerProvider) for which you want to customize the border width.
For example:
cd /etc/opt/SUNWps/desktop/default/JSPTableContainerProvider
- Edit leafWrapper.jsp.
Change the appropriate HTML. You change border width and color by modifying the following lines:
CELLPADDING=<dttheme:getAttribute name="borderWidth"/>
BGCOLOR="<dttheme:getAttribute name="borderColor"/>"
To add curved borders, shadows, and so on, you use a combination of image maps and tables. While possible, such an example is beyond the scope of this document.
- Run the touch command on the tablecolumn.jsp file, which includes leafWrapper.jsp.
touch tablecolumn.jsp