Sun Java System Portal Server 7.2 Developer's Guide

Appendix E Creating Desktops

Editing the Enterprise Sample Portal Files

Do not directly edit any of the files that make up the sample portal (display profile XML, JSP, and template files). Instead, make a copy of the sample portal files to modify to a new directory and then modify those copied files. In this way you preserve the integrity of the sample portal. Additionally, if you later apply a patch to the Portal Server, you will not loose any changes you might have made to the sample portal files, as the patch would only overwrite the initially installed sample files.

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 enterprise_sample, the target template will be searched in the enterprise_sample sub directory, then the default sub directory.

By default, if the Enterprise Sample is installed, then the desktop type attribute is set to enterprise_sample, meaning files are retrieved from the enterprise_sample subdirectory. If the Enterprise Sample is not installed, then the desktop type attribute value is set to default.

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.

Debugging the Enterprise Sample

Use the following to help debug the Enterprise Sample portal desktop environment:

The Desktop debug file is located at PortalServer-DataDir/portals/portal-ID/logs/portal-instance/portal.0.0.log.

If you get an error message page on the desktop, you can view the source to look at the stack trace.

Restoring the Enterprise Sample Default Settings

The Enterprise Sample portal display profile file goes in the o=EnterpriseSample,dc=siroe,dc=com DN and the display profile file is in PortalServer-base/par-src/enterprise_sample/dp directory.

ProcedureTo Reload the Global Sample Display Profile

  1. Create the default portal PAR file.

    For example, typePortalServer-base/bin/psadmin create-par --dir PortalServer-base/par-src/default-portal/ /tmp/default-portal.par

  2. Import the default portal PAR file.

    For example, type PortalServer-base/bin/psadmin import -u amadmin -f password-file -p portal1 --overwrite /tmp/default-portal.par.

ProcedureTo Restore Enterprise Sample Display Profile

  1. Reinstall the Enterprise Sample to restore the Enterprise Sample display profile.

ProcedureTo Define the Login Failed Page

You can specify a custom login failed page when a user fails to authenticate to Portal Server.

  1. Login to the Access Manager console as administrator.

    By default, when you log in, Identity Management is selected in the location pane, and Organizations is selected in the Navigation pane.

  2. Select the EnterpriseSample organization.

  3. Select Services from the View menu.

  4. Click the properties icon arrow next to Core under Authentication Modules.

  5. Specify the login failed URL for the Default Failure Login URL.

    The Enterprise Sample specifies the default login failure URL for the AdventureSports Cafe as http://siroe.com/portal/dt?loginfailed=true. The JSP file that determines what to do with a login failure is PortalServer-DataDir/portals/portal-ID/desktop/enterprise_sample/JSPTabContainer/anonymous.jsp.

  6. Customize the anonymous.jsp file in PortalServer-Datadir/portals/portal-ID/desktop/enterprise_sample/JSPTabContainer directory.

ProcedureTo Define the Logout Page

You can specify a custom logout page for users when they log out of the portal. This is accomplished by using the Access Manager Logout service with the goto parameter specified for the custom logout page. The Enterprise Sample uses this approach when a user logs out of the portal to redirect to the anonymous portal.

  1. Navigate to the directory Navigate to the directory

    /var/opt/SUNWportal/portals/portal-ID/desktop/enterprise_sample

  2. Edit the logout.jsp file.

    For example:


    onClick="location.href=’/amserver/UI/Logout?goto=/logout.html’"

    The Enterprise Sample specifies the custom logout page in the following files:


    PortalServer-DataDir/portals/portal-ID/desktop/enterprise_sample/logout.jsp
    PortalServer-DataDir/portals/portal-ID/desktop/enterprise_sample/error/error.template
    PortalServer-DataDir/portals/portal-ID/desktop/enterprise_sample/error/noneditablechannel.template
    PortalServer-DataDir/portals/portal-ID/desktop/enterprise_sample/error/noprivilege.template
    PortalServer-DataDir/portals/portal-ID/desktop/enterprise_sample/error/unknownchannel.template