Sun Java System Portal Server 7.1 Developer Sample Guide

Changing the Desktop Type

You should also create a custom desktop type for your users. The desktop type attribute of the desktop service is a comma-separated string. It is still a string type, but the desktop uses it as an ordered desktop type list. The list is used by the desktop lookup operation when searching for templates and JSPs. The lookup starts at the first element in the list and each element represents a sub directory under the desktop template base directory. If a template is not found in the first directory, then it proceeds to the next one in the list. This continues until the item is found (or not), for all desktop type elements in the list.

If the default directory is not included in the list, it will be added at the end of the list implicitly. For example, if the desktop type is developer_sample, the target template will be searched in the developer_sample sub directory, then the default sub directory.

By default, if the developer sample is installed, then the desktop type attribute is set to developer_sample, meaning files are retrieved from the developer_sample subdirectory. If the Developer Sample is not installed, then the desktop type attribute value is set to default. The authless user is created as part of the sample portal, and the desktop type for the authless user is set to developer_anonymous_sample,developer_sample.

You can define a new set of templates by creating a new directory under the PortalServer-DataDir/portals/portal-ID/desktop/ directory, placing your template files in this directory, and making this directory the Desktop Type attribute for that organization.

ProcedureTo change the Desktop type

  1. Create a new subdirectory in the PortalServer-DataDirportals/portal-ID/desktop directory.

    For example:


    mkdir PortalServer-DataDir/portals/portal-ID/desktop/sesta
  2. Manually copy only the template files that you wish to modify to the new directory location.

    For example, if your Desktop type will modify content.jsp file for JSPProvider, copy this file to PortalServer-DataDir/portals/portal-ID/desktop/sesta/JSPProvider/content.jsp, and customize the file for the new Desktop type in that location.

    You only need to copy the files that you have changed from the sample installation to the new directory tree. This structure enables you to tell at a glance which files have been modified from the original distribution. It also eliminates the need to back up copies of the original sample files.

  3. Use the Portal Server software management console to change the value of the Desktop Type attribute for the subdirectory created in step 1.

    As this attribute is a Dynamic Access Manager service attribute, you need to change it everywhere that it appears (organization, sub-organization, role, and user). Changing the Desktop Type at the organization level will not necessarily be reflected at the user level. This will be the case only if the user has not overwritten the Desktop Type in which case the Desktop Type value will be inherited from the organization level. If the user defines the Desktop Type at the user level, the value will remain the same even if the Desktop Type is changed at the organization level.

    In this example, in the Portal Server management console, you would specify sesta as the value for the Desktop Type attribute.