![]() | |
Sun Java System Portal Server 6 2005Q4 Technical Reference Guide |
Chapter 34
OverviewThis chapter contains the following sections:
IntroductionTo generate the rendered Desktop user interface (what the industry refers to as the “presentation”), the Sun Java System Portal Server software makes use of either JavaServer Pages (JSP) or template files. JSPs are preferred because they enable a much easier customization process without having to change the provider Java classes. JSPs also provide a way to enable a strict separation of business and presentation logic. Specifically, this means having the business logic in the provider classes and presentation logic in JSPs.
Installation LocationThe default set of JSPs are installed in /etc/opt/SUNWps/desktop/default directory. The sample portal JSPs are installed in /etc/opt/SUNWps/desktop/sampleportal and /etc/opt/SUNWps/desktop/anonymous directories. Files in the /etc/opt/SUNWps/desktop/anonymous directory are specific to the sample portal Anonymous Desktop.
The Desktop and JavaServer PagesThe JSPProvider class reads in the JSP, compiles it, and runs it to produce the channel content.
The JSPProvider class reads at most three JSPs, one for content, one for the Edit page, and one to process the form submission from the Edit page. All other JSPs used in a JSP-based channel are referenced from one of those JSPs, either by an include or a forward statement.
A simple JSP-based channel can have just one JSP. Multiple JSPs are useful when a single part of the Desktop has to be replicated in several places. For example, consider a channel that has several display modes based on links clicked in that channel. Further, assume that the channel has a banner that must be displayed in all modes but one. You could construct a JSP to reference a banner.jsp file that captures common formatting that is used in multiple branches of the logic. If you didn’t use this method, you would need to duplicate the content from the banner.jsp file, which is more difficult to maintain if that content needs to be changed.
File Lookup ScenarioThe Portal Server software uses the lookup scenario outlined in Code Example 34-1 and Code Example 34-2 to find the JSPs it needs. Use this order to decide the final location of your own JSPs.
If there is no clientPath specified, then the directory search order is as follows:
Code Example 34-2 JSP Lookup Scenario
desktoptype_locale/channelname
desktoptype_locale/provider
desktoptype_locale
desktoptype/channelname
desktoptype/provider
desktoptype
default_locale/channelname
default_locale/provider
default_locale
default/channelname
default/provider
default
templateroot
The lookup scenario relies on the following parameters:
desktoptype
For example default (set in the administration console). Note that desktop type is now a comma separated string list and so the look up will be based on the desktop type(s) that are defined in the desktoptype attribute.
locale
Preferred locale is the user’s locale. For example, en_US (set by users through the administration console in the “User” setting)
clientPath
This is an optional file-path containing client-specific templates; for example, html (set through the administration console Client Detection service)
channelname
This is the name of the channel; for example, newSingleContainer (set in the display profile)
provider
This is the provider name; for example, JSPSingleContainerProvider (set in the display profile)
templateroot
This is defined in the desktopconfig.properties file. The root of the search directory (default value of /etc/opt/SUNWps/desktop/) can be changed by modifying the templateBaseDir property in the desktopconfig.properties file.