Sun Java logo     Previous      Contents      Index      Next     

Sun logo
Sun Java System Portal Server 6 2005Q1 Desktop Customization Guide 

Chapter 12
Customizing the Global Themes

This chapter contains the following:


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 Java System Access Manager 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.

There are tag library functions defined to allow JSPs to retrieve the theme related values from the display profile. 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.

When you add (or customize) a global theme, all channels see the change, as themes are a global property for all channels.

See the Portal Server Technical Reference Guide for more information on the Global themes


Adding a Theme to the Sample Portal

  1. Develop the display profile XML definition for the new theme and ensure that the new collection has all thirty eight (38) properties defined in the display profile.
  2. The collection can be added either using the Access Manager administration console, or via the dpadmin command.

  3. Copy new images into the PortalServer-base/web-src. That is:
    • activeBulletImage, inactiveBulletImage, brandImage, brandImage2, previewImage: these images must be copied in to the PortalServer-base/web-src/images directory.
    • helpImage, removeImage, minimizeImage, maximizeImage, normalImage, attachImage, detachImage, editImage: these images must be copied in to the PortalServer-base/web-src/desktop/images directory.
    • tabNotchImage must be copied in to the PortalServer-base/web-src/desktop/tabs/images directory.
  4. Run the deploy command to deploy the image files. For example, type:
  5. PortalServer-base/bin/deploy redeploy -deploy_admin_password password

  6. Verify that the new theme shows up on the Desktop’s Theme page.


Customizing the Current Themes

Change the theme values in the display profile. You can modify the theme properties from the administration 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.

In the sample portal, the PortalServer-base/samples/desktop/dp-org.xml file defines eight themes. For more information, see the display profile fragment for GlobalThemes in the dp-org.xml file.

    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 Web-Container-Instance/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.

  1. Create a temporary file containing the theme definition.
  2. 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"/>

  3. Run the dpadmin command with the add sub-command to load the display profile.
  4. For example, to load the XML fragment to the anonymous user’s node,

    PortalServer-base/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

  5. Log in to the administration console and change the global property. That is:
    1. Select Users from the View pull-down menu.
    2. Select Authlessanonymous
    3. Select View->Portal Desktop on the right panel and select the Edit link.
    4. A popup window displayed.

    5. Select Channel and Container Management.
    6. Select Display Profile: Edit Properties and change User Theme to “NeonTheme”.
    7. Click on Save to save the settings.
  6. Log out of the administration console.


Previous      Contents      Index      Next     


Part No: 817-7694.   Copyright 2005 Sun Microsystems, Inc. All rights reserved.