Sun Java System Portal Server 7.1 Community Sample Guide

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.