Sun Java logo     Previous      Contents      Index      Next     

Sun logo
Sun Java System Portal Server 6 2005Q1 Desktop Customization Guide 

Chapter 3
Creating a New Desktop

Creating a new Desktop involves the following:


Developing the Container

You can develop a container by:

  1. Defining a <Container> element in the display profile that references an existing <Provider> element.
  2. Defining a <Provider> element in the display profile that references an existing provider class. You also must do Step 1.
  3. Defining a container provider class that extends an existing container provider such as JSPTableContainerProvider. You also must do Step 2.
  4. Defining a container provider class from scratch that extends ContainerProviderAdapter. You also must do Step 2. If you create a container by extending the Provider class, then it also needs to implement the ContainerProvider interface.

  5. Note

    You cannot create a container provider by just extending the Provider class. By definition, a container must implement the ContainerProvider interface. ContainerProviderAdapter does this. See the Portal Server Developer’s Guide for more information on creating custom container providers.


If you write a new class file, it must reside in the /etc/opt/SUNWps/desktop/classes directory. You can change this location by editing the /etc/opt/SUNWps/desktop/desktopconfig.properties file.


Note

You can also use the Access Manager software administration console to manipulate containers.



Editing the Display Profile

You need to edit the display profile XML and modify the following tag:

<Provider name="provider" class="provider class">

You also need to modify the following tag, which references the provider in the previous sentence:

<Container name="container" provider="provider">

For JSP files, the <Properties> tag for the provider contains the following property tag, which references the JSP Content page:

<String name="contentPage" value="value">

The <Properties> tag for the channel can have values that override the properties set in the <Provider> tag. Thus, if desired, you could set the JSP contentPage value here. You do not reference template-based providers, or other providers you might develop, in this way.

The <Available> and <Selected> tags are required for all containers in the display profile.

The JSP-based tab, table, and frametab containers have additional properties requirements.


Note

There is a distinction between a provider element in the display profile and the Java class for the provider.

Provider element:

<Provider name="JSPTableContainer" class=com.sun.portal.providers.containers.jsp.table.JSPTa bleContainerProvider>

Java class:

com.sun.portal.providers.containers.jsp.table.JSPTableCon tainerProvider


You can modify display profile objects by performing one of the following:

For more information on display profile and the dpadmin command, see the Portal Server Technical Reference Guide.


Developing and Deploying JSP or Template Files

You can modify existing JSP files (for example, tabs.jsp) or template files, or develop with your own. If you install the sample portal, the JSP and template files are located in the /etc/opt/SUNWps/desktop/sampleportal directory, in different subdirectories for each container.

See the Portal Server Technical Reference Guide for more information on the sample JSP and template files.

For the JSPs, you can find compilation and runtime errors in the desktop debug log at /var/opt/SUNWam/debug/desktop.debug. Also, all JSPProvider based Desktop channels have a property called showExceptions. By default, this property is set to false; setting it to true causes the JSP exception to show up as the content of the channel.

When you create a container, you need to create a new subdirectory for your newly created container in the /etc/opt/SUNWps/desktop/desktopType directory. That is, the newly created container should be placed based on what the desktopType is. If sampleportal is installed, then the desktopType is, by default, sampleportal; so, create a new directory for the container under sampleportal so that any JSP and template that is being added can adopt the same look and feel that as defined in the sampleportal. If sampleportal is not installed, and if you have set up a custom desktopType, for example, foo, then the new container directory must be created directory under foo.

Either copy the modified JSP or template files here, or place your newly created files here. If you use a sample container without changing any content or file names, you do not need to create a new subdirectory nor copy any files there. (In the example that follows, a new subdirectory is needed, because a new container is created.)

For example, let’s say you create a new container called newSingleContainer whose display profile definition is the following:

<Container name="newSingleContainer" provider="JSPSingleContainer">

    <Properties>

        <String name="helpURL" value="desktop/newSingle.html"/>

        <String name="title" value="A new single container"/>

        <String name="contentPage" value="newsinglecontent.jsp"/>

        <Boolean name="isEditable" value="true"/>

        <String name="editType" value="edit_subset"/>

    </Properties>

    <Available/>

    <Selected/>

    <Channels/>

</Container>

Because the file specified for the contentPage property is different from the contentPage value for the provider definition, you need to create a new directory under the /etc/opt/SUNWps/desktop/default directory called newSingleContainer. You then only need to copy the newsinglecontent.jsp file to this new directory. The system is able to locate all other JSPs referenced by the JSPSingleContainer provider.

If desired, rather than customizing the sample portal JSP and template files directly, you can create a separate directory for your organization’s customized files, and perform customizations on those files. This preserves the initially installed portal JSP and template files.

    To Create Customized Organization JSP and Template Files
  1. Change directories to the Desktop JSP or template directory.
  2. For example,

    cd /etc/opt/SUNWps/desktop

  3. Create a new directory for your organization’s JSPs and templates.
  4. For example,

    mkdir sesta

  5. Copy the JSPs and templates that you wish to modify into the new directory location, maintaining the same directory structure.
  6. For example, if your new Desktop type will modify /etc/opt/SUNWps/desktop/default/JSPProvider/content.jsp, copy this file to /etc/opt/SUNWps/desktop/sesta/JSPProvider/content.jsp, and customize the file for the new Desktop type in that location.

  7. Customize the JSPs templates in the sesta directory as required.
  8. Change the dynamic Desktop Type attribute in the Access Manager software administration console to use the newly created directory.
  9. See Changing the Desktop Type for more information.


Loading the Display Profile at the Appropriate LDAP Nodes

Load the display profile at the appropriate LDAP node(s) by using the dpadmin command. You can also use the Edit Display Profile XML text box in the Access Manager software administration console (as long as you are not using Netscape 4.7x) or the Upload link.

See the Portal Server Administration Guide for more information on the dpadmin command, and the Edit Display Profile XML text box and Upload link.


(Optional) Creating a Resource Bundle

If you created a new provider, you may need to create a resource bundle file with the same name as the provider.


Accessing the Desktop

Access the Desktop in one of the following ways.

    To Access the Desktop
  1. Use a specific container or channel reference by using the provider argument to the Desktop login URL:
  2. http://hostname:port/portal/dt?provider=providername

  1. If no channel is referenced, the Desktop looks in the session for the last channel or container that was displayed. (This is stored in the session.)
  2. If no channel is stored in the session, the Desktop looks in a Desktop service attribute for the top-level container to display (Default Channel Name attribute). This happens after an initial login.

Once this top-level container is determined, that container draws the containers or channels that it references (through the Selected list), until all of its leaves have been reached.


Debugging the Desktop

Use the following to help debug the Desktop environment:

The Desktop debug file is located at:

/var/opt/SUNWam/debug/desktop.debug

If you get an error message page on the Desktop, you can view the source to look at the stack trace. (For example, in Netscape Navigator, select Page Source from the View menu.)



Previous      Contents      Index      Next     


Part No: 817-7694.   Copyright 2005 Sun Microsystems, Inc. All rights reserved.