Sun ONE Portal Server 6.2 Desktop Customization Guide |
Chapter 7
Customizing the Desktop InterfaceThis chapter provides common customization tasks for modifying the look and feel of the Desktop.
This chapter contains the following sections:
Desktop Customization OverviewThis section provides general overview information on customizing the Desktop interface. It includes the following sections:
What Are the Areas for Customizing the Desktop?
In general, the Sun ONE Portal Server software documentation divides Desktop interface customization into three areas:
- Authentication screens - You can modify the look and feel of the HTML authentication templates, including images, HTML structure, and color.
- Desktop - You can modify the look and feel of the Desktop, customize the top container used by the organization, control Desktop themes, and so on. This chapter describes the Desktop customization tasks.
Files for dynamic content for providers, channels, and containers are located under the /etc/opt/SUNWps/desktop directory; that is, the Base Desktop templates are in /etc/opt/SUNWps/desktop/default and sample portal templates are in /etc/opt/SUNWps/desktop/sampleportal directory. For more information on these directories, see "What Is the Sample Portal?" in Chapter 1, "Introduction to Customizing the Desktop."
Some other static resources are located in the WebContainer/portal directory. This includes images used on the Desktop, such as channel control buttons, and style sheets.
- Search channel - You can modify the default Search server and add or remove fields from the Advanced search interface. See Chapter 8, "Customizing the Service Providers" for more information.
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:
- 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 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.
Contained Containers
Often, when working with the sample portal, you need to modify the appropriate “contained” container, which is part of the top-level container. The contained containers are:
- MyFrontPageFramePanelContainer (parent = FrameTabContainer)
- MyFrontPageTabPanelContainer (parent = JSPTabContainer)
- MyFrontPageTemplatePanelContainer (parent = TemplateTabContainer)
- SamplesFramePanelContainer (parent=FrameTabContainer)
- SamplesTabPanelContainer (parent = JSPTabContainer)
- SearchTabPanelContainer (parent = JSPTabContainer)
The following containers are used as PredefinedTabs and listed as PredefinedTabs on the makeNewTab page so that users can create new tabs based on these Tabs. These are not, by default, directly used for display on the sample portal.
Guidelines for Using the dpadmin Command
Use the following guidelines when running the dpadmin command to update the display profile:
- Make sure no other administrator is currently using the Sun ONE Identity Server software administration console or dpadmin command to make display profile modifications. Such a situation could cause changes to be lost, if you are running dpadmin modify, as there is no locking mechanism to prevent dpadmin and the administration console from accessing the display profile at the same time.
- The preferred sequence when using dpadmin is to put your modifications into a file as an XML “fragment” then run the dpadmin command with the add subcommand. For example,
See the Sun ONE Portal Server 6.2 Administrator’s Guide for more information on the dpadmin command.
Adding Containers and Channels to the DesktopSun ONE Portal Server software uses channels to generate content for the Desktop. Generally, content is created by using JSP or template files. Configure channels by manipulating display profile properties that affect the content and layout of the channel on the Desktop. When you customize the value of properties that a channel receives, you customize that channel. (If you customize the value of properties for a provider, then all channels in the Desktop that use this provider are customized.)
Channels that contain other channels are called containers. Containers arrange channel content on the Desktop.
There are two methods you can use to add containers and channels to the Desktop:
The Sun ONE Portal Server software documentation considers adding containers and channels to be administrative tasks, hence, both of these methods are described in the Sun ONE Portal Server 6.2 Administrator’s Guide.
Customizing Container TabsThis section provides a variety of tasks to customize the container tabs.
To Add a Tab to JSPTabContainer
A tab can be any container type but 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.
- Create the necessary display profile.
- Define the new collection within <Collection name="TabProperties"> in JSPTabContainer, for example:
- Add entries to the <Available> and <Selected> tags, for example:
...
<Available>
<Reference value="NewTabPanelContainer"/>
...
</Available>
...
<Selected>
<Reference value="NewTabPanelContainer"/>
...
</Selected>
...
- 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>
- If predefined property value is true in the TabProperties collection (see Step a), then it is recommended to define a Provider for the container channel which is meant to be used as a predefined tab.
For example:
Code Example 7-1 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 ONE 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>
- 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:
Code Example 7-2 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>
- Load the display profile into LDAP by using the dpadmin command.
See "Guidelines for Using the dpadmin Command".
- Bring up the Desktop and verify that the tab was added.
Creating a Tab Within a Tab
This is similar to "To Add a Tab to JSPTabContainer", except that instead of defining the tab based on JSPTableContainerProvider, you base the new tab on JSPTabContainerProvider.
To Stretch a Tab Across an Entire Container
Figure 7-1 shows an example of a tab that spans an entire container. In this figure, the top-level container is a template 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.
Figure 7-1 Tab Spanning Entire Container
To Change the Tab Image for JSP-based Tab Containers
You can customize the look of tabs as they use images.
- Log in to the Sun ONE Identity Server administration console.
- Select Services from your Organization View pull-down menu and select Portal Desktop.
- Select Edit XML to directly edit the display profile XML fragment. Or,
- Change the value of the tabNotchImage property to the new image name.
By default, the value for this property is tabNotchImage.
- Copy the new image into portal-server-install-root/SUNWps/web-src/desktop/tabs/images directory.
- Run the portal-server-install-root/SUNWps/bin/deploy redeploy -deploy_admin_password password command to deploy the new image.
- Reload the Desktop to verify the change.
To Change the Color of Tabs
The background color of tabs are part of the themes.
- Log in to the Sun ONE Identity Server administration console.
- Select Services from your Organization View pull-down menu and select Portal Desktop.
- Select Edit XML to directly edit the display profile XML fragment. Or,
- 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.
- Reload the Desktop to verify the change.
To Make a Tab the Start Tab
The “Start tab” is the tab that is highlighted when user first logs in.
Setting a Role Tab
When you have a display profile that provides a set of JSP nested tabs, and you want a user who belongs to this role and another role to add an additional sub-tab, you can merge multiple display profiles to accomplish this. In the additional display profile, you specify the additional sub-tab in the like-named container for JSPTabContainer with merge=fuse and JSPTableContainer for the new tab.
To Add a Role-based Tab
- To add a role-based tab for a user, define a role level display profile, which has the JSPTabContainer definition.
- Add the role-based tab to the available and selected list with merge=fuse in the channel definition for the table container.
When the user is added to this role, the new tab is visible. The following display profile XML fragments show the role definitions.
role1
<Container name="JSPTableContainer" provider="JSPTableContainerProvider" merge="fuse">
<Properties> ... </Properties>
<Available> ... </Available>
<Selected merge="fuse">
<Reference value="Outages"/>
<Reference value="SolarisAdmin"/>
<Reference value="AdminTipoftheDay"/>
</Selected>
</Container>
role2
<Container name="Front" provider="front" merge="fuse">
<Properties> ... </Properties>
<Available> ... </Available>
<Selected merge="fuse">
<Reference value="Benefits"/>
<Reference value="EmployeeNews"/>
</Selected>
</Container>
The user belonging to both role1 and role2 receives the following display profile:
Container name="JSPTableContainer" provider="JSPTableContainerProvider" merge="fuse">
<Properties> ... </Properties>
<Available> ... </Available>
<Selected merge="fuse">
<Reference value="Outages"/>
<Reference value="SolarisAdmin"/>
<Reference value="AdminTipoftheDay"/>
<Reference value="Benefits"/>
<Reference value="EmployeeNews"/>
</Selected>
</Container>
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.
Customizing ChannelsThis section describes how customize channels. See the Sun ONE Portal Server 6.2 Administrator’s Guide for instructions on adding a channel to the Desktop.
To Customize Window Preference
For channels that include links that launch another browser, you can control how this browser window is opened.
- Load the display profile into LDAP by using the dpadmin command.
See "Guidelines for Using the dpadmin Command".
To 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 "Contained Containers".
- Add the appropriate property (within the <Properties> </Properties>) tags of the container’s display profile you selected in Step 1 from Table 7-1, 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.
Table 7-1 Channel Buttons and Corresponding Properties
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"/>
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 7-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.
Table 7-2 Channel Buttons and Corresponding Properties
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>
Note
See Table 7-1 for information on the Help and Edit buttons.
- 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>
...
- Load the display profile into LDAP by using the dpadmin command.
To Disable the User from Editing Instant Messaging Server Information
When a site has only a single Instant Messaging server, there is no need for the end-users to be able to edit the server information in the channel edit page. The server information can be removed by editing the IMEdit.jsp file so that part of the page is not displayed.
Code Example 7-3 contains the Instant Messaging Server Information (snippet) in the IMEdit.jsp file.
Code Example 7-3 Instant Messaging Server Information in IMEdit.jsp File
...
<%-- ------------------- Instant Messaging Server Information --------------%>
<tr>
<td width="100%" bgcolor="#333366" colspan="3">
<font size="+1" face="<%=fontFace%>" color="#ffffff"><b>Instant Messaging Server Information</b></font>
</td>
</tr>
<tr>
<td colspan="2" width="70%"></td>
<td valign="top" rowspan="5">
<table border="0" cellpadding="2" cellspacing="1" width="100%" bgcolor="#eeeeee">
<tbody>
<tr>
<td valign="top" bgcolor="#dcdcdc" height="15"
<font face="<%=fontFace%>"><b>Why?</b></font>
</td>
</tr>
<tr>
<td valign="top">
<font face="<%=fontFace%>" size="-1">In order to access a Sun ONE Instant Messaging server, you must enter the information needed to contact the server.</font>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000"><label for="commonname">
<b>Server:</b>
</label></font><br></td>
<td valign="middle">
<input type="text" name="server" size="25" maxlength="40" value="<dtpc:getStringProperty key="server"/>">
</td>
</tr>
<tr>
<td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000"><label for="commonname">
<b>Server Port:</b>
</label></font><br></td>
<td valign="middle">
<input type="text" name="port" size="25" maxlength="40" value="<dtpc:getStringProperty key="port"/>">
</td>
</tr>
<tr>
<td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000"><label for="commonname">
<b>Multiplexor:</b>
</label></font><br></td>
<td valign="middle">
<input type="text" name="mux" size="25" maxlength="40" value="<dtpc:getStringProperty key="mux"/>">
</td>
</tr>
<tr>
<td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000"><label for="commonname">
<b>Multiplexor Port:</b>
</label></font><br></td>
<td valign="middle">
<input type="text" name="muxport" size="25" maxlength="40" value="<dtpc:getStringProperty key="muxport"/>">
</td>
</tr>
<dtpc:getStringProperty id="authMethod" key="authMethod"/>
<jx:if test="$authMethod == ’ldap’">
<tr>
<td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000"><label for="commonname">
<b>Username:</b>
</label></font><br></td>
<td valign="middle">
<input type="text" name="username" size="25" maxlength="40" value="<dtpc:getStringProperty key="username"/>">
</td>
</tr>
<tr>
<td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000"><label for="commonname">
<b>Password:</b>
</label></font><br></td>
<td valign="middle">
<input type="password" name="password" size="25" maxlength="40" value="<%= JSPProvider.getDummyPassword() %>">
</td>
</tr>
</jx:if>
...
The change to this file depends on the type of authentication that is being used for the channel. With Sun ONE Identity Server software authentication (authMethod=idsvr), the entire Instant Messaging Server Information section can be removed. With LDAP authentication (authMethod=ldap), the username and password fields are still necessary. So, remove only the server and port fields and keep the rest of the Instant Messaging Server Information section.
To Automatically Close the Instant Messaging Invite Window
The invite.jsp file generates the content for the popup window that is created when a user is invited to a conference in an instant messaging client that is already running. It is necessary to open this window (the window is opened before the server checks if the instant messaging client is running), but the window can be closed automatically. The invite.jsp file has the Javascript code for doing this commented out (see Code Example 7-4). Merely uncomment this Javascript code (shown in Code Example 7-4 in bold) to cause the window to close automatically.
Code Example 7-4 Instant Messaing invite.jsp File
<%@ taglib uri="/tld/jx.tld" prefix="jx" %>
<%@ taglib uri="/tld/im.tld" prefix="im" %>
<%@ taglib uri="/tld/desktop.tld" prefix="dt" %>
<%@ taglib uri="/tld/desktopProviderContext.tld" prefix="dtpc" %>
<dt:obtainChannel channel="$JSPProvider">
<html>
<head>
<title>Sun ONE Instant Messenger</title>
</head>
<body bgcolor="#ffffff">
<p>
User <%= request.getParameter("username") %> is being invited to join a conference using the IM client that you already have running.
<p>
<center>
<form>
<input type=button value="Ok" onClick="window.close();">
</form>
</center>
<%-- uncomment this script if you want the window to close automatically
<script>window.close();</script>
--%>
To Customize Display of Instant Messaging Contacts
By default, the IMContent.jsp file only displays presence information for on-line contacts. There is code in the JSP file for displaying presence information for all contacts in the selected contact group(s). If you wish to display all of this information, uncomment the code (shown in Code Example 7-5) in IMContent.jsp file.
Code Example 7-5 Instant Messaging Offline Contact Information in IMContent.jsp File
...
<%--Offline States - Uncomment this if you want users to see offline contacts -
<jx:when test="$p==’CLOSED’">
<jx:expr value="$anchortag"/>
<img src="im/images/Offline_13Padded.gif" alt="Offline - Click to chat" border=0 align=absmiddle></a>
<im:getContactName/></br>
</jx:when>
<jx:when test="$p==’AWAY’">
<jx:expr value="$anchortag"/>
<img src="im/images/Away_13Padded.gif" alt="Away - Click to chat" border=0 align=absmiddle></a>
<im:getContactName/></br>
</jx:when>
<jx:when test="$p==’FORWARDED’">
<jx:expr value="$anchortag"/>
<img src="im/images/Forwarded_13Padded.gif" alt="Offline - Click to chat" border=0 align=absmiddle></a>
<im:getContactName/></br>
</jx:when>
<jx:when test="$p==’OTHER’">
<jx:expr value="$anchortag"/>
<img src="im/images/Offline_13Padded.gif" alt="Other - Click to chat" border=0 align=absmiddle></a>
<im:getContactName/></br>
</jx:when>
<jx:otherwise>
<jx:expr value="$anchortag"/>
<img src="im/images/Offline_13Padded.gif" alt="<%=p%> - Click to chat" border=0 align=absmiddle></a>
<im:getContactName/></br>
</jx:otherwise>
-- End of offline states --%>
Creating Customized Organization JSP and Template FilesIf desired, rather than customizing the sample portal JSP and template files directly, you can create a separate directory for your organization’s customized files, and perform customizations on those files. This preserves the initially installed portal JSP and template files.
To Create Customized Organization JSP and Template Files
- Change directories to the Desktop JSP/template directory.
For example,
cd /etc/opt/SUNWps/desktop
- Create a new directory for your organization’s JSPs and templates.
For example,
mkdir sesta
- Copy the JSPs and templates that you wish to modify into the new directlry location, maintaining the same directory structure.
For example, if your new Desktop type will modify /etc/opt/SUNWps/desktop/default/JSPProvider/content.jsp, copy this file to /etc/opt/SUNWps/desktop/sesta/JSPProvider/content.jsp, and customize the file for the new Desktop type in that location.
- Customize the JSPs templates in the sesta directory as required.
See instructions in this chapter for the various types of customizations you can perform.
- Change the dynamic Desktop Type attribute in the Sun ONE Identity Server software administration console to use the newly created directory.
See "Changing the Desktop Type" for more information.
Customizing the Anonymous DesktopThis section describes customizations you can make for the anonymous Desktop. When you install the sample portal, a copy of the anonymous Desktop display profile is located in the portal-server-install-root/SUNWps/samples/desktop/dp-anon.xml file, with the support files located in the /etc/opt/SUNWps/desktop/anonymous directory.
Configuring Anonymous Authentication
Sun ONE Portal Server software supports two methods for implementing anonymous authentication:
When you install Sun ONE Portal Server software, by default the installation program enables anonymous authentication to the Desktop of the default organization using the Authentication-less User ID attributes. To implement this feature, the installation program creates a user account, authlessanonymous, and sets up access for this user within the following two Desktop Services global attributes:
This guide describes how to enable and disable both types of anonymous authentication. See the Administering Users And Services chapter in the Sun ONE Portal Server 6.2 Administrator’s Guide for more information on enabling and disabling anonymous authentication.
To Enable Anonymous Log In
- Log in to the Sun ONE Identity Server software administration console as administrator.
- Register the Anonymous service for the selected organization and create its template.
- Add Anonymous to the Authentication menu in the Core service (for the selected organization).
- Create the anonymous user account for the selected organization.
To Disable Anonymous Log In
- Log in to the Sun ONE Identity Server software administration console as administrator.
- Unregister the Anonymous service for the selected organization.
- Remove Anonymous from the Authentication menu in the Core service (for the selected organization).
- Remove the anonymous user account for the selected organization.
To Enable Authentication-less (authlessanoymous) Log In
- Log in to the Sun ONE Identity Server software administration console as administrator.
- Create the auhthlessanonymous account with a password of authlessanonymous for the selected organization.
- Select the Service Configuration tab.
- Click on the Desktop node.
The Desktop attributes page appears in the data pane.
- Add the following value to the Authorized Authentication-less user IDs attribute:
Substitute the appropriate organization name for organization.
- Set the Default Authentication-less user ID attribute to the following:
Substitute the appropriate organization name for organization.
- Log out from the Sun ONE Identity Server software administration console.
- Verify that authentication-less authentication works. That is, close all current browsers and start a new browser with the following URL:
http://hostname:port/portal/dt
The anonymous Desktop will be displayed.
To Disable Authentication-less (authlessanoymous) Log In
By default, the sample portal is registered for Authentication-less (authlessanonymous) authentication. This is different from Anonymous authentication, which the sample portal, by default, is not registered for. The Anonymous Desktop uses Sun ONE Portal Server software for authentication; the Authless Desktop does not pass through the authentication process at all and is handled internally in the Desktop servlet.
To disable authentication-less log in:
- Log in to the Sun ONE Identity Server software administration console as administrator.
- Select the Service Configuration tab.
- Click on the Desktop node.
The Desktop attributes page appears in the data pane.
- Remove the value(s) from the Authorized Authentication-less user IDs attribute.
- Remove the value from the Default Authentication-less user ID attribute so that it is blank.
- Log out from the Sun ONE Identity Server software administration console.
- Verify that you cannot reach the Anonymous Desktop. That is, close all current browsers and start a new browser with the following URL:
http://hostname:port/portal/dt
The Anonymous Desktop should not appear. Instead, the Login page, presenting the various authentication modules you have configured, should appear.
To Access the Anonymous Desktop Through the Identity Server Host Name (obj.conf File)
To enable users to access the Anonymous Desktop without typing the fully qualified domain name, you need to modify the Web-Container-Instance/config/obj.conf file.
- Edit the web server’s obj.conf file.
- After the line Object name=default, which is at the top, add the following lines, depending on whether you want authentication-less (authless anonymous) or anonymous access.
For authentication-less (authlessanonymous):
NameTrans fn="redirect" from="/index.html" url="http://hostname:port/portal/dt?desktop.suid=uid=authlessanonymous,ou=Peop le,dc=organization"
For anonymous:
NameTrans fn="redirect" from="/index.html" url=http://hostname:port/amserver/login?org=organization&module=Anonymous
For a specific organization:
Make sure psservername is the fully qualified domain name of your Sun ONE Portal Server software host, and organization is the name of the appropriate Sun ONE Identity Server software organization.
Note
For anonymous, you must also make sure that only Anonymous authentication is enabled in the Sun ONE Identity Server software administration console.
- Save the file and restart Sun ONE Portal Server software.
/etc/init.d/amserver start
Users can now view the Anonymous Desktop by typing the Sun ONE Portal Server software host name in their browser. The fully qualified domain name is no longer required.
To Access the Anonymous Desktop Through the Portal Server Host Name (index.html File)
To access the Desktop login page using a URL in the following form http://psservername, add some JavaScript to the web server’s index.html file.
- Add the following Javascript to the index.html file.
<HTML>
<HEAD>
<SCRIPT>
document.location.href="/portal/dt?psdt.suid=uid=authlessanonym ous,ou=People,dc=organization,dc=com" <-- for authless anonymous
</SCRIPT>
</HEAD>
</HTML>
This example assumes that /portal/dt is the user’s redirect URL.
- Verify that you can now access the Desktop by just typing the server name in the browser.
To Disable the Initial Sun ONE Identity Server Software Login Page and Always Use Anonymous Log In
- Log in to the Sun ONE Identity Server software administration console as administrator.
- Navigate to the default organization or sub-organization.
- Choose Services from the View menu.
- Click the Properties icon next to Core.
- For the Authentication Menu, make sure Anonymous is selected and deselect all other entries.
- Click Save.
- Create the anonymous user. With the desired organization selected, choose Users from the Show menu.
- Click New.
- Select the services for the anonymous user.
Typically, you select Desktop and NetMail.
- Type in the Create User screen with the following information.
- Click the create button to create the user.
- When users type the URL to access the portal server in a browser, the anonymous Desktop comes up, bypassing the Sun ONE Identity Server software login page. This Desktop will have the login channel, where users can log in if desired.
To Modify the Anonymous Banner and Menu Bar
To change the banner for the Anonymous Desktop, you need to modify the /etc/opt/SUNWps/desktop/anonymous/banner.template file. To modify the menu bar, you need to modify the /etc/opt/SUNWps/desktop/anonymous/menubar.template file.
- Edit the banner.template file.
- Make your modifications.
For example, you could change the following line to a background color or image of your choice:
<td bgcolor="#333366"><img src="[surl:/images/productName.gif]" width="274 " height="38" alt="Sun ONE Portal Server"></td>
Replace [surl:/images/productName.jpg] with a reference to an alternate image.
For example, if you use identity-server-install-root/SUNWam/public_html/images/newimage.gif, then use /images/newimage.gif as your replacement text. The [surl:] tag references image files from the Sun ONE Portal Server software web application archive. Your own custom images need to be placed elsewhere, so the [surl:] tag is not used.
- Place your file in the appropriate directory.
You can place your custom image files under the web server document root or you can deploy them in a custom web application archive. See the web server documentation for information on how to deploy a web application archive.
You could also make a new banner.template file to replace the default one.
- Modify the menubar.template file. You could also make a new menubar.template file to replace the default one.
To Add the Login Channel to the Anonymous Desktop of a Newly Created Organization
The default organization in the sample portal is configured with the login channel on the Anonymous Desktop. This enables new users who do not already have a membership user account to sign up for a membership user account. The login channel is also the only way a user can log in when anonymous is the sole authentication module selected.
As you add new organizations, you might want to set up the login channel on the Anonymous Desktop of the new organization.
To add the login channel to the Anonymous Desktop of a newly created organization:
- Use the Sun ONE Identity Server software administration console to create the new organization (this example uses company22.com as the initial organization and sesta.com as the new one), register the appropriate services (Core, Membership, LDAP, Desktop, NetMail, User, and so on), create the service templates, and assign policies to execute Desktop and NetMail.
See the Sun ONE Portal Server 6.2 Administrator’s Guide for details.
Tip
Make sure that the Desktop policy contains the rule to execute the Desktop, and that in the Core service you add Membership to the Authentication Menu.
- In the Sun ONE Identity Server software administration console, choose Organizations from the View menu in the Identity Management tab.
- Navigate to the newly created organization.
- Create a user account for the authless session.
- Choose Users from the View menu then click New.
- Select Desktop and NetMail for services then click Next.
The Create User page opens in the data pane.
- Type values for the required fields. This example uses authlessanonymous as the user ID and authlessanonymous as the password.
- When done click Create.
The authlessanonymous user ID appears in the list of users.
- Add the authlessanonymous user ID to the list of authorized users for the global Desktop service.
- Load the display profile for the organization by using the dpadmin command.
This example uses the dp-org.xml file as the display profile for the new organization, sesta.com.
/opt/SUNWps/bin/dpadmin add -u "uid=amAdmin,ou=People,dc=sesta,dc=com" -w password -d "dc=sesta,dc=com" /opt/SUNWps/samples/desktop/dp-org.xml
- Copy the sample anonymous display profile, dp-anon.xml, to a new file.
For example,
You do not want to modify the sample dp-anon.xml file, as you may want to have it as a backup in case need it for reloading that for your default organization.
- Edit the dp-anon-sesta.xml display profile file to change every instance of the Login channel to LoginSesta.
The lines of the dp-anon-sesta.xml display profile to be changed look like this:
<Reference value="Login"/>
...
<String name="Login" value="1"/>
...
<String value="Login"/>
...
<Boolean name="Login" value="false"/>
...
<Channel name="Login" provider="LoginProvider">
- Load the anonymous display profile for the authless user ID by using the dpadmin command.
/opt/SUNWps/bin/dpadmin add -u "uid=amAdmin,ou=People,dc=sesta,dc=com" -w password -d "uid=authlessanonymous,ou=People,dc=sesta,dc=com" dp-anon-sesta.xml
- Create the channel templates for the new login channel.
- Change directories to the /etc/opt/SUNWps/desktop/desktoptype directory.
cd /etc/opt/SUNWps/desktop/desktoptype
- Copy the Login directory contents to a new directory, LoginSesta.
cp -r Login LoginSesta
- Change directories to the LoginSesta directory.
cd /etc/opt/SUNWps/desktop/desktoptype/LoginSesta
- Change the Form action value from /amserver/login to /amserver/login?org=sesta.com in all the display template files (display.html, display_AuthLDAP.html, and display_AuthUnix.html).
- Change the “Sign me up” URL from <A HREF=”/amserver/login?module...> to <A HREF=”amserver/login?org=sesta.com&module...> in all the display template files.
- Set the Desktop type for the authless user.
- In the Sun ONE Identity Server software administration console, select the newly created organization.
- Choose Users from the View menu.
- Click the Properties arrow icon next to the authlessanonymous user ID.
- Select Edit at the end of the Desktop line in the data pane.
- In the popup window, type anonymous in the Desktop Type field and select Customize in the drop-down menu next to the text field.
- Click Save.
- Access the authless anonymous Desktop for the new organization by typing the following URL:
Customizing AuthenticationSun ONE Portal Server supports a number of authentication schemes, including LDAP, anonymous, membership, UNIX, and more. See the Sun ONE Portal Server 6.1 Administrator’s Guide for information on configuring authentication, as well as users and roles.
To Use Unix Authentication with LoginProvider
- Change directories to the default/Login directory.
For example:
cd /etc/opt/SUNWps/desktop/default/Login
- Copy the display_UnixAuth.html file to display.html.
For example,
cp display_AuthUnix.html display.html
- Register and enable Unix authentication service for the organization.
See the Sun ONE Portal Server 6.2 Administrator’s Guide for details.
- Add Unix to the Non Interactive Modules in the Core service.
To Modify the Default Desktop (Container) for authlessanonymous User
To change the default channel name for authlessanonymous user from JSPTabContainer to another container, for example, JSPTableContainer, perform the following:
- Log in to the administration console and select Users View for your organization.
- Select authlessanonymous and Portal Desktop from the View pull-down menu for authlessanonymous users.
- Select the Edit link.
- Change the Default Channel Name and select Customize from the pull-down menu.
- Select Save.
- Validate the change to the Desktop.
Modifying the Desktop LayoutThis section describes how to modify the layout of channels and channel arrangement in the Desktop.
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.
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 Sun ONE Portal Server 6.2 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.
To Change the Desktop Column Layout (Command Line)
- 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.
For example, the following specifies that a channel appears at the top spanning the entire horizontal space:
<String name="width" value="full_top”/>
- Load the display profile into LDAP by using the dpadmin command
See "Guidelines for Using the dpadmin Command".
Note
In the sample portal display profile, many width properties are defined with the advanced=true attribute, which means these properties are not visible in the Sun ONE Identity Server software administration console. Thus, if you use the sample portal display profile, you cannot change these values in the admin console. You need to edit the file manually then load it into LDAP by using the dpadmin command.
To Change the Desktop Column Layout (Sun ONE Identity Server Software Administration Console)
- Log in to the Sun ONE Identity Server software administration console as administrator.
- Navigate to User Management by choosing View User Management.
- Select the appropriate organization or suborganization.
- Choose Services from the Show menu.
- Select the properties arrow next to Desktop in the navigation pane.
The Desktop attributes appear in the data pane.
- Click Channel and Container Management.
The Channels page appears, with the container path set at the root. The defined channels appear in a list.
- Select the Edit link beside the channel to be modified.
The Properties page appears.
- Modify the width property.
The possible values are thin, thick, full_top, and full_bottom.
- Click Save.
To Change the Channel Layout for a Table Container
To Remove the Title Bar from a Channel
To Change the Channel Border Width
This procedure changes 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 leafWrapper.jsp.
Change the cellpadding to not use the borderWidth 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.
To Customize the Channel Border
Use this procedure to 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
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>
Branding the DesktopThis section describes how to brand the Desktop with your site’s logo and name.
To Change the HTML Title (Title That Appears in the Browser)
The title is in the productName property in the display profile definition for all the providers and channels. Edit this property to change the HTML title.
To Change the Logo (Image) in the Banner Header
The logo image is defined in the themes in the display profile. The related theme properties are:
brandImage
The brand image on the left of the header.
brandImage2
The brand image in the center of the header; if there’s no need to have the second image, then use spacer.gif.
brandImageBgColor
The background color for the left image file.
brandImage2BgColor
The background color for the center image file.
brandImageWidth
The width of the left image file.
previewImage
The image that is displayed in the Theme/preset Themes page.
- Log in to the Sun ONE Identity Server administration console.
- Select Services from your Organization View pull-down menu and select Portal Desktop.
- Select Edit XML to directly edit the display profile XML fragment. Or,
- Modify the relevant theme properties.
- Copy the new image into portal-server-install-root/SUNWps/web-src/images directory.
- Run portal-server-install-root/SUNWps/bin/deploy redeploy -deploy_admin_password password command to deploy the new image.
The images will be deployed to the web_container_install_root/portal_web_application_install_root/images directory.
- Reload the Desktop to verify the change.
To Change the Header and Footer of the Theme, Content, and Layout Pages
Depending on the Desktop, the particular header and footer files for in the Theme, Content, and Layout pages are determined by the container that contains the Theme, Content, and Layout pages.
For example, when you access the Content page for JSPTabContainer, JSPContentContainer is the container that is used to include the header and footer files that the tab container is using. The contentedit.jsp file, located in the JSPContentContainer directory, uses logic, based on the container, to access the appropriate header and footer files.
To brand the header and footer of the Theme, Content, and Layout pages:
- Use the Table 7-3 to determine the appropriate header and footer JSP files to edit. This two column table lists the Desktop containers in the first column and the corresponding header and footer files in the second column.
Table 7-3 Header and Footer Files for Theme, Content, and Layout Pages
Desktop Container
Header and Footer Files for Theme, Content, and Layout Pages
FrameTabContainer
framePreferenceHeader.jsp and framePreferenceMenubar.jsp
JSPSingleContainer
singlePreferenceHeader.jsp and singlePreferenceMenubar.jsp
JSPTabContainer
tabPreferenceHeader.jsp and tabPreferenceMenubar.jsp
JSPTableContainer
tablePreferenceHeader.jsp and tablePreferenceMenubar.jsp
Note
Containers not listed in Table 6-3 on page 188 use defaultHeader.jsp and defaultMenubar.jsp. These two files are actually the same as singlePreferenceHeader.jsp and singlePreferenceMenubar.jsp. If you want a default look and feel for the container’s header and menubar, customize these two JSPs. Currently, the sample portal does not use defaultHeader.jsp and defaultMenubar.jsp.
- Change to the appropriate directory.
That is, change to /etc/opt/SUNWps/desktop/sampleportal (if sampleportal is installed) or change to the specific desktop type subdirectory associated with the target user or organization.
- Edit the JSP files.
For example, change the HTML title and logo in the header file, and change the product name in the footer.
- Run the touch command.
For example,
touch *.jsp
- Reload the Desktop to verify the change.
Changing Desktop ColorsThis section describes how to change the color for various Desktop components, such as header, footer, font color in the header and footer, and so on.
To Change Desktop Colors
Most of these colors are part of the global theme attributes. See "Customizing the Global Themes" for more information.
- Use Table 6-4 to determine what you want to change and what file you need to change. This two column table lists the Desktop component to customize in the first column, the files to edit in the second column, and the corresponding theme attribute in the third column.
Table 7-4 Files to Customize to Change Desktop Colors
Desktop Component to Customize
File to Edit in /etc/opt/SUNWps/desktop/default/
Theme Attribute
Header background color
JSP-based containers:
Frame-based containers:
brandBgColor
Footer background color
JSP-based containers:
Frame-based containers:
brandBgColor
Font color in the header and footer
The related JSPs are the header.jsp and menubar.jsp that listed in header background color and footer background color.
headerFontColor
Selected tab color
JSP-based containers:
./JSPTabContainer/selectedTab.jsp
Frame-based containers:
./FrameTabContainer/selectedTab.jsp
titleBarColor
Content Page color
./JSPContentContainer/contentLayoutBar.jsp ./JSPEditContainer/contentLayoutBar.jsp ./JSPLayoutContainer/contentLayoutBar.jsp ./TabJSPEditContainer/contentLayoutBar.jsp
(none)
Layout Page color
./JSPLayoutContainer/layoutedit.jsp
(none)
Desktop body
./JSPTableContainerProvider/tabtable.jsp
tableBgColor
- Edit the appropriate file.
In almost all case, make modifications to the bgcolor=value statement to change the color. In the case of the font color in the header and footer, change the color inside of the FONT tag for the specific link.
- In the directory where you make the change, run the following command:
touch *.jsp
(Or, if you know the parent JSP file, just run the touch command on that file.)
- Reload the Desktop.
To Change the Default Color Scheme for an Organization
There are two ways in which to provide a new color scheme and layout for an organization:
- Define a new set of templates - You can define a new set of templates in /etc/opt/SUNWps/desktop/new/ and make this directory (new) the Desktop Type attribute for that organization. See the Sun ONE Portal Server 6.2 Administrator’s Guide for more details.
- Define a new theme - In the display profile, you can define your own theme in the GlobalThemes collection. See "Adding and Customizing Global Themes" for more information.
Customizing the Global ThemesThe Desktop theme provides the capability of creating a customizable user interface that allows the end users to select different look and feel for their Desktop.
The definition of a theme in Sun ONE Portal Server 6.2 software Desktop is a collection of user interface attributes that are used in the markup output from the Desktop. The attributes can be colors, fonts, and images. Out of the box, there are eight themes that come with the sample portal and each theme contains thirty eight (38) attributes.
Customization Overview
There are two levels of customization for the themes:
- The number of themes and theme attributes are configurable by the administrators. Theme and theme attributes are display profile properties; so they can be modified through the Sun ONE Identity Server software administration console, or they can be edited in the display profile directly. The theme properties are defined as global properties in the organization level in the sample portal. So, when a new theme is created, all users in the organization will see it.
- The end user can select one of the preset themes that are defined by the administrator, or customize some theme attribute values inside of the theme page in the Desktop. When the theme changes, it applies to all the containers in the Desktop, and also, the changed property will be stored in the user level display profile.
Note
The end user can change the following Theme attributes through the Theme customize page (please "Theme Properties" for information on these attributes):
There are tag library functions defined to allow JSPs to retrieve the theme related values from the display profile (see Appendix A, "Desktop Template and Tag Reference" for more information.) Behind the scene, the tag library functions use the Theme Java class to get the theme properties. For more information on the Theme Java class, please see the Java docs for com.sun.portal.providers.context.Theme.
GlobalThemes Display Profile Definition
The following display profile XML fragment shows the eight themes defined in portal-server-install-root/SUNWps/samples/desktop/dp-org.xml file.
Code Example 7-6 Display Profile Definition for GlobalThemes
<Collection name="GlobalThemes" propagate="false">
<Collection name="SunTheme">
<String name="description" value="Sun"/>
<String name="bgColor" value="white"/>
<String name="titleBarColor" value="#999999"/>
<String name="fontColor" value="black"/>
<String name="borderColor" value="#999999"/>
<String name="borderWidth" value="1"/>
<String name="fontFace" value="Sans-serif"/>
<String name="fontSize" value="3"/>
<String name="activeBulletImage" value="branded_bullet_on.gif"/>
<String name="inactiveBulletImage" value="branded_bullet_off.gif"/>
<String name="brandImage" value="logo_sun.gif"/>
<String name="brandImage2" value="sunONE_productlogo.gif"/>
<String name="brandImageBgColor" value="#594FBF"/>
<String name="brandImage2BgColor" value="#FBE249"/>
<String name="brandBgColor" value="#ffffff"/>
<String name="brandImageWidth" value="110"/>
<String name="headerBgColor" value="#e5e5e5"/>
<String name="headerFontColor" value="#594FBF"/>
<String name="headerText" value="sansSerif11Font"/>
<String name="tabNotchImage" value="tabNotch.gif"/>
<String name="tabColor" value="#cccccc"/>
<String name="tabFontColor" value="#000000"/>
<String name="contentLayoutLinkColor" value="#FFFFFF"/>
<String name="contentLayoutText" value="sansSerif10Font"/>
<String name="linkSeparatorColor" value="#CCCCCC"/>
<String name="tableBgColor" value="#FFFFFF"/>
<String name="titleFontColor" value="#ffffff"/>
<String name="titleText" value="sansSerif10Font"/>
<String name="channelHighlightColor" value="#ffffff"/>
<String name="channelLinkColor" value="#3a2eb5"/>
<String name="previewImage" value="Sun_preview.gif"/>
<String name="helpImage" value="b_help.gif"/>
<String name="removeImage" value="b_remove.gif"/>
<String name="minimizeImage" value="b_minimize.gif"/>
<String name="maximizeImage" value="b_maximize.gif"/>
<String name="normalizeImage" value="b_normal.gif"/>
<String name="attachImage" value="b_attach.gif"/>
<String name="detachImage" value="b_new_window.gif"/>
<String name="editImage" value="b_edit.gif"/>
</Collection>
<Collection name="FieryTheme">
<String name="description" value="Fiery"/>
<String name="bgColor" value="white"/>
<String name="titleBarColor" value="#990000"/>
<String name="fontColor" value="black"/>
<String name="borderColor" value="#990000"/>
<String name="borderWidth" value="1"/>
<String name="fontFace" value="Sans-serif"/>
<String name="fontSize" value="3"/>
<String name="activeBulletImage" value="fiery_bullet_on.gif"/>
<String name="inactiveBulletImage" value="fiery_bullet_off.gif"/>
<String name="brandImage" value="Fiery_000000.gif"/>
<String name="brandImage2" value="spacer.gif"/>
<String name="brandImageBgColor" value="#000000"/>
<String name="brandImage2BgColor" value="#000000"/>
<String name="brandBgColor" value="#000000"/>
<String name="headerBgColor" value="#000000"/>
<String name="brandImageWidth" value="243"/>
<String name="headerFontColor" value="#FFFFFF"/>
<String name="headerText" value="sansSerif11Font"/>
<String name="tabNotchImage" value="black_tabend.gif"/>
<String name="tabColor" value="#FF3300"/>
<String name="tabFontColor" value="#000000"/>
<String name="contentLayoutLinkColor" value="#ff3300"/>
<String name="contentLayoutText" value="sansSerif10Font"/>
<String name="linkSeparatorColor" value="#000000"/>
<String name="tableBgColor" value="#999999"/>
<String name="titleFontColor" value="#ffffff"/>
<String name="titleText" value="sansSerif10Font"/>
<String name="channelHighlightColor" value="#ffffff"/>
<String name="channelLinkColor" value="#3a2eb5"/>
<String name="previewImage" value="Fiery_preview.gif"/>
<String name="helpImage" value="b_help.gif"/>
<String name="removeImage" value="b_remove.gif"/>
<String name="minimizeImage" value="b_minimize.gif"/>
<String name="maximizeImage" value="b_maximize.gif"/>
<String name="normalizeImage" value="b_normal.gif"/>
<String name="attachImage" value="b_attach.gif"/>
<String name="detachImage" value="b_new_window.gif"/>
<String name="editImage" value="b_edit.gif"/>
</Collection>
<Collection name="BreezyTheme">
<String name="description" value="Breezy"/>
<String name="bgColor" value="white"/>
<String name="titleBarColor" value="#336699"/>
<String name="fontColor" value="black"/>
<String name="borderColor" value="#336699"/>
<String name="borderWidth" value="1"/>
<String name="fontFace" value="Sans-serif"/>
<String name="fontSize" value="3"/>
<String name="activeBulletImage" value="breezy_bullet_on.gif"/>
<String name="inactiveBulletImage" value="breezy_bullet_off.gif"/>
<String name="brandImage" value="Breezy_FFFFFF.gif"/>
<String name="brandImage2" value="spacer.gif"/>
<String name="brandImageBgColor" value="#FFFFFF"/>
<String name="brandImage2BgColor" value="#FFFFFF"/>
<String name="brandBgColor" value="#FFFFFF"/>
<String name="headerBgColor" value="#FFFFFF"/>
<String name="brandImageWidth" value="243"/>
<String name="headerFontColor" value="#000000"/>
<String name="headerText" value="sansSerif11Font"/>
<String name="tabNotchImage" value="tabNotch.gif"/>
<String name="tabColor" value="#CCCC66"/>
<String name="tabFontColor" value="#000000"/>
<String name="contentLayoutLinkColor" value="#FFFFFF"/>
<String name="contentLayoutText" value="sansSerif10Font"/>
<String name="linkSeparatorColor" value="#ED471E"/>
<String name="tableBgColor" value="#CCCCFF"/>
<String name="titleFontColor" value="#ffffff"/>
<String name="titleText" value="sansSerif10Font"/>
<String name="channelHighlightColor" value="#ffffff"/>
<String name="channelLinkColor" value="#3a2eb5"/>
<String name="previewImage" value="Breezy_preview.gif"/>
<String name="helpImage" value="b_help.gif"/>
<String name="removeImage" value="b_remove.gif"/>
<String name="minimizeImage" value="b_minimize.gif"/>
<String name="maximizeImage" value="b_maximize.gif"/>
<String name="normalizeImage" value="b_normal.gif"/>
<String name="attachImage" value="b_attach.gif"/>
<String name="detachImage" value="b_new_window.gif"/>
<String name="editImage" value="b_edit.gif"/>
</Collection>
<Collection name="SereneTheme">
<String name="description" value="Serene"/>
<String name="bgColor" value="white"/>
<String name="titleBarColor" value="#EAE7E7"/>
<String name="fontColor" value="black"/>
<String name="borderColor" value="#EAE7E7"/>
<String name="borderWidth" value="0"/>
<String name="fontFace" value="Sans-serif"/>
<String name="fontSize" value="3"/>
<String name="activeBulletImage" value="serene_bullet_on.gif"/>
<String name="inactiveBulletImage" value="serene_bullet_off.gif"/>
<String name="brandImage" value="Serene_330099.gif"/>
<String name="brandImage2" value="spacer.gif"/>
<String name="brandImageBgColor" value="#330099"/>
<String name="brandImage2BgColor" value="#330099"/>
<String name="brandBgColor" value="#330099"/>
<String name="headerBgColor" value="#330099"/>
<String name="brandImageWidth" value="243"/>
<String name="headerFontColor" value="#FFFFFF"/>
<String name="headerText" value="sansSerif11Font"/>
<String name="tabNotchImage" value="serene_tabend.gif"/>
<String name="tabColor" value="#9999FF"/>
<String name="tabFontColor" value="#000000"/>
<String name="contentLayoutLinkColor" value="#330099"/>
<String name="contentLayoutText" value="sansSerif10Font"/>
<String name="linkSeparatorColor" value="#9999FF"/>
<String name="tableBgColor" value="#FFFFFF"/>
<String name="titleFontColor" value="#330099"/>
<String name="titleText" value="sansSerif10Font"/>
<String name="channelHighlightColor" value="#ffffcc"/>
<String name="channelLinkColor" value="#3a2eb5"/>
<String name="previewImage" value="Serene_preview.gif"/>
<String name="helpImage" value="b_help.gif"/>
<String name="removeImage" value="b_remove.gif"/>
<String name="minimizeImage" value="b_minimize.gif"/>
<String name="maximizeImage" value="b_maximize.gif"/>
<String name="normalizeImage" value="b_normal.gif"/>
<String name="attachImage" value="b_attach.gif"/>
<String name="detachImage" value="b_new_window.gif"/>
<String name="editImage" value="b_edit.gif"/>
</Collection>
<Collection name="SportingTheme">
<String name="description" value="Sporting"/>
<String name="bgColor" value="white"/>
<String name="titleBarColor" value="#009999"/>
<String name="fontColor" value="black"/>
<String name="borderColor" value="#009999"/>
<String name="borderWidth" value="1"/>
<String name="fontFace" value="Sans-serif"/>
<String name="fontSize" value="3"/>
<String name="activeBulletImage" value="sporting_bullet_on.gif"/>
<String name="inactiveBulletImage" value="sporting_bullet_off.gif"/>
<String name="brandImage" value="Sporting_000000.gif"/>
<String name="brandImage2" value="spacer.gif"/>
<String name="brandImageBgColor" value="#000000"/>
<String name="brandImage2BgColor" value="#000000"/>
<String name="brandBgColor" value="#000000"/>
<String name="headerBgColor" value="#000000"/>
<String name="brandImageWidth" value="243"/>
<String name="headerFontColor" value="#FFFFFF"/>
<String name="headerText" value="sansSerif11Font"/>
<String name="tabNotchImage" value="black_tabend.gif"/>
<String name="tabColor" value="#CCCCCC"/>
<String name="tabFontColor" value="#000000"/>
<String name="contentLayoutLinkColor" value="#000000"/>
<String name="contentLayoutText" value="sansSerif10Font"/>
<String name="linkSeparatorColor" value="#CCCCCC"/>
<String name="tableBgColor" value="#FFFFFF"/>
<String name="titleFontColor" value="#000000"/>
<String name="titleText" value="sansSerif10Font"/>
<String name="channelHighlightColor" value="#ffffff"/>
<String name="channelLinkColor" value="#3a2eb5"/>
<String name="previewImage" value="Sporting_preview.gif"/>
<String name="helpImage" value="b_help.gif"/>
<String name="removeImage" value="b_remove.gif"/>
<String name="minimizeImage" value="b_minimize.gif"/>
<String name="maximizeImage" value="b_maximize.gif"/>
<String name="normalizeImage" value="b_normal.gif"/>
<String name="attachImage" value="b_attach.gif"/>
<String name="detachImage" value="b_new_window.gif"/>
<String name="editImage" value="b_edit.gif"/>
</Collection>
<Collection name="DustyTheme">
<String name="description" value="Dusty"/>
<String name="bgColor" value="white"/>
<String name="titleBarColor" value="#330000"/>
<String name="fontColor" value="black"/>
<String name="borderColor" value="#330000"/>
<String name="borderWidth" value="1"/>
<String name="fontFace" value="Sans-serif"/>
<String name="fontSize" value="3"/>
<String name="activeBulletImage" value="dusty_bullet_on.gif"/>
<String name="inactiveBulletImage" value="dusty_bullet_off.gif"/>
<String name="brandImage" value="Dusty_FFFFFF.gif"/>
<String name="brandImage2" value="spacer.gif"/>
<String name="brandImageBgColor" value="#FFFFFF"/>
<String name="brandImage2BgColor" value="#FFFFFF"/>
<String name="brandBgColor" value="#FFFFFF"/>
<String name="headerBgColor" value="#FFFFFF"/>
<String name="brandImageWidth" value="243"/>
<String name="headerFontColor" value="#330000"/>
<String name="headerText" value="sansSerif11Font"/>
<String name="tabNotchImage" value="tabNotch.gif"/>
<String name="tabColor" value="#999966"/>
<String name="tabFontColor" value="#000000"/>
<String name="contentLayoutLinkColor" value="#CC9900"/>
<String name="contentLayoutText" value="sansSerif10Font"/>
<String name="linkSeparatorColor" value="#ED471E"/>
<String name="tableBgColor" value="#CCCC99"/>
<String name="titleFontColor" value="#FFFFCC"/>
<String name="titleText" value="sansSerif10Font"/>
<String name="channelHighlightColor" value="#ffffff"/>
<String name="channelLinkColor" value="#3a2eb5"/>
<String name="previewImage" value="Dusty_preview.gif"/>
<String name="helpImage" value="b_help.gif"/>
<String name="removeImage" value="b_remove.gif"/>
<String name="minimizeImage" value="b_minimize.gif"/>
<String name="maximizeImage" value="b_maximize.gif"/>
<String name="normalizeImage" value="b_normal.gif"/>
<String name="attachImage" value="b_attach.gif"/>
<String name="detachImage" value="b_new_window.gif"/>
<String name="editImage" value="b_edit.gif"/>
</Collection>
<Collection name="CollegiateTheme">
<String name="description" value="Collegiate"/>
<String name="bgColor" value="white"/>
<String name="titleBarColor" value="#000033"/>
<String name="fontColor" value="black"/>
<String name="borderColor" value="#000033"/>
<String name="borderWidth" value="1"/>
<String name="fontFace" value="Sans-serif"/>
<String name="fontSize" value="3"/>
<String name="activeBulletImage" value="collegiate_bullet_on.gif"/>
<String name="inactiveBulletImage" value="collegiate_bullet_off.gif"/>
<String name="brandImage" value="Collegiate_FFFFFF.gif"/>
<String name="brandImage2" value="spacer.gif"/>
<String name="brandImageBgColor" value="#FFFFFF"/>
<String name="brandImage2BgColor" value="#FFFFFF"/>
<String name="brandBgColor" value="#FFFFFF"/>
<String name="headerBgColor" value="#FFFFFF"/>
<String name="brandImageWidth" value="243"/>
<String name="headerFontColor" value="#000000"/>
<String name="headerText" value="sansSerif11Font"/>
<String name="tabNotchImage" value="tabNotch.gif"/>
<String name="tabColor" value="#EED23A"/>
<String name="tabFontColor" value="#000000"/>
<String name="contentLayoutLinkColor" value="#EED23A"/>
<String name="contentLayoutText" value="sansSerif10Font"/>
<String name="linkSeparatorColor" value="#ED471E"/>
<String name="tableBgColor" value="#CCCCCC"/>
<String name="titleFontColor" value="#ffffff"/>
<String name="titleText" value="sansSerif10Font"/>
<String name="channelHighlightColor" value="#ffffff"/>
<String name="channelLinkColor" value="#3a2eb5"/>
<String name="previewImage" value="Collegiate_preview.gif"/>
<String name="helpImage" value="b_help.gif"/>
<String name="removeImage" value="b_remove.gif"/>
<String name="minimizeImage" value="b_minimize.gif"/>
<String name="maximizeImage" value="b_maximize.gif"/>
<String name="normalizeImage" value="b_normal.gif"/>
<String name="attachImage" value="b_attach.gif"/>
<String name="detachImage" value="b_new_window.gif"/>
<String name="editImage" value="b_edit.gif"/>
</Collection>
<Collection name="NeonTheme">
<String name="description" value="Neon"/>
<String name="bgColor" value="white"/>
<String name="titleBarColor" value="#CCFF33"/>
<String name="fontColor" value="black"/>
<String name="borderColor" value="#CCFF33"/>
<String name="borderWidth" value="1"/>
<String name="fontFace" value="Sans-serif"/>
<String name="fontSize" value="3"/>
<String name="activeBulletImage" value="neon_bullet_on.gif"/>
<String name="inactiveBulletImage" value="neon_bullet_off.gif"/>
<String name="brandImage" value="Neon_000000.gif"/>
<String name="brandImage2" value="spacer.gif"/>
<String name="brandImageBgColor" value="#000000"/>
<String name="brandImage2BgColor" value="#000000"/>
<String name="brandBgColor" value="#000000"/>
<String name="headerBgColor" value="#000000"/>
<String name="brandImageWidth" value="243"/>
<String name="headerFontColor" value="#FFFFFF"/>
<String name="headerText" value="sansSerif11Font"/>
<String name="tabNotchImage" value="black_tabend.gif"/>
<String name="tabColor" value="#FF0000"/>
<String name="tabFontColor" value="#000000"/>
<String name="contentLayoutLinkColor" value="#000000"/>
<String name="contentLayoutText" value="sansSerif10Font"/>
<String name="linkSeparatorColor" value="#FF0000"/>
<String name="tableBgColor" value="#FFFFFF"/>
<String name="titleFontColor" value="#000000"/>
<String name="titleText" value="sansSerif10Font"/>
<String name="channelHighlightColor" value="#ffffff"/>
<String name="channelLinkColor" value="#3a2eb5"/>
<String name="previewImage" value="Neon_preview.gif"/>
<String name="helpImage" value="b_help.gif"/>
<String name="removeImage" value="b_remove.gif"/>
<String name="minimizeImage" value="b_minimize.gif"/>
<String name="maximizeImage" value="b_maximize.gif"/>
<String name="normalizeImage" value="b_normal.gif"/>
<String name="attachImage" value="b_attach.gif"/>
<String name="detachImage" value="b_new_window.gif"/>
<String name="editImage" value="b_edit.gif"/>
</Collection>
</Collection>
<String name="UserTheme" value="SunTheme" propagate="false"/>
<Collection name="CustomTheme" propagate="false">
<String name="bgColor" value=""/>
<String name="titleBarColor" value=""/>
<String name="fontColor" value=""/>
<String name="borderColor" value=""/>
<String name="borderWidth" value=""/>
<String name="fontFace" value=""/>
<String name="fontSize" value=""/>
<String name="activeBulletImage" value=""/>
<String name="inactiveBulletImage" value=""/>
<String name="brandImage" value=""/>
<String name="brandImage2" value=""/>
<String name="brandImageBgColor" value=""/>
<String name="brandImage2BgColor" value=""/>
<String name="brandBgColor" value=""/>
<String name="headerBgColor" value=""/>
<String name="brandImageWidth" value=""/>
<String name="headerFontColor" value=""/>
<String name="headerText" value=""/>
<String name="tabNotchImage" value=""/>
<String name="tabColor" value=""/>
<String name="tabFontColor" value=""/>
<String name="contentLayoutLinkColor" value=""/>
<String name="contentLayoutText" value=""/>
<String name="linkSeparatorColor" value=""/>
<String name="tableBgColor" value=""/>
<String name="titleFontColor" value=""/>
<String name="titleText" value=""/>
<String name="channelHighlightColor" value=""/>
<String name="channelLinkColor" value=""/>
<String name="previewImage" value=""/>
<String name="helpImage" value=""/>
<String name="removeImage" value=""/>
<String name="minimizeImage" value=""/>
<String name="maximizeImage" value=""/>
<String name="normalizeImage" value=""/>
<String name="attachImage" value=""/>
<String name="detachImage" value=""/>
<String name="editImage" value=""/>
</Collection>
</Collection>
Theme Properties
The following is a list of theme properties that can be defined, modified, and/or customized in the display profile document. Please reference to the "Glossary of Terms" for more detailed description for the theme properties.
In the following table, column one lists the theme property name and column two provides a brief description of the corresponding theme property.
activeBulletImage
activeBulletGraphics
inactiveBulletImage
inactiveBulletGraphics
brandImage
logo image
brandImage2
Product name image
brandImageBgColor
header logo bg color
brandImage2BgColor
header product name bg color
brandBgColor
header link box bg color
headerBgColor
header bg color and footer bg color
headerFontColor
header font color
footer font color
headerText
header font size
footer font size
header font face
footer font face
tabNotchImage
tabNotch image
titleText
selected tab font face
selected tab font size
unselected tab font face
unselected tab font size
channel title font face
channel title font size
titleFontColor
selected tab font color
channel title font color
fontSize
channel font size
channel link font size
fontFace
channel font face
channel link font face
titleBarColor
selected tab bg color
channel title bar bg color
content/layout bar color
channel border color
page piping color (bottom)
button bg color
borderColor
tabColor
unselected tab bg color
secondary channel title bar color
tabFontColor
unselected tab font color
bgColor
channel bg color
fontColor
channel font color
borderWidth
channel border width
tableBgColor
table bg color
page piping, top
channelHightlightColor
highlight color for channel content (as seen in the Placida theme JSP channel)
linkSeparatorColor
link separator color (in the toolbar, between Content and Layout)
footer link separator color
channelLinkColor
channel link color
contentLayoutLinkColor
content/layout link color
contentLayoutText
content/layout link font size
content/layout link font face
brandImageWidth
brand image width
previewImage
preview image (on preset themes page)
removeImage
remove image (for the channel title bar)
detachImage
detach image (for the channel title bar)
helpImage
help image (for the channel title bar)
editImage
edit image (for the channel title bar)
minimizeImage
minimize image (for the channel title bar)
maximizeImage
maximize image (for the channel title bar)
normalizeImage
normalize image (in the maximized channel)
attachImage
attach image (in the popup window)
Glossary of Terms
The following table give some detailed description of where the theme attributes are actually used in the desktop.
Table 7-5 Glossary of Terms
Term
Description
Header
The banner area at the top of the portal page. Contains the branding and the global links.
Bullet graphics
The “dot” graphics that go next to the global links in the header
Logo, product name, link
The three areas in the header for the Sun theme
Footer
The narrow banner at the bottom of the portal page. Contains the global links
Tab notch
The graphic that goes in the upper left corner of the tab table cells
Selected tab
The tab whose contents are displayed
Unselected tab
The other tabs whose contents are not seen
Content/layout bar
The tool bar underneath the tabs that contains the content and layout links
Channel
The data containers displayed inside each tab
Page piping
The narrow bands of color at the top and bottom of the portal page
Table background
The areas the channels sit in
Highlight color for channel content
A contrasting color for tables inside channels
Secondary channel title bar
An extra color bar beneath the standard channel title bar
Link separator
A pipe used between links in the content/layout bar
Adding and Customizing Global Themes
When you add (or customize) a global theme, all channels see the change, as themes are a global property for all channels.
To Add a Theme to the Sample Portal
- Develop the display profile XML definition for the new theme and ensure that the new collection has all thrity eight (38) properties defined in the display profile.
The collection can be added either using the Sun ONE Identity Server administration console, or via the dpadmin command.
- Copy new images into the portal-server-install-root/SUNWps/web-src. That is:
- activeBulletImage, inactiveBulletImage, brandImage, brandImage2, previewImage: these images must be copied in to the portal-server-install-root/SUNWps/web-src/images directory.
- helpImage, removeImage, minimizeImage, maximizeImage, normalImage, attachImage, detachImage, editImage: these images must be copied in to the portal-server-install-root/SUNWps/web-src/desktop/images directory.
- tabNotchImage must be copied in to the portal-server-install-root/SUNWps/web-src/desktop/tabs/images directory.
- Run the deploy command to deploy the image files. For example, type:
portal-server-install-root/SUNWps/bin/deploy redeploy -deploy_admin_password password
- Verify that the new theme shows up on the Desktop’s Theme page.
To Customize the Current Themes
Change the theme values in the display profile. You can modify the theme properties from the admistration console, or by using the dpadmin command to load the XML fragment.
Changing in the administration console is easier, since you want to pin point some specific properties, and change the values. See "Guidelines for Using the dpadmin Command" for loading the the display profile into LDAP by using the dpadmin command.
In the sample portal, the portal-server-install-root/SUNWps/samples/desktop/dp-org.xml file defines eight themes. See also, "GlobalThemes Display Profile Definition" for the default display profile XML fragment for GlobalThemes.
To Change the Text
The font families and font sizes are combined and defined in the following theme attributes:
The value of these attributes is actually a class defined in the desktop WebContainerInstance/desktop/style.css file. In the Desktop style.css file, there are predefined font family + font size as follows:
.sansSerif12Font { font-family: sans-serif; font-size: 12pt }
.sansSerif11Font { font-family: sans-serif; font-size: 11pt }
.sansSerif10Font { font-family: sans-serif; font-size: 10pt }
.sansSerif9Font { font-family: sans-serif; font-size: 9pt }
.sansSerif8Font { font-family: sans-serif; font-size: 8pt }
.sansSerif6Font { font-family: sans-serif; font-size: 6pt }
.monospace12Font { font-family: monospace; font-size: 12pt }
.monospace11Font { font-family: monospace; font-size: 11pt }
.monospace10Font { font-family: monospace; font-size: 10pt }
.monospace9Font { font-family: monospace; font-size: 9pt }
.monospace8Font { font-family: monospace; font-size: 8pt }
.monospace6Font { font-family: monospace; font-size: 6pt }
.serif12Font { font-family: serif; font-size: 12pt }
.serif11Font { font-family: serif; font-size: 11pt }
.serif10Font { font-family: serif; font-size: 10pt }
.serif9Font { font-family: serif; font-size: 9pt }
.serif8Font { font-family: serif; font-size: 8pt }
.serif6Font { font-family: serif; font-size: 6pt }
.verdana12Font { font-family: verdana; font-size: 12pt }
.verdana11Font { font-family: verdana; font-size: 11pt }
.verdana10Font { font-family: verdana; font-size: 10pt }
.verdana9Font { font-family: verdana; font-size: 9pt }
.verdana8Font { font-family: verdana; font-size: 8pt }
.verdana6Font { font-family: verdana; font-size: 6pt }
To change the font for the header text, title text, and content and layout text, please use one of the predefined class name, or, add new class definition in the style.css file, and then use it.
To Change the Sample Anonymous Desktop Theme
Anonymous users cannot choose their own theme as this is determined by the display profile. However, an administrator who has permission to edit the anonymous user’s display profile can change the theme for the anonymous Desktop.
- Create a temporary file containing the theme definition.
For example,
vi newtheme.xml
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE DisplayProfile SYSTEM "jar://resources/psdp.dtd">
<Collection name="GlobalThemes">
<Collection name="NeonTheme">
<String name="description" value="Neon"/>
<String name="bgColor" value="white"/>
<String name="titleBarColor" value="#CCFF33"/>
<String name="fontColor" value="black"/>
<String name="borderColor" value="#CCFF33"/>
<String name="borderWidth" value="1"/>
<String name="fontFace" value="Sans-serif"/>
<String name="fontSize" value="3"/>
<String name="activeBulletImage" value="neon_bullet_on.gif"/>
<String name="inactiveBulletImage" value="neon_bullet_off.gif"/>
<String name="brandImage" value="Neon_000000.gif"/>
<String name="brandImage2" value="spacer.gif"/>
<String name="brandImageBgColor" value="#000000"/>
<String name="brandImage2BgColor" value="#000000"/>
<String name="brandBgColor" value="#000000"/>
<String name="headerBgColor" value="#000000"/>
<String name="brandImageWidth" value="243"/>
<String name="headerFontColor" value="#FFFFFF"/>
<String name="headerText" value="sansSerif11Font"/>
<String name="tabNotchImage" value="black_tabend.gif"/>
<String name="tabColor" value="#FF0000"/>
<String name="tabFontColor" value="#000000"/>
<String name="contentLayoutLinkColor" value="#000000"/>
<String name="contentLayoutText" value="sansSerif10Font"/>
<String name="linkSeparatorColor" value="#FF0000"/>
<String name="tableBgColor" value="#FFFFFF"/>
<String name="titleFontColor" value="#000000"/>
<String name="titleText" value="sansSerif10Font"/>
<String name="channelHighlightColor" value="#ffffff"/>
<String name="channelLinkColor" value="#3a2eb5"/>
<String name="previewImage" value="Neon_preview.gif"/>
<String name="helpImage" value="b_help.gif"/>
<String name="removeImage" value="b_remove.gif"/>
<String name="minimizeImage" value="b_minimize.gif"/>
<String name="maximizeImage" value="b_maximize.gif"/>
<String name="normalizeImage" value="b_normal.gif"/>
<String name="attachImage" value="b_attach.gif"/>
<String name="detachImage" value="b_new_window.gif"/>
<String name="editImage" value="b_edit.gif"/>
</Collection>
</Collection>
<String name="UserTheme" value="NeonTheme" propagate="false"/>
- Run the dpadmin command with the add sub-command to load the display profile.
For example, to load the XML fragment to the anonymous user’s node,
/opt/SUNWps/bin/dpadmin add -u "uid=amAdmin,ou=People,o=sesta.com,o=isp" -w password -d "uid=anonymous,ou=people,o=sesta.com,o=isp" newtheme.xml
- Log in to the administration console and change the global property. That is:
- Select Users from the View pull-down menu.
- Select Authlessanonymous
- Select View->Portal Desktop on the right panel and select the Edit link.
A popup window displayed.
- Select Channel and Container Management.
- Select Display Profile: Edit Properties and change User Theme to "NeonTheme".
- Click on Save to save the settings.
- Log out of the administration console.
Miscellaneous JSP InformationThis section contains miscellaneous information on using JSPs when customizing the Desktop.
Performing Redirects
To perform redirects from the doedit.jsp page back to the edit.jsp page, use the following URL:
response.sendRedirect(p.getProviderContext().getDesktopURL(request).toStrin g() + "?action=edit&provider=ipsdtJSPEditChannel" + "&targetprovider=" + p.getName() + "&reedit=true");
To return back to the Edit page, use the following, which does not hardcode the editchannel name.
String editChannel = request.getParameter("editChannelName");
response.sendRedirect(p.getProviderContext().getDesktopURL(request).toStrin g() + "?action=edit&provider=<%=editChannel%>&targetprovider=" + p.getName() + "&redit=true");
JSP vs. Theme Color
The colors of a theme can be changed in two places: in the JSP or template file that uses the theme tag, and in the display profile using the GlobalThemes attribute.
If you change the color value in the JSP or template file, the Desktop uses this value and not what is in the GlobalThemes attribute.
For example, if you manually change the following background color in a JSP file
BGCOLOR="<dttheme:getAttribute name="borderColor"/>"
to
BGCOLOR="#FFFFFF"
then the Desktop shows white for border color, and the theme color is not used. There is no way the theme or the Desktop can detect this.
Recompiling JSPs
Every time you make a modification to a JSP file, you need to recompile. You do this by running the touch command on the modified container’s top-level JSP file.
For example,
touch tab.jsp
Note
Once the top-level JSP is touched, the JSP engine recompiles all the relevant JSPs. If you cannot find the top level JSP, run the touch command on all JSPs in the directory, for example,
touch *.jsp
This modifies all JSPs, including the top-level JSP.
See “JavaServer Page Caching Information,” on page 149 for information on how to find the top-level (parent) JSP.
JavaServer Page Caching Information
When the system compiles JavaServer Pages (JSP), the result is only one Java class per parent JSP. There is no compiled class for the static included JSPs. Thus, when you change an included JSP, you need to run the touch command on the parent JSP to recompile the parent JSP with the changed JSP. The Sun ONE Portal Server software JSP engine checks the last modification time on the compiled class and the JSP file to see if the JSP needs to be recompiled. In this way, the change takes effect immediately.
To find a JSP’s parent JSP, search in the JSP for the string <%@ include file="filename.jsp" %>. Some JSPs are dynamically included by using the <jsp:include page="header.jsp" flush="true"/> syntax instead of <%@ include file="header.jsp" %>. This syntax compiles header.jsp and generates a separate Java class.
The path to cached JSPs is constructed in such a way so that the compiled JSPs do not conflict with each other in multi-server instances, when multiple Desktop types contain the same JSPs and for multiple clientTypes and locales. So when JSPs are dynamically included, the touch command does not need to be run for the parent JSP.
Desktop Debug Information
Use the following to help debug the Desktop and JSP environment:
The Desktop debug file is located at:
/var/opt/SUNWam/debug/desktop.debug
If you get an error message page on the Desktop, you can view the source to look at the stack trace. (For example, in Netscape Navigator, select Page Source from the View menu.)
The JSP classes are created at:
/var/opt/SUNWps/https-psservername/portal/tmp/_jsps
Debugging JSPs
You can find compilation and runtime errors in the Desktop debug log at:
/var/opt/SUNWam/debug/desktop.debug
Also, all JSPProvider based Desktop channels have a property called showExceptions. This property, by default, is set to false; setting it to true causes the JSP exception to show up as the content of the channel.