Sun Java System Portal Server 6 2004Q2 Desktop Customization Guide |
Chapter 3
Understanding the Sample PortalThis chapter describes the sample portal that you can choose to install on your system during the Sun Java System Portal Server installation. See the Installation Guide for more information on installing the sample portal.
This chapter assumes that the sample portal is installed. It contains the following sections:
Overview of the Sample PortalThe sample portal consists the following elements:
- Sample channels and containers (discussed in this chapter)
- Sample Portal templates and JSPs (see Appendix A, "Desktop Template Files" and Appendix C, "JavaServer Pages Reference")
- Authless user definition and display profile XML fragment
- Authless templates and JSPs (see Appendix A, "Desktop Template Files" and Appendix C, "JavaServer Pages Reference")
The Sample Desktop
This section provides an outline of the sample portal sample containers, each of which produces a different looking Desktop. A container is a channel that is able to hold and organize content from other channels.
Sample Containers for the Sample Portal
The sample portal is created from the following containers:
Creates a Desktop that contains multiple containers selected using different tabs. Normally, each tab is constructed by using the corresponding PredefinedTabPanelContainer. This container is JSP-based. Its provider is JSPTabContainerProvider.
Creates a Desktop that arranges a maximum of five sub-containers into the channel arrangement. This container is JSP-based. Its provider is JSPTableContainerProvider.
Creates a Desktop that contains multiple containers selected using different tabs. Normally, each tab is constructed by using the corresponding PredefinedTemplatePanelContainer. This container is template-based. Its provider is TemplateTabContainerProvider.
Creates a Desktop that arranges a maximum of five sub-containers into the channel arrangement. This container is template-based. Its provider is TemplateTableContainerProvider.
Creates a Desktop using frames. The left-hand frame enables you to navigate, and the right-hand frame displays the channels. This container is JSP-based. Its provider is JSPTabContainerProvider.
For more information on each container, see the appropriate section in this chapter.
Deriving the Sample Desktop
The container architecture uses the various containers, and JavaServer Pages (JSP) or template files, to display the Desktop, and to build a hierarchy of containers that organize the Desktop content. Channels are defined at the global display profile level and are referenced by all the containers.
Determining the User’s Default Desktop
The Portal Server software determines the user’s default container by examining the Default Channel Name attribute for the Desktop page in the Identity Server software administration console.
When you install the sample portal, by default, the default channel is set to JSPTabContainer. Users can view this portal by typing:
http://hostname:port/portal/dt
You can easily view each sample portal Desktop by typing in the appropriate URL.
Guidelines for Using the Sample Portal
Editing the Default 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 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 won’t 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 sampleportal, the target template will be searched in the sampleportal sub directory, then the default sub directory.
By default, if the sample portal is installed, then the Desktop type attribute, sunPortalDesktopType, is set to sampleportal, meaning files are retrieved from the sampleportal subdirectory. If the sample portal 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 anonymous,sampleportal.
You can define a new set of templates by creating a new directory under the /etc/opt/SUNWps/desktop/ directory, placing your template files in this directory, and making this directory the Desktop Type attribute for that organization.
To change the Desktop type
- Create a new subdirectory in the /etc/opt/SUNWps/desktop directory, or whatever directory templateBaseDir specifies in the desktopconfig.properties file.
For example:
mkdir /etc/opt/SUNWps/desktop/sesta
- 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 /etc/opt/SUNWps/desktop/sesta/JSPProvider/content.jsp, and customize the file for the new Desktop type in that location.
- Use the Identity Server software administration console to change the value of the Desktop Type attribute for the subdirectory created in Step 1.
As this attribute is dynamic, 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.
See the Portal Server Administration Guide for more information on editing Desktop attributes.
Restoring the Default Sample Portal Settings
To re-load the default (original) display profile for the sample portal providers, the dp-providers.xml and dp-org.xml files (in portal-server-install-root/SUNWps/samples/desktop directory) must be reloaded. The dp-providers.xml file goes in the global level and the dp-org.xml file goes in the organization level. For example, type:
portal-server-install-root/SUNWps/bin/dpadmin modify -u "uid=amAdmin,ou=People,dc=sesta,dc=com" -w password -g portal-server-install-root/SUNWps/samples/desktop/dp-providers.xml
portal-server-install-root/SUNWps/bin/dpadmin modify -u "uid=amAdmin,ou=People,dc=sesta,dc=com" -w password -d "dc=sesta,dc=com" portal-server-install-root/SUNWps/samples/desktop/dp-org.xml
Sample Portal Installation Directories
If you choose to install the sample portal, the installer locates the appropriate files in the following directories:
portal-server-install-root/SUNWps/samples/desktop
This directory contains the following display profile documents:
/etc/opt/SUNWps/desktop/sampleportal
Contains the JSP, template, and other support files for the Portal Server software sample portal.
/etc/opt/SUNWps/desktop/anonymous
Contains the JSP, template, and other support files for the Portal Server software Desktop anonymous user.
JSP-Based DesktopDesktops based on JSPs enable a customization process without the necessity of changing the provider Java classes. The implementation of the JSP-based Desktop uses a tag library which Portal Server software supplies (see Appendix D for more information on the tags). Not all Desktop channels need to be JSP-based.
JSPTabContainer
The JSPTabContainer provides a JSP-based tabbed Desktop.
Sample Desktop
Default Layout
By default, the sample portal Desktop based on the JSPTabContainer (see Figure 3-1) includes five tabs, My Front Page, Samples, Search, Collaboration, and Sample Portlet which includes the following channels:
- In the My Front Page tab: Login or User Information, Sun Information, Bookmark, Sample JSP, and XML Test channels
- In the Samples tab: Sun Information, URL Scraper, and Notes channels
- In the Search tab: Search channel
- In the Collaboration tab: Discussions Lite and Discussions channels
- In the Portlet Samples tab: Bookmark, Showtime, and Weather portlet channels
Figure 3-1 Sample Desktop Based on JSPTabContainer
Default Actions
The sample JSPTabContainer channel, by default, includes:
- Banner links to return Home, tabs to allow the user to remove, rename or select the start tab, and also create a new tab (the URL for this page is action=edit&provider=JSPTabContainer), theme to allow the user to set the color scheme and font type for the Desktop (the URL for the preset theme page is action=edit&provider=JSPPresetThemeContainer), help that displays the Desktop sample online help (the URL is ../docs/locale/desktop/helppage.htm), Log Out link to log the user out of the Desktop (the URL is action=logout), and Search to allow the user to search.
When you click the Tabs link in the Desktop, the Current Tabs Settings Edit page, where you can make changes, is displayed. Start Tab lets you set the starting tab; Tab Name specifies the name of the tabs in the container; and Action lets you rename or delete a tab from the Desktop. (JavaScript handles the action.)
When you click Make a New Tab, the corresponding Edit page is shown. You decide what to name the tab and what the tab topics are. Content Page is displayed only when making a new tab from scratch. When other Tab Topics are selected, a new tab which looks similar to the TabTopic selected, is created and displayed.
- Links specific to the contained containers. The channels in each tab depend on the contained container of the JSPTabContainer. In the Sample Portal, these contained containers are JSPTableContainer and the channels are dependant on this container; but this does not have to be the case, they can be any container. The Content and Layout links provide the ability to customize the current selected contained container.
- Content and layout links. The top-most JSP in the table container defines the Content and Layout links. JSPContentContainer is the container that displays the Content page, and JSPLayoutContainer is the container that displays the Layout page.
Default Display Profile Settings
The provider responsible for generating the JSPTabContainer channel is JSPTabContainerProvider. The provider profile is the template which decides the properties for a container channel, but the container channel profile will ultimately decide the values for the container channel attributes.
The properties that make up JSPTabContainer work as follows by default.
JSPTabContainer Architecture
Figure 3-2 shows the JSPTabContainer architecture. In this figure, tab.jsp is the top-level JSP file. The tab.jsp file makes include calls to the header.jsp, availableTabs.jsp, menubar.jsp, and footer.html files. The availableTabs.jsp file makes an include call to the selectedTab.jsp and tabs.jsp files.
Figure 3-2 JSPTabContainer Architecture
JSP Files Used by JSPTabContainer
The Portal Server software uses JSP files for a channel’s presentation layer. JSPTabContainer references two main JSPs, tab.jsp and tabedit.jsp, through the contentPage and editPage properties.
Content template is responsible for the front page of the container channel and the file name for the tab container channel is tab.jsp. The tab.jsp file extensively uses the Desktop taglibs.
The Edit page is where you can add, remove, and rename tabs. The tabedit.jsp is used to display this page.
JSPTableContainer
The JSPTableContainer provides a JSP-based table Desktop.
Sample Desktop
Default Layout
By default, the sample portal Desktop based on the JSPTableContainer (see Figure 3-3) contains the following channels:
Default Actions
The sample JSPTableContainer channel, by default, includes:
- Banner links to return to the Desktop Home page, Desktop theme to allow the user to set the color scheme and font type for the Desktop (the URL for this page is action=edit&provider=JSPPresetThemeContainer), Log Out to allow the user to log out of the Desktop (the URL for this page is action=logout), Help to display the Desktop sample online help (the URL for this page is ../docs/locale/desktop/helppage.htm), and Search to allow the user to search.
- Leaf channel. JSPTableContainer does not contain any contained containers, it only has leaf channels. This container uses JSPContentContainer and JSPLayoutContainer to edit the content and layout, respectively.
- Content and layout links. The toptable.jsp file defines the Content and Layout links. JSPContentContainer is the container that displays the Content page, and JSPLayoutContainer is the container that displays the Layout page.
The Content link (action=edit&provider=JSPContentContainer&container=JSPTableContainer) allows the user to edit the content on the Content page and the Layout link (action=edit&provider=JSPLayoutContainer&container=JSPTableContainer) allows the user to edit the layout of the channels on the Layout page.
Default Display Profile Settings
The provider responsible for generating the JSPTableContainer channel is JSPTableContainerProvider. The provider profile is the template which decides the properties for a container channel, but the container channel profile will ultimately decide the values for the container channel attributes. The default properties that make up JSPTableContainer work as follows:
JSPTableContainer Architecture
Figure 3-4 shows the JSPTableContainer architecture. In this figure, toptable.jsp is the top-level JSP file. The toptable.jsp file makes include calls to the header.jsp, launchPopup.jsp, leafWrapper.jsp, and menubar.jsp files.
Figure 3-4 JSPTableContainer Architecture
JSP Files Used by JSPTableContainer
The Portal Server uses JSP files for a channel’s presentation layer. JSPTableContainer references one main JSP, toptable.jsp, through the contentPage property.
Content template is responsible for the front page of the container channel and the file name for the tab container channel is toptable.jsp. The toptable.jsp file extensively uses the Desktop taglibs.
Template-based DesktopTemplateTabContainer and TemplateTableContainer use the original template mechanism from iPlanet Portal Server 3.0. TemplateTableContainer is the same as the normal Desktop from iPlanet Portal Server 3.0, and TemplateTabContainer is the same as the tabbed Desktop from iPlanet Portal Server 3.0.
Frame-based DesktopFrameTabContainer
The FrameTabContainer provides a frame-based table Desktop.
Sample Desktop
Default Layout
By default, the sample portal Desktop based on the FrameTabContainer provides a frame-based table Desktop consisting of two frames, My Front Page and Samples, with the following channels:
Default Actions
The sample FrameTabContainer channel, by default, includes:
- Banner links to return to the Desktop Home page, Sections (action=edit&provider=FrameTabContainer) that allow users to rename or select the start page, delete a page, and also create a new page, theme (action=edit&provider=JSPPresetThemeContainer) that allows users to set the color scheme and font type for the Desktop, Help (../docs/locale/desktop/helppage.htm) to display the Desktop sample online help, and Log Out (action=logout) that logs the user out from the Desktop.
The Content link (action=edit&provider=JSPContentContainer&container=MyFrontPageFramePanelContainer) allows the user to edit the content for this particular page on the Content page and the Layout link (action=edit&provider=JSPLayoutContainer&container=MyFrontPageTabPanelContainer&selected=MyFrontPageFramePanelContainer) allows the user to edit the layout of the channels for this particular page on the Layout page.
Default Display Profile Settings
The provider responsible for generating FrameTabContainer channel is JSPTabContainerProvider. The provider profile is the template which decides the properties for a container channel, but the container channel profile will ultimately decide the values for the container channel attributes. The properties that make up FrameTabContainer work as follows:
FrameTabContainer Architecture
Figure 3-6 shows the FrameTabContainer architecture. In this figure, frametab.jsp is the top-level JSP file. The frametab.jsp file makes include calls to the frametabmenu.jsp, header.jsp, banner.jsp, selectedTab.jsp, menubar.jsp, frameset.jsp, and footer.html files.
FrameTabContainer is made up of two sub-containers, MyFrontPageFramePanelContainer and SamplesFramePanelContainer, as represented by Page 1 (tablecontainer) in the figure.
Figure 3-6 FrameTabContainer Architecture
JSP Files Used by FrameTabContainer
The Portal Server uses JSP files for a channel’s presentation layer. FrameTabContainer references two main JSPs, frametab.jsp and frametabedit.jsp, through the contentPage and editPage properties.
Content template is responsible for the front page of the container channel and the file name for the tab container channel is frametab.jsp. The frametab.jsp file extensively uses the Desktop taglibs.
The Edit page is where you can add, remove, and rename pages. The frametabedit.jsp is used to display this page.