Sun ONE logo     Previous     Contents     Index     Next     
Sun ONE Portal Server 6.0 Desktop Customization Guide



Chapter 6   Customizing the Desktop Interface


This chapter provides common customization tasks for modifying the look and feel of the Desktop.

This chapter contains the following sections:

Desktop Customization Overview

This section provides general overview information on customizing the Desktop interface.



Note The procedures in this chapter use the dpadmin command-line utility instead of the iPlanet™ Directory Server Access Management Edition admin console to administer the display profile. See the Sun ONE Portal Server 6.0 Administrator's Guide for information on using the admin console to administer the display profile.



What Are the Areas for Customizing the Desktop?

In general, the Sun™ ONE Portal Server 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.



    Note Authentication screens are provided by iPlanet Directory Server Access Management Edition. This guide does not describe how to customize the authentication screens. See the iPlanet Directory Server Access Management Edition 5.1 Programmer's Guide for that information.



  • 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.

    JavaServer Pages™ (JSP™) and template files for dynamic content for providers, channels, and containers are located in the /etc/opt/SUNWps/desktop directory. Templates for static content are located in the /ps-base/SUNWps/web-apps/https-psservername/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 7 "Customizing the Search Provider" for more information.

JavaServer Page Caching Information

When the system compiles a JavaServer Pages, 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 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.

Desktop and JSP 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

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



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



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)

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 iPlanet Directory Server Access Management Edition admin 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 admin 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,


    /opt/SUNWps/bin/dpadmin add -u "uid=amAdmin,ou=People,o=sesta.com,o=isp" -w password -d "o=sesta.com,o=isp" newtheme.xml

    In this example, newtheme.xml is a file containing the XML "fragment" to be added to the display profile.

  • If you edit a display profile document directly, first use the dpadmin command with the list subcommand to obtain the latest contents of the display profile, make your edits, then run the dpadmin command with the modify subcommand. For example,


    /opt/SUNWps/bin/dpadmin list -u "uid=amAdmin,ou=People,o=sesta.com,o=isp" -w password -d "o=sesta.com,o=isp" > dp-org.xml

    (Edit the dp-org.xml file.)

    /opt/SUNWps/bin/dpadmin modify -u "uid=amAdmin,ou=People,o=sesta.com,o=isp" -w password -d "o=sesta.com,o=isp" dp-org.xml

See Chapter 12, "Command-Line Utilities," in the Sun ONE Portal Server 6.0 Administrator's Guide for more information on the dpadmin command.



Caution

Between the time you run the dpadmin list and dpadmin modify commands, do not change the display profile document in the LDAP server in any way (by using the admin console, dpadmin, or ldapmodify commands). Otherwise, those changes will be overwritten by the latest dpadmin modify command.



Adding Containers and Channels to the Desktop

Sun ONE Portal Server uses channels to generate content for the Desktop. Generally, content is created by using JSP or template files. You configure channels by using properties, which affect the content, position on the Desktop, and channel controls. 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:

  • By using the iPlanet Directory Server Access Management Edition admin console (Edit Channels and Channel and Container Management links).

  • By editing the display profile directly and running the dpadmin command to load the display profile into LDAP.

The Sun ONE Portal Server documentation considers adding containers and channels to be administrative tasks, hence, both of these methods are described in Chapter 5, "Administering Sun ONE Portal Server Display Profile," in the Sun ONE Portal Server 6.0 Administrator's Guide.

Customizing Container Tabs

This section provides a variety of tasks to customize the container tabs.



Note The order that you list the tabs in the display profile is the order that tabs are displayed in the Desktop. So, to make a tab the first tab in the user's Desktop, you need to move it to be first in the select list in the display profile.



To Add a Tab to JSPTabContainer

A tab is represented by a table container. (A tab can be any container type but in general a table container is sufficient). To add a new tab, you must first define the container, then register that container in JSPTabContainer, which "houses" the tabs.

  1. Create the necessary display profile.

    1. Define the new collection within <Collection name="TabProperties"> in JSPTabContainer, for example:


      ...
      <Collection name="TabProperties">
        <Collection name="NewTabPanelContainer">
          <String name="title" value="My Front Page"/>
          <String name="desc" value="Your front page"/>
          <Boolean name="removable" value="false"/>
          <Boolean name="renamable" value="true"/>
          <Boolean name="predefined" value="true"/>
        </Collection>
      ...
      </Collection>
      ...

    2. Add entries to the <Available> and <Selected> tags, for example:


      ...
      <Available>
        <Reference value="NewTabPanelContainer"/>
      ...
      </Available>
      ...
      <Selected>
        <Reference value="NewTabPanelContainer"/>
      ...
      </Selected>
      ...

    3. 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>

  2. Load the display profile into LDAP by using the dpadmin command.

    See "Guidelines for Using the dpadmin Command".

  3. 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.

One limitation is that all the tabs inside a tab container should be of the same type, that is, all the tabs should be table containers, or all the tabs should be tab containers, or all the tabs should be single containers. In other words, a tab container cannot contain one table container and two single containers, for example.



Note You can get around this limitation by overriding the processEdit() method and performing your own processing for the Make New Tab page.



To Stretch a Tab Across an Entire Container

Figure 6-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 6-1    Tab Spanning Entire Container
Tab spanning entire container.

  1. Edit the display profile and make the width of the Nested Tab Container full_top in the Table Container so that it stretches across the entire page.

  2. Load the display profile into LDAP by using the dpadmin command.

    See "Guidelines for Using the dpadmin Command".



    Note If the width property is defined with the advanced=false attribute, then it is visible in the iPlanet Directory Server Access Management Edition admin console and you can change it there. See "To Change the Desktop Column Layout (iPlanet Directory Server Access Management Edition Admin Console)".



To Change the Look of Tabs for JSP-based Tab Containers

You can customize the look of tabs as they use images.

  1. Change directories to the JSP tab container directory.

    For example,

    cd /etc/opt/SUNWps/desktop/default/JSPTabContainer

  2. Modify the tabs.jsp and selectedTab.jsp files to use different images.

    The images are tabNotch.gif and nothing.gif, and the lines to change look like this:


    <td valign="top" rowspan="3"><img src="<dt:scontent/>/desktop/tabs/images/tabNotch.gif" alt=""></td>
    <td bgcolor="#FFFFFF" rowspan="3"><img src="<dt:scontent/>/desktop/images/nothing.gif" width="4" height="1" alt=""></td>

    Replace <dt:scontent/>/desktop/tabs/images/tabNotch.jpg and <dt:scontent/>/desktop/tabs/images/nothing.gif with a reference to an alternate image.

    For example, if you use /opt/SUNWam/public_html/images/newimage.gif, then use /images/newimage.gif as your replacement text. The <dt:scontent/> tag references image files from the Sun ONE Portal Server web application archive. Your own custom images need to be placed elsewhere, so the <dt:scontent/> tag is not used.

  3. Place your file in the appropriate directory.

    You can place your custom image files under the web server document root, by default /opt/SUNWam/public_html, 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.

  4. Run the touch command on the container's top-level JSP file.

    For example,

    touch tab.jsp

  5. 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.

  1. Edit the display profile for the appropriate container.

  2. Change the startTab property to the tab you want to be hightlighted when the user logs in. For example:

    <String name="startTab" value="MyFrontPageTabPanelContainer"/>

  3. Load the display profile into LDAP by using the dpadmin command.

    See "Guidelines for Using the dpadmin Command".

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

  1. To add a role-based tab for a user, define a role level display profile, which has the JSPTabContainer definition.

  2. 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 then clicking the Make a New Tab link. If you want to add a new channel for all the tabs that users can add to their Desktop, add the channel to the defaultChannelList property in JSPTabContainer.

Customizing Channels

This section describes how customize channels. See the Sun ONE Portal Server 6.0 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.

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

    For example:


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

  2. The values are:

  3. all_new (New window is opened for every link)

  4. one_new (All links open on the same new window)

  5. same (Desktop window)

  6. 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

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

  2. Add the appropriate property (within the <Properties> </Properties>) tags of the container's display profile you selected in Step 1) from Table 6-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, Help, Edit, Detach, and Remove.


    Table 6-1    Channel Buttons and Corresponding Properties

    Button

    Property to Hide the Button

    Minimize  

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

    Help  

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

    Note: You must insert this property for each channel. You cannot insert this property within the container's <Properties> </Properties> tags.  

    Edit  

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

    Note: You must insert this property for each channel. You cannot insert this property within the container's <Properties> </Propterties> tags.  

    Detach  

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

    Remove  

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

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


    <Collection name="channelsIsRemovable">..</Collection>
    <Collection name="channelsIsMinimizable"/>..</Collection>
    <Collection name="channelsIsDetachable"/>..</Collection>

  3. Load the display profile into LDAP by using the dpadmin command.

    See "Guidelines for Using the dpadmin Command".

To Remove a Button From a Single Channel

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

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


    Table 6-2    Channel Buttons and Corresponding Properties

    Button

    Property to Hide the Button

    Minimize  

    <Collection name="channelsIsMinimizable">

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

    </Collection>

     

    Detach  

    <Collection name="channelsIsDetachable">

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

    </Collection>

     

    Remove  

    <Collection name="channelsIsRemoveable">

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

    </Collection>

     



    Note See Table 6-1 for information on the Help and Edit buttons.



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

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


    <Container name="MyFrontPageFramePanelContainer" provider="JSPTableContainer
    Provider">
        <Properties>
    ...
        <Collection name="channelsIsRemovable">
            <Boolean name="SampleJSP" value="false"/>
        </Collection>
        </Properties>
    ...

  3. Load the display profile into LDAP by using the dpadmin command.

    See "Guidelines for Using the dpadmin Command".

Creating Customized Organization JSP and Template Files

If 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

  1. Change directories to the Desktop JSP/template directory.

    For example,

    cd /etc/opt/SUNWps/desktop

  2. Create a new directory for your organization's JSPs and templates.

    For example,

    mkdir sesta

  3. Copy the existing JSPs and templates to be customized from the default directory to this newly created directory.

    For example, to copy all the files,

    cp -pr default/* sesta/

  4. Customize the JSPs templates in the sesta directory as required.

    See instructions in this chapter for the various types of customizations you can perform.

  5. Change the dynamic Desktop Type attribute in the iPlanet Directory Server Access Management Edition admin console to use the newly created directory.

    See "To Change the Desktop Type" for more information.

Customizing the Anonymous Desktop

This 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 /opt/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 supports two methods for implementing anonymous authentication:

  • Authentication-less User ID attributes - Users accessing the Desktop URL are automatically authenticated and granted access to the Desktop.

  • Anonymous user session - Users select Anonymous from the Authentication menu, log in as the user anonymous, and are granted access to the Desktop.

When you install Sun ONE Portal Server, 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:

  • Authorized Authentication-less User IDs

  • Default Authentication-less User ID

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.0 Administrator's Guide for more information on enabling and disabling anonymous authentication.

To Enable Anonymous Log In

  1. Log in to the iPlanet Directory Server Access Management Edition admin console as administrator.

  2. Register the Anonymous service for the selected organization and create its template.

  3. Add Anonymous to the Authentication menu in the Core service (for the selected organization).

  4. Create the anonymous user account for the selected organization.

To Disable Anonymous Log In

  1. Log in to the iPlanet Directory Server Access Management Edition admin console as administrator.

  2. Unregister the Anonymous service for the selected organization.

  3. Remove Anonymous from the Authentication menu in the Core service (for the selected organization).

  4. Remove the anonymous user account for the selected organization.

To Enable Authentication-less (authlessanoymous) Log In

  1. Log in to the iPlanet Directory Server Access Management Edition admin console as administrator.

  2. Create the auhthlessanonymous account with a password of authlessanonymous for the selected organization.

  3. Select Service Management from the View menu.

  4. Click the properties icon arrow beside Desktop.

    The Desktop attributes page appears in the data pane.

  5. Add the following value to the Authorized Authentication-less user IDs attribute:


    uid=authlessanonymous,ou=People,o=organization,o=isp|authlessanonymous

    Substitute the appropriate organization name for organization.

  6. Set the Default Authentication-less user ID attribute to the following:


    uid=authlessanonymous,ou=People,o=organization,o=isp

    Substitute the appropriate organization name for organization.

  7. Log out from the iPlanet Directory Server Access Management Edition admin console.

  8. Verify that authentication-less authentication works.

    Close all current browsers and start a new browser with the following URL:

    http://server:port/portal/dt

    The anonymous Desktop should appear.

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

  1. Log in to the iPlanet Directory Server Access Management Edition admin console as administrator.

  2. Select Service Management from the View menu.

  3. Click the properties icon arrow next to Desktop.

    The Desktop attributes page appears in the data pane.

  4. Remove the value(s) from the Authorized Authentication-less user IDs attribute.

  5. Remove the value from the Default Authentication-less user ID attribute so that it is blank.

  6. Verify that you cannot reach the Anonymous Desktop.

    Close all current browsers and start a new browser with the following URL:

    http://server: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 Portal 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 /opt/SUNWam/servers/https-psservername/config/obj.conf file.

  1. Edit the web server's obj.conf file.

  2. 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://psservername:port/portal/dt?desktop.suid=uid=authlessanonymous,ou=
    People,o=organization,o=isp"


    For anonymous:


    NameTrans fn="redirect" from="/index.html" url=http://psservername:port/amserver/login?org=organization&module=Anonymous

    For a specific organization:


    NameTrans fn="redirect" from="/index.html" url="http://psservername:port/amserver/login?organization

    Make sure psservername is the fully qualified domain name of your Sun ONE Portal Server host, and organization is the name of the appropriate iPlanet Directory Server Access Management Edition organization.



    Note For anonymous, you must also make sure that only Anonymous authentication is enabled in the iPlanet Directory Server Access Management Edition admin console.



  3. Save the file and restart Sun ONE Portal Server.

    /etc/init.d/amserver start

    Users can now view the Anonymous Desktop by typing the Sun ONE Portal Server 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, you add some JavaScript™ to the web server's index.html file in the /opt/SUNWam/public_html directory.

  1. Add the following Javascript to the index.html file. This example assumes that /portal/dt is the user's redirect URL.


    <HTML>
    <HEAD>
    <SCRIPT>
    document.location.href="/portal/dt?psdt.suid=uid=authlessanonymous,ou=
    People,o=organization,o=isp"
    <-- for authless anonymous

    </SCRIPT>
    </HEAD>
    </HTML>

  2. Verify that you can now access the Desktop by just typing the server name in the browser.

To Disable the Initial iPlanet Directory Server Access Management Edition Login Page and Always Use Anonymous Log In

  1. Log in to the iPlanet Directory Server Access Management Edition admin console as administrator.

  2. Choose Organizations from the Show menu in User Management.

    All created organizations display in the navigation pane.

  3. Navigate to the default organization or sub-organization.

    Use the Show menu in the navigation pane and the Location path in the Location pane.

  4. Choose Services from the Show menu.

  5. Click the Properties icon next to Core.

  6. For the Authentication Menu, make sure Anonymous is selected and deselect all other entries.

  7. Click Save.

  8. Create the anonymous user. With the desired organization selected, choose Users from the Show menu.

  9. Click New.

  10. Select the services for the anonymous user.

    Typically, you select Desktop and NetMail.

  11. Type in the Create User screen with the following information.

    • UserID - anonymous

    • First Name - (blank)

    • Last Name - anonymous

    • Full Name - anonymous

    • Password - anonymous

    • Password (confirm) - anonymous

  12. Click the create button to create the user.

  13. When users type the URL to access the portal server in a browser, the anonymous Desktop comes up, bypassing the iPlanet Directory Server Access Management Edition 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.

  1. Edit the banner.template file.

  2. 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 /opt/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 web application archive. Your own custom images need to be placed elsewhere, so the [surl:] tag is not used.

  3. Place your file in the appropriate directory.

    You can place your custom image files under the web server document root, by default /opt/SUNWam/public_html, 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.

  4. Modify the menubar.template file. You could also make a new menubar.template file to replace the default one.

Adding 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:

  1. Use the iPlanet Directory Server Access Management Edition admin 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.0 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.

  2. In the iPlanet Directory Server Access Management Edition admin console, choose Organizations from the Show menu in User Management.

  3. Navigate to the newly created organization.

  4. Create a user account for the authless session.

    1. Choose Users from the Show menu then click New.

    2. Select Desktop and NetMail for services then click Next.

      The Create User page opens in the data pane.

    3. Type values for the required fields. This example uses authlessanonymous as the user ID and authlessanonymous as the password.

    4. When done click Create.

      The authlessanonymous user ID appears in the list of users.

  5. Add the authlessanonymous user ID to the list of authorized users for the global Desktop service.

    1. Choose Service Management from the View menu.

    2. Click the Properties arrow icon next to Desktop.

      The Desktop attributes page opens in the data pane.

    3. Type the following for the Authorized Authentication-less User IDs attribute:

uid=authlessanonymous,ou=People,o=sesta.com,o=isp|authlessanonymous

    1. Click Add.

    2. Click Save.

  1. 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,o=company22.com,o=isp" -w password -d "o=sesta.com,o=isp" /opt/SUNWps/samples/desktop/dp-org.xml

  2. Copy the sample anonymous display profile, dp-anon.xml, to a new file.

    For example,


    cd /opt/SUNWps/samples/desktop
    cp -r dp-anon.xml dp-anon-sesta.xml

    You do not want to modify the sample dp-anon.xml file, as this will cause problems with your sample portal.

  3. 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">



    Note Do not change LoginProvider to LoginSestaProvider. The provider name must stay the same.



  4. 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,o=company22.com,o=isp" -w password -d "uid=authlessanonymous,ou=People,o=sesta.com,o=isp" dp-anon-sesta.xml

  5. Create the channel templates for the new login channel.

    1. Change directories to the /etc/opt/SUNWps/desktop/default directory.

      cd /etc/opt/SUNWps/desktop/default

    2. Copy the Login directory contents to a new directory, LoginSesta.

      cp -r Login LoginSesta

    3. Change directories to the LoginSesta directory.

      cd /etc/opt/SUNWps/desktop/default/LoginSesta

    4. 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).

    5. 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.

  6. Set the Desktop type for the authless user.

    1. In the iPlanet Directory Server Access Management Edition admin console, select the newly created organization.

    2. Choose Users from the Show menu.

    3. Click the Properties arrow icon next to the authlessanonymous user ID.

    4. Select Edit at the end of the Desktop line in the data pane.

    5. In the popup window, type anonymous in the Desktop Type field and select Customize in the drop-down menu next to the text field.

    6. Click Save.

  7. Access the authless anonymous Desktop for the new organization by typing the following URL:


    http://psserver:port/portal/dt?desktop.suid=uid=authlessanonymous,ou=People,o=sesta .com,o=isp

Customizing Authentication

Sun ONE Portal Server supports a number of authentication schemes, including LDAP, anonymous, membership, UNIX, and more. See the Sun ONE Portal Server 6.0 Administrator's Guide for information on configuring authentication, as well as users and roles.

To Use Unix Authentication with LoginProvider

  1. Change directories to the default/Login directory.

    For example:

    cd /etc/opt/SUNWps/desktop/default/Login

  2. Copy the display_UnixAuth.html file to display.html.

    For example,

    cp display_AuthUnix.html display.html

  3. Register and enable Unix authentication service for the organization.

    See the Sun ONE Portal Server 6.0 Administrator's Guide for details.

  4. Add Unix to the Non Interactive Modules in the Core service.



    Note To use LDAP authentication, the authentication module is already enabled for the default organization. You only need to rename display_AuthLDAP.html to display.html.



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:

  1. Use an LDAP editor (or ldapmodify command) to edit the iplanet-ps-desktop-default-channel-name attribute to the desired value under the uid=authlessanonymous,ou=People,o=organization,o=isp entry.

  2. Users should log out and log in to the Desktop to view the change.

Modifying the Desktop Layout

This 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:

  • thin-wide (two columns)

  • wide-thin (two columns)

  • thin-wide-thin (three columns)

  • full_top (one column spans the width of the Desktop at the top of the page)

  • full_bottom (one column spans the width of the Desktop at the bottom of the page)

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:

  • full_top-thin-wide/full_top-wide-thin/full_top-thin-wide-thin

  • thin-wide-full_bottom

  • fulltop-thin-wide-full_bottom (This layout is a combination of the first two with full_top at the top and full_bottom at the bottom.)

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.0 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)

  1. Modify the width property to change the layout of the channel column. Specify one of the following:

    • thin - The channel appears in one of the thin columns.

    • thick - The channel appears in one of the wide columns.

    • full_top - The channel appears at the top spanning the entire horizontal space.

    • full_bottom - The channel appears at the bottom spanning the entire horizontal space.

    For example, the following specifies that a channel appears at the top spanning the entire horizontal space:

    <String name="width" value="full_top"/>

  2. 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 iPlanet Directory Server Access Management Edition admin 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 (iPlanet Directory Server Access Management Edition Admin Console)

If the width property is defined with the advanced=false attribute, then it is visible in the iPlanet Directory Server Access Management Edition admin console and you can change it there.

  1. Log in to the iPlanet Directory Server Access Management Edition admin console as administrator.

  2. Navigate to User Management by choosing View User Management.

  3. Select the appropriate organization or suborganization.

  4. Choose Services from the Show menu.

  5. Select the properties arrow next to Desktop in the navigation pane.

    The Desktop attributes appear in the data pane.

  6. Click Channel and Container Management.

    The Channels page appears, with the container path set at the root. The defined channels appear in a list.

  7. Select the Edit link beside the channel to be modified.

    The Properties page appears.

  8. Modify the width property.

    The possible values are thin, thick, full_top, and full_bottom.

  9. Click Save.

To Change the Channel Layout for a Table Container

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

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

    where value is:

    1 = Thin-wide, two columns

    2 = Wide-thin, two columns

    3 = Thin-wide-thin, three columns

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

    For example:


    dpadmin modify -u "uid=amAdmin,ou=People,o=sesta.com,o=isp" -w password -g dp-providers.xml



    Note You can also use the iPlanet Directory Server Access Management Edition admin console Channel and Container Management link for the Desktop service to change the channel layout.



To Remove the Title Bar from a Channel

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


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

  2. Load the display profile into LDAP by using the dpadmin command.

    See "Guidelines for Using the dpadmin Command".

To Change the Channel Border Width

This procedure changes the border width for all channels in a container.

  1. 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

  2. Edit leafWrapper.jsp.

    Change the cellpadding to not use the borderWidth from theme. The line to change is:


    CELLPADDING=<dttheme:getAttribute name="borderWidth"/>

    For example, you might use CELLPADDING=2 in place of this line.

  3. 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. See "Adding and Customizing Global Themes" for more information.



To Customize the Channel Border

Use this procedure to customize channel borders to have bevelled edges, shadows, curved corners, and so on.

  1. 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

  2. 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.

  3. 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 Desktop

This 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)

  1. Change to the appropriate container directory.

    For example, for JSPTabContainer,

    cd /etc/opt/SUNWps/desktop/default/JSPTabContainer

    Or, for JSPTableContainer,

    cd /etc/opt/SUNWps/desktop/default/JSPTableContainerProvider

  2. Edit the header.jsp file and modify the following line:


    <TITLE>Sun ONE Portal Server 6.0</Title>

    Replace Sun ONE Portal Server 6.0 with your name and save the file.

  3. Run the touch command on the container's top-level JSP file.

    For example,

    touch tab.jsp

  4. Reload the Desktop to verify the change.

To Change the Logo (Image) in the Banner Header

  1. Change to the appropriate container directory.

    For example, for the JSPTabContainer,

    cd /etc/opt/SUNWps/desktop/default/JSPTabContainer

  2. Edit the header.jsp file and modify the following line:


    <td bgcolor="#333366"><img src="<dt:scontent/>/images/productName.jpg" width="274" height="38" alt="Sun ONE Portal Server"></td>

    Replace <dt:scontent/>/images/productName.jpg with a reference to an alternate image.

    For example, if you use /opt/SUNWam/public_html/images/newimage.gif, then use /images/newimage.gif as your replacement text. The <dt:scontent/> tag references image files from the Sun ONE Portal Server web application archive. Your own custom images need to be placed elsewhere, so the <dt:scontent/> tag is not used.

  3. Place your file in the appropriate directory.

    You can place your custom image files under the web server document root, by default /opt/SUNWam/public_html, 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.

  4. Run the touch command on the container's top-level JSP file.

    For example,

    touch tab.jsp

  5. Reload the Desktop to verify the change.

To Change the Product Name in the Footer

  1. Change to the appropriate container directory.

    For example, for the JSPTabContainer,

    cd /etc/opt/SUNWps/desktop/default/JSPTabContainer

  2. Edit the menubar.jsp file and modify the following line:


    <TD VALIGN="MIDDLE" NOWRAP>
           <FONT
             COLOR="#FFFFFF"
             FACE="SANS-SERIF">
             &nbsp;<B>Sun ONE Portal Server 6.0</B>

    Replace Sun ONE Portal Server 6.0 with your name and save the file.

  3. Run the touch command on the container's top-level JSP file.

    For example,

    touch tab.jsp

  4. 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:

  1. Use the Table 6-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 6-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 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.



  2. Change to the appropriate directory.

    For example,

    cd /etc/opt/SUNWps/desktop/default

  3. Edit the JSP files.

    For example, change the HTML title and logo in the header file, and change the product name in the footer.

  4. Run the touch command.

    For example,

    touch *.jsp

  5. Reload the Desktop to verify the change.

Changing Desktop Colors

This 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

  1. 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 and the files to edit in the second column


    Table 6-4    Files to Customize to Change Desktop Colors  

    Desktop Component to Customize

    File to Edit in /etc/opt/SUNWps/desktop/default/

    Header background color  

    JSP-based containers:

    ./JSPSingleContainerProvider/header.jsp
    ./JSPTabContainer/header.jsp
    ./JSPTableContainerProvider/header.jsp

    Frame-based containers:

    ./FrameTabContainer/banner.jsp  

    Footer background color  

    JSP-based containers:

    ./JSPSingleContainerProvider/menubar.jsp
    ./JSPTabContainer/menubar.jsp
    ./JSPTableContainerProvider/menubar.jsp

    Frame-based containers:

    ./FrameTabContainer/menubar.jsp  

    Font color in the header and footer  

    /opt/SUNWps/web-apps/https-psservername/portal/desktop/css/style.css  

    Selected tab color  

    JSP-based containers:

    ./JSPTabContainer/selectedTab.jsp

    Frame-based containers:

    ./FrameTabContainer/selectedTab.jsp  

    Content Page color  

    ./JSPContentContainer/contentLayoutBar.jsp
    ./JSPEditContainer/contentLayoutBar.jsp
    ./JSPLayoutContainer/contentLayoutBar.jsp
    ./TabJSPEditContainer/contentLayoutBar.jsp
     

    Layout Page color  

    ./JSPLayoutContainer/layoutedit.jsp  

    Desktop body  

    ./JSPTableContainerProvider/tabtable.jsp  

  2. Edit the appropriate file.

    In almost all case, you make modifications to the bgcolor=value statement to change the color. In the case of the font color in the header and footer, you change .banner-links {.....color: #ffffff;....}.

  3. 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.)

  4. 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 the Desktop Type attribute for that organization. See the Sun ONE Portal Server 6.0 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.

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.



Note Currently, when using global themes, you are able to modify the background color, title bar color, font color, and channel border color. However, you cannot use global themes to modify the title color. For example, if the title color is set to black (in the JSP files), then you cannot use the global themes, since a black title is not properly visible on a blue title bar.

Also, currently the title color is set to #ffffff (white). If you want to change the title color, it, edit the leafWrapper.jsp file in the JSPTableContainerProvider, JSPFrameCustomTableContainerProvider, and JSPTabCustomTableContainerProvider directories. This change applies to all the users for one Desktop type.



To Customize the Current Themes

  1. Change the theme values in the display profile.

    In the sample portal, the /opt/SUNWps/samples/desktop/dp-org.xml file defines two themes, theme1 and theme2. The following display profile XML fragment shows these themes.


    <Collection name="GlobalThemes" propagate="false">
        <Collection name="theme1">
            <String name="description" value="Sun ONE"/>
            <String name="bgColor" value="#FFFFCC"/>
            <String name="titleBarColor" value="#330066"/>
            <String name="fontColor" value="#330066"/>
            <String name="borderColor" value="#FF9933"/>
            <String name="borderWidth" value="1"/>
            <String name="fontFace" value="Verdana"/>
        </Collection>
        <Collection name="theme2">
            <String name="description" value="Sun"/>
            <String name="bgColor" value="white"/>
            <String name="titleBarColor" value="#666699"/>
            <String name="fontColor" value="black"/>
            <String name="borderColor" value="#9999CC"/>
            <String name="borderWidth" value="5"/>
            <String name="fontFace" value="Sans-serif"/>
        </Collection>
    </Collection>

  2. When done making your modifications, load the display profile into LDAP by using the dpadmin command.

    See "Guidelines for Using the dpadmin Command".

To Add a Theme to the Sample Portal

  1. 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="theme3">
        <String name="description" value="Blues With a Feeling"/>
        <String name="bgColor" value="blue"/>
        <String name="titleBarColor" value="#666699"/>
        <String name="fontColor" value="red"/>
        <String name="borderColor" value="#9999CC"/>
        <String name="borderWidth" value="5"/>
        <String name="fontFace" value="Serif"/>
      </Collection>
    </Collection>

  2. Run the dpadmin command with the modify subcommand to load the display profile.

    For example:


    /opt/SUNWps/bin/dpadmin modify -m -u "uid=amAdmin,ou=People,o=sesta.com,o=isp" -w password -d "o=sesta.com,o=isp" newtheme.xml

    This example uses the combine (-m) argument with the modify subcommand, because you need to combine the new collection (theme3) with the existing ones.

  3. Verify that the new theme shows up on the Desktop's Theme page.

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.

    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="theme3">
        <String name="description" value="Blues With a Feeling"/>
        <String name="bgColor" value="blue"/>
        <String name="titleBarColor" value="#666699"/>
        <String name="fontColor" value="red"/>
        <String name="borderColor" value="#9999CC"/>
        <String name="borderWidth" value="5"/>
        <String name="fontFace" value="Serif"/>
      </Collection>
    </Collection>

  2. Run the dpadmin command with the add option 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

Miscellaneous JSP Information

This 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).toString() +
    "?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).toString() +
"?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" for information on how to find the top-level (parent) JSP.




Previous     Contents     Index     Next     
Copyright 2002 Sun Microsystems, Inc. All rights reserved.

Last Updated August 29, 2002