Sun Java System Portal Server 7.1 Community Sample Guide

Customizing the User Interface

This section contains the following:

ProcedureTo Use Sun Java Web User Interface Theme in a Page

    In the JSP files that generate the <head> section of the HTML (or the header.jsp file), you can designate a Sun Java Web User Interface Components theme to be used for the entire page. For example:


    <pui:setupTheme themeName="defaulttheme" .../>

    To use Sun Java Web User Interface Components theme in a page, the porletSetupTags.tld tag library descriptor file must be included; otherwise, the <pui:setupTheme...> will fail. This file must be located where the JSP files can access it. For example, in the community sample, it is located at PortalServer-DataDir/portals/portal-ID/desktop/community_sample/tld directory.

ProcedureTo Modify or Create a New Sun Java Web User Interface Theme

  1. Make a copy of defaulttheme.jar file. For example, copy this file to PortalServer-DataDir/portals/portal-ID/.

  2. Unpack the defaulttheme.jar file and modify the following files (as needed).

    • CSS files

    • Image Files

    • Javascript

    • Properties Files

    For more information on these files, see the Theme for Sun Java Web User Interface Components Tech Note. When modifying the defaulttheme.jar file, leave the manifest file intact.

  3. Make a JAR of the files and change the server classpath to point to the new location.

    When packaging the theme into a JAR file, specify an existing manifest file. For example, type jar cmf META-INF/MANIFEST.mf com to retain the original manifest file. This command will prevent the jar command from auto-generating a new manifest file.

    For example, change classpath from PortalServer-base/lib/defaulttheme.jar to PortalServer-DataDir/portals/portal-ID/defaulttheme.jar.

    In a multi-portal environment, you can:

    • Have all portals point to a single theme.jar file.

    • Or, have each portal associated with its own theme.jar file.

      For example:

      • The web container serving portal1 can have its server classpath pointing to PortalServer-DataDir/portals/portal1/theme/portal1theme.jar file.

      • The web container serving portal2 can have its server classpath pointing to PortalServer-DataDir/portals/portal2/theme/portal2theme.jar file.

  4. Restart the web container for the changes to take effect and reload the Community Sample in your browser to see the changes.


    Tip –

    It is not neccessary to have the theme in a JAR file format. Alternatively, you can set up the server classpath to include the directory containing the exploded theme hierarchy. This is especially useful during development cycles since it allows you to edit individual files and see the result instantly reflected.

    Changes in properties file require a web container restart; changes to Javascript, images, and CSS files will be reflected without restarting the server.