Sun Java System Portal Server 7 Developer's Guide

Display Profile Properties

The display profile can be modified by using XML files that are input to the dpadmin command. The encoding for display profile XML file is specified using the following XML header at the top of the file:

<?xml version="1.0" encoding="encoding"?>

where encoding is whatever encoding is suitable for the content of the file. Typically, the encoding is UTF-8; but it can also be other native encodings such as SJIS or ISO-8859-1. The DesktopServlet always converts characters internally to Unicode and stores them in the directory using UTF-8.

Every XML fragment must include a XML header and a doctype declaration as shown below:

<?xml version="1.0" encoding="encoding" standalone="no"?>
<!DOCTYPE DisplayProfile SYSTEM "jar://resources/psdp.dtd">

The display profile contains text strings for items such as channel titles and descriptions. These strings can be localized using the ConditionalProperties locale element.

For example, the user information channel is defined by the following element in the display profile:


<Channel name="UserInfo" provider="UserInfoProvider">
    <Properties>
        <String name="refreshTime" value="60" advanced="true"/>
        <String name="title" value="User Information"/>
        <String name="description" value="View/Edit User Information"/>
    </Properties>
</Channel>

ProcedureTo Localize the User Information Channel Display Profile

Steps
  1. To localize the user information channel (title and description), the conditional properties tag for the locale must be added. For example, the following modifications must be included (modifications are shown in bold):


    <Channel name="UserInfo" provider="UserInfoProvider">
        <Properties>
            <String name="refreshTime" value="60" advanced="true"/>
            <String name="title" value="User Information"/>
            <String name="description" value="View/Edit User Information"/>
    
                              <ConditionalProperties condition="locale" value="fr" >
    
                                  <String name="title" value="User Information in French"/>
    
                                  <String name="description" value="View/Edit User Information in French"/>
    
                              </ConditionalProperties>
        </Properties>
    </Channel>
  2. To add this, the following sample display profile fragment (stored in file dp-locale.xml) is needed:


    <?xml version="1.0" encoding="utf-8" standalone="no"?>
    <!DOCTYPE DisplayProfile SYSTEM "jar://resources/psdp.dtd">
        <ConditionalProperties condition="locale" value="fr" >
            <String name="title" value="User Information in French"/>
            <String name="description" value="View/Edit User Information in French"/>
        </ConditionalProperties>
  3. Upload the display profile fragment using the psadmin with the add-display-profile subcommand.

    See the Command Line Reference for more information on this subcommand.