Sun Java System Portal Server 7.1 Update 1 Community Guide

Customizing the User Interface

This section contains the following:

ProcedureTo Use Sun Java Web User Interface Theme in a Page

  1. In the JSPTM 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

    • JavaScriptTM

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


ProcedureTo Change the defaulttheme to Your customtheme

The Sun Java Web User Interface Components' defaulttheme can be defined in dynamic and static files. To change the defaulttheme to your customtheme, do the following.

  1. Copy the community sample par source files to your custom directory.

    For example, type cp -Rf /opt/SUNWportal/par-src/community_sample /tmp/mypar.

  2. Search for defaulttheme references in your custom directory, and for each file, replace defaulttheme with your customtheme.

    For the Community Sample, defaulttheme is referenced in dynamic and static files.

  3. Create the PAR file.

    For example, type /opt/SUNWportal/bin/psadmin create-par --dir /tmp/mypar /tmp/mypar.par.

  4. Import the PAR file.


    Note –

    Use the --skip-node-validation option if you are importing display profile documents to a user distinguished node. Use the --overwrite option to overwrite the exiting display profile documents and files.


    For example, type /opt/SUNWportal/bin/psadmin import --adminuser amadmin --passwordfile passwordfile --overwrite --skip-node-validation --portal portal1 /tmp/mypar.par.

  5. Redeploy the portal.

    For example, type /opt/SUNWportal/bin/psadmin redeploy --adminuser amadmin --passwordfile passwordfile.