Layout of the portal page
Before customizing your portal site, understand the underlying structure of the portal.
- UNIX and Windows : was_profile_root /installedApps/cellname /wps.ear/wps.war
- i5/OS : AppServer_root_usr /installedApps/cellname /wps.ear/wps.war
Within this location, subdirectories for markup, locale, and client types are used to support portal aggregation.
-
themes
- provide the navigation, appearance, and layout of the portal, including colors, fonts, and images outside of the portlet content area (Home screen). screens
- the area of the portal that typically displays portlets (Home screen), but can also display other content in its place, for example, a login form or error message. Screens are selected from navigation icons in the theme. skins
- represent the border rendering around components, such as row containers, column containers, or portlets. Skins are installed independently from themes. However, the administrator can set a default skin for a theme.
The starting place for building the portal page is Default.jsp in the /themes directory. The screen and skin are called by their corresponding tags from the portal-core tag library: the screen is called by the <portal-core:screenRender/> tag, while the skin is called by the <portal-core:pageRender/> tag.
- Themes
You can add your own elements to the HTML portal page and rearrange the layout by creating a new theme and changing the layout in Default.jsp and the JSPs that are included. Learn about the order and layout in which the portal page theme is built using the JSPs that are provided after installation. Use this information to learn how to include some of these components as you build your own themes. - Theme policies
Learn about theme policy, theme policy attributes, and the theme policies available with WebSphere Portal . Learn about setting a theme policy on a page using the XML configuration interface, using theme policy in a JSP, creating your own theme policy, and updating, exporting, and deleting a theme policy. - Theme extension points
By using the Eclipse Extension Point Framework, the default Portal theme provides various points where theme functionality can be extended by simply putting a new JAR file in the classpath. - Screens
A screen is a page of portal content. When the portal page is first loaded, the Home screen is initially shown (Home.jsp ). Other screens can also be displayed, including the Login screen and the Error screen. Selection of screens is determined by links or buttons on the toolbar, which is provided by a theme. The Home screen includes the <portal-core:pageRender/> tag, which renders the pages layout and content. - Skins
Skins represent the border rendering around components, such as row containers, column containers, or portlets. The skin is loaded in the portal page by the <portal-core:pageRender/> tag. Skins are installed independently from themes. However, a skin can be associated with a theme. - Aggregation
WebSphere Portal provides fully dynamic aggregation of pages from page descriptors that are held in the portal database.
Themes
You can add your own elements to the HTML portal page and rearrange the layout by creating a new theme and changing the layout in Default.jsp and the JSPs that are included. Learn about the order and layout in which the portal page theme is built using the JSPs that are provided after installation. Use this information to learn how to include some of these components as you build your own themes.
For most requests, the portal page is rendered starting with Default.jsp in the /themes directory. The only exception is when the request has been modified by a newWindow="true" parameter. In this case, the page is rendered using Plain.jsp . Plain.jsp is normally used to render portlet help or for portlets that use the iFrame skin.
Theme policy is used to control how a theme is rendered on a page. A policy is created and stored using the XML configuration interface. Once stored, it can be applied to a page either through the XML configuration interface using the page metadata attribute com.ibm.portal.ThemePolicy or through the Properties portlet. Theme policy is inherited so it only needs to be set on a page which requires a different policy than its parent.
Head
Head.jspf provides the necessary header information to correctly render the portal page. This file is used to link the style sheets and client-side scripts as well as set the page title and the text direction.
Banner
- Top level links - a listing of the top level nodes directly under Content Root which includes a "More..." menu if the number of links exceeds a certain value.
- Breadcrumb trail (banner_crumbtrail.jspf ) - the current page selection path to the current page.
- Search controls (banner_searchControl.jspf ) - a search form to various search scopes.
- Toolbar actions (banner_toolbar.jspf ) - a set of buttons to access various flyout panels and actions.
Top navigation
topNav.jspf creates one or more rows of navigation tabs. Theme policy values control whether the top navigation is rendered and how many rows are rendered.
Side navigation
sideNav.jspf creates an expandable tree of navigation nodes. The side navigation renders any navigation levels that have not been rendered by the top navigation.
Footers
footer.jspf renders a section across the bottom of the portal page. By default, this includes quick links to commonly accessed areas of portal. The links rendered are internal URLs which are children of the portal page with the unique name ibm.portal.Quick Links .
Palettes
Flyout.jspf contains a hidden document division (<div/> ) which is used by actions in the banner's toolbar to display content which is dynamically displayed and hidden as needed.
Context menus
| Menu | Controlling JSP |
|---|---|
| More menu | moreMenu.jsp |
| Page menu (on selected page) | pageContextMenu.jsp |
| Portlet menu | portletContextMenu.jsp |
Drag and drop feature
The drag-and-drop feature lets you quickly change the placement of individual portlets using your skins. The drag-and-drop feature lets you move a custom portlet from its current position by dropping it to another position on a page. This lets you quickly change the arrangement of your custom portlets on a page.
Theme policy
Theme policies control how a theme renders for a particular page. The attributes of the theme policy assigned to the current page are consumed by the theme JSPs to control what gets rendered, as well as how it is rendered.
Default themes
- Portal theme - This is the default theme for WebSphere Portal and is a full-featured theme that demonstrates all available theme functionality.
- Minimal theme - This theme, located in the root themes/html directory, is a minimal "safe" fallback that includes only the minimum required to render a functioning portal. It does not include all of the functionality available in WebSphere Portal , such as drag and drop and context menus. This theme is not intended for normal use, and is not explicitly defined as a theme by name, but rather only exists as a fallback should there be a problem with the main portal theme, and also as an example of a minimal theme.
- Portal Web 2 theme - This theme showcases Web 2.0 functionality in WebSphere Portal . Taking full advantage of AJAX and JavaScript, this theme features a rich user experience on the client with partial page updates and inline portlet editing.
<portal-theme:cacheProxyUrl/> JSP tag
The switch to using JSPs for style sheets provides a great advantage in the reduction of the number of files that must be maintained or generated when a style sheet is updated. However, a performance concern is introduced in that the output of the compiled JSPs needs to be cached to avoid having to be generated on each request. WebSphere Portal provides the <portal-theme:cacheProxyUrl/> JSP tag to solve this problem.
Theme policies
Learn about theme policy, theme policy attributes, and the theme policies available with WebSphere Portal . Learn about setting a theme policy on a page using the XML configuration interface, using theme policy in a JSP, creating your own theme policy, and updating, exporting, and deleting a theme policy.
Theme policy is used to control how a theme is rendered on a page. A policy is created and stored using the XML configuration interface. Once stored, it can be applied to a page either through the XML configuration interface using the page metadata attribute com.ibm.portal.ThemePolicy or the Properties portlet. Theme policy is inherited so it only needs to be set on a page which requires a different policy than its parent.
This topic provides the following information on theme policies:Theme policy attributes
A theme policy is made up of several attributes. Each attribute controls one aspect of the theme. For example, the Boolean renderBreadCrumb attribute controls whether the bread crumb will be displayed while the breadCrumbMaxLevels attribute controls the number of steps listed in the bread crumb when it is displayed.
| Attribute | Type | Function |
|---|---|---|
| renderMainMenu | Boolean | If true, the main menu is rendered |
| renderTopNavigation | Boolean | If true, top navigation is rendered |
| renderMainMenuActions | Boolean | If true, the main menu actions are rendered |
| renderSelfCare | Boolean | If true, Selfcare is rendered |
| renderBreadCrumbTrail | Boolean | If true, the bread crumb trail is rendered |
| renderSearch | Boolean | If true, search is rendered |
| renderToolBar | Boolean | If true, the tool bar is rendered |
| renderContentPalette | Boolean | If true, the portlet palette is rendered |
| renderPeoplePalette | Boolean | If true, the people palette is rendered |
| renderContextMenus | Boolean | If true, context menus are render |
| renderSideNavigation | Boolean | If true, side navigation is rendered |
| renderTaskBar | Boolean | If true, the task bar is rendered |
| renderFavorites | Boolean | If true, favorites is rendered |
| renderExtensions | Boolean | If true, extensions are rendered |
| renderBannerTitleGraphic | Boolean | If true, the banner title graphic is rendered as long as one exists |
| renderPortletFragmentIDAnchor | Boolean | Used to determine if the user is on a palette page |
| renderBannerTitle | Boolean | If true, the banner title is rendered as long as one exists |
| breadCrumbMaxLevels | Integer | Indicates the number of steps listed in the bread crumb trail |
| breadCrumbStartLevel | Integer | Indicates which level to start the bread crumb trail |
| rootNavigationStartLevel | Integer | Indicates the start level for root navigation |
| rootNavigationStopLevel | Integer | Indicates the stop level for root navigation |
| topNavigationNumRows | Integer | Indicates the number of rows to render for top navigation |
| topNavigationStartLevel | Integer | Indicates the start level for top navigation |
| topNavigationStopLevel | Integer | Indicates the stop level for top navigation |
| sideNavigationStartLevel | Integer | Indicates the start level for side navigation |
| isCustomizable | Boolean | If true, the policy can be edited in the Theme Customizer portlet. |
| isDeletable | Boolean | If true, the policy can be deleted in the Theme Customizer portlet.
Note: xmlaccess ignores this attribute.
|
| colorPalette | String | If specified, the value in this attribute is the name of the color palette.
The search order for the name of the color palette used on the page is:
The name of the color palette must be the name of a properties file provided in the theme without the .properties extension. |
| colorPaletteProperties | String | Color Palette information. This is a stored java.util.Properties object created by the Theme Customizer portlet. The theme first loads the color palette for the page and then overwrites those values with any that may be present in this attribute. |
| graphicFilesMimeData | String | If specified, graphic files uploaded through the Theme Customizer portlet. This attribute is a standard multipart/mixed MIME text stream containing attachments encoded with Base64 encoding. |
| styleVersion | Integer | The version number of the policy. This value is incremented each time the Theme Customizer portlet saves the policy so updates to the policy can be loaded without clearing the browser cache. |
| bannerTitleText | String | Indicates the text that is to be displayed as the title in the banner and browser title bar. If this value is empty, the bannerTitleTextResourceBundle and bannerTitleTextResourceKey attributes are used to determine the title text. |
| bannerTitleTextResourceBundle | String | Indicates the resource bundle containing the title text. |
| bannerTitleTextResourceKey | String | Indicates the resource bundle key that is to be used to locate the title |
| bannerTitleGraphic | String | Indicates the URI of the title graphic to be displayed in the banner. This value is passed on the uri attribute of the portal-resolver:url tag. Values created by the Theme Customizer portlet are of the form: "themeGraphic:policy:filePath:xxx " where xxx is the name of the attachment stored in the graphicFilesMimeData attribute. |
| renderBannerQuickLinks | Boolean | If true, banner quick links are rendered |
| renderHelpLink | Boolean | If true, the help link is rendered |
| renderQuickLinksShelf | Boolean | If true, the quick links shelf is rendered |
| quickLinksShelfStyle | Integer | Style attributes for the quick links shelf. This is a bitmask field. If bit 1 is turned on, the quick links shelf default state is expanded. If bit 2 is turned on, the expand/collapse link is hidden.
As such, the following values are supported:
|
| renderApplicationName | Boolean | If true, the application name is rendered |
| renderCustomizeThemeLink | Boolean | If true, the theme customizer link is rendered |
Provided theme policies
WebSphere Portal provides ten policies that may be used without alteration. The following information provides lists of each policy along with the corresponding attributes, values, and types.
- renderMainMenu=TRUE
- renderTopNavigation=TRUE
- renderMainMenuActions=TRUE
- renderSelfCare=TRUE
- renderBreadCrumbTrail=FALSE
- renderSearch=TRUE
- renderToolBar=TRUE
- renderContentPalette=TRUE
- renderPeoplePalette=TRUE
- renderContextMenus=TRUE
- renderSideNavigation=TRUE
- renderTaskBar=TRUE
- renderFavorites=TRUE
- renderExtensions=TRUE
- renderBannerTitleGraphic=TRUE
- renderBannerTitle=TRUE
- renderPortletFragmentIDAnchor=TRUE
- breadCrumbMaxLevels=5
- breadCrumbStartLevel=1
- rootNavigationStartLevel=1
- rootNavigationStopLevel=1
- topNavigationNumRows=1
- topNavigationStartLevel=2
- topNavigationStopLevel=2
- sideNavigationStartLevel=3
- isCustomizable=FALSE
- isDeletable=TRUE
- colorPalette=""
- colorPaletteProperties=""
- graphicFilesMimeData=""
- styleVersion=1
- bannerTitleText=""
- bannerTitleTextResourceBundle=""
- bannerTitleTextResourceKey=""
- bannerTitleTextResourceKey=""
- bannerTitleGraphic=""
- renderBannerQuickLinks=TRUE
- renderHelpLink=TRUE
- renderQuickLinksShelf =FALSE
- quickLinksShelfStyle=1
- renderApplicationName=TRUE
- renderCustomizeThemeLink=FALSE
- renderMainMenu = TRUE
- renderTopNavigation = TRUE
- renderMainMenuActions= TRUE
- renderSelfCare = TRUE
- renderBreadCrumbTrail = FALSE
- renderSearch = TRUE
- renderToolBar = TRUE
- renderContentPalette = TRUE
- renderPeoplePalette = TRUE
- renderContextMenus = TRUE
- renderSideNavigation = TRUE
- renderTaskBar = TRUE
- renderFavorites = TRUE
- renderExtensions = TRUE
- renderBannerTitleGraphic = TRUE
- renderBannerTitle=TRUE
- renderPortletFragmentIDAnchor=TRUE
- breadCrumbMaxLevels = 5
- breadCrumbStartLevel = 1
- rootNavigationStartLevel = 1
- rootNavigationStopLevel = 1
- topNavigationNumRows = 1
- topNavigationStartLevel = 2
- topNavigationStopLevel = 2
- sideNavigationStartLevel = 3
- renderMainMenu = TRUE
- renderTopNavigation = TRUE
- renderMainMenuActions = FALSE
- renderSelfCare = FALSE
- renderBreadCrumbTrail = FALSE
- renderSearch = FALSE
- renderToolBar = FALSE
- renderContentPalette = FALSE
- renderPeoplePalette = FALSE
- renderContextMenus = FALSE
- renderSideNavigation = TRUE
- renderTaskBar = FALSE
- renderFavorites = FALSE
- renderExtensions = FALSE
- renderBannerTitleGraphic = FALSE
- renderBannerTitle = FALSE
- renderPortletFragmentIDAnchor=TRUE
- breadCrumbMaxLevels = 0
- breadCrumbStartLevel = 0
- rootNavigationStartLevel = 1
- rootNavigationStopLevel = 1
- topNavigationNumRows = 1
- topNavigationStartLevel = 2
- topNavigationStopLevel = 2
- sideNavigationStartLevel = 3
- renderMainMenu = TRUE
- renderTopNavigation = TRUE
- renderMainMenuActions = TRUE
- renderSelfCare = TRUE
- renderBreadCrumbTrail = FALSE
- renderSearch = TRUE
- renderToolBar = TRUE
- renderContentPalette = TRUE
- renderPeoplePalette = TRUE
- renderContextMenus = TRUE
- renderSideNavigation = TRUE
- renderTaskBar = TRUE
- renderFavorites = TRUE
- renderExtensions = TRUE
- renderBannerTitleGraphic = TRUE
- renderBannerTitle = TRUE
- renderPortletFragmentIDAnchor=TRUE
- breadCrumbMaxLevels = 5
- breadCrumbStartLevel = 1
- rootNavigationStartLevel = 1
- rootNavigationStopLevel = 1
- topNavigationNumRows = 2
- topNavigationStartLevel = 2
- topNavigationStopLevel = 3
- sideNavigationStartLevel = 4
- renderMainMenu = TRUE
- renderTopNavigation= TRUE
- renderMainMenuActions = FALSE
- renderSelfCare = FALSE
- renderBreadCrumbTrail = FALSE
- renderSearch = FALSE
- renderToolBar = FALSE
- renderContentPalette = FALSE
- renderPeoplePalette = FALSE
- renderContextMenus = FALSE
- renderSideNavigation = TRUE
- renderTaskBar = FALSE
- renderFavorites = FALSE
- renderExtensions = FALSE
- renderBannerTitleGraphic = FALSE
- renderBannerTitle = FALSE
- renderPortletFragmentIDAnchor=TRUE
- breadCrumbMaxLevels = 0
- breadCrumbStartLevel = 0
- rootNavigationStartLevel = 1
- rootNavigationStopLevel = 1
- topNavigationNumRows = 2
- topNavigationStartLevel = 2
- topNavigationStopLevel = 3
- sideNavigationStartLevel = 4
- renderMainMenu = TRUE
- renderTopNavigation = FALSE
- renderMainMenuActions = TRUE
- renderSelfCare = TRUE
- renderBreadCrumbTrail = FALSE
- renderSearch = TRUE
- renderToolBar = TRUE
- renderContentPalette = TRUE
- renderPeoplePalette = TRUE
- renderContextMenus = TRUE
- renderSideNavigation = TRUE
- renderTaskBar = TRUE
- renderFavorites = TRUE
- renderExtensions = TRUE
- renderBannerTitleGraphic = TRUE
- renderBannerTitle = TRUE
- renderPortletFragmentIDAnchor=TRUE
- breadCrumbMaxLevels = 5
- breadCrumbStartLevel = 1
- rootNavigationStartLevel = 1
- rootNavigationStopLevel = 1
- topNavigationNumRows = 0
- topNavigationStartLevel = 0
- topNavigationStopLevel = 0
- sideNavigationStartLevel = 2
- renderMainMenu = TRUE
- renderTopNavigation = FALSE
- renderMainMenuActions = FALSE
- renderSelfCare = FALSE
- renderBreadCrumbTrail = FALSE
- renderSearch = FALSE
- renderToolBar = FALSE
- renderContentPalette = FALSE
- renderPeoplePalette = FALSE
- renderContextMenus = FALSE
- renderSideNavigation =TRUE
- renderTaskBar = FALSE
- renderFavorites = FALSE
- renderExtensions = FALSE
- renderBannerTitleGraphic = FALSE
- renderBannerTitle = FALSE
- renderPortletFragmentIDAnchor=TRUE
- breadCrumbMaxLevels = 5
- breadCrumbStartLevel = 0
- rootNavigationStartLevel = 1
- rootNavigationStopLevel = 1
- topNavigationNumRows = 0
- topNavigationStartLevel = 0
- topNavigationStopLevel = 0
- sideNavigationStartLevel = 2
- renderMainMenu = FALSE
- renderTopNavigation = FALSE
- renderMainMenuActions = FALSE
- renderSelfCare = FALSE
- renderBreadCrumbTrail = FALSE
- renderSearch = FALSE
- renderToolBar = FALSE
- renderContentPalette = FALSE
- renderPeoplePalette = FALSE
- renderContextMenus = FALSE
- renderSideNavigation = FALSE
- renderTaskBar = FALSE
- renderFavorites = FALSE
- renderExtensions = FALSE
- renderBannerTitleGraphic = FALSE
- renderBannerTitle = FALSE
- renderPortletFragmentIDAnchor=FALSE
- breadCrumbMaxLevels = 0
- breadCrumbStartLevel = 0
- rootNavigationStartLevel = 0
- rootNavigationStopLevel = 0
- topNavigationNumRows = 0
- topNavigationStartLevel = 0
- topNavigationStopLevel = 0
- sideNavigationStartLevel = 0
- renderMainMenu = FALSE
- renderTopNavigation = FALSE
- renderMainMenuActions = FALSE
- renderSelfCare = FALSE
- renderBreadCrumbTrail = FALSE
- renderSearch = TRUE
- renderToolBar = TRUE
- renderContentPalette = TRUE
- renderPeoplePalette = TRUE
- renderContextMenus = FALSE
- renderSideNavigation = FALSE
- renderTaskBar = FALSE
- renderFavorites = FALSE
- renderExtensions = FALSE
- renderBannerTitleGraphic = FALSE
- renderBannerTitle = FALSE
- renderPortletFragmentIDAnchor=TRUE
- breadCrumbMaxLevels = 0
- breadCrumbStartLevel = 0
- rootNavigationStartLevel = 0
- rootNavigationStopLevel = 0
- topNavigationNumRows = 0
- topNavigationStartLevel = 0
- topNavigationStopLevel = 0
- sideNavigationStartLevel = 0
- renderMainMenu = TRUE
- renderTopNavigation = TRUE
- renderMainMenuActions= TRUE
- renderSelfCare = TRUE
- renderBreadCrumbTrail = FALSE
- renderSearch = TRUE
- renderToolBar = TRUE
- renderContentPalette = TRUE
- renderPeoplePalette = TRUE
- renderContextMenus = TRUE
- renderSideNavigation = TRUE
- renderTaskBar = TRUE
- renderFavorites = TRUE
- renderExtensions = TRUE
- renderBannerTitleGraphic = TRUE
- renderBannerTitle = TRUE
- renderPortletFragmentIDAnchor=TRUE
- breadCrumbMaxLevels = 5
- breadCrumbStartLevel = 2
- rootNavigationStartLevel = 1
- rootNavigationStopLevel = 1
- topNavigationNumRows = 1
- topNavigationStartLevel = 2
- topNavigationStopLevel = 2
- sideNavigationStartLevel = 3
- renderMainMenu = TRUE
- renderTopNavigation = TRUE
- renderMainMenuActions= TRUE
- renderSelfCare = TRUE
- renderBreadCrumbTrail = FALSE
- renderSearch = TRUE
- renderToolBar = TRUE
- renderContentPalette = TRUE
- renderPeoplePalette = TRUE
- renderContextMenus = TRUE
- renderSideNavigation = TRUE
- renderTaskBar = TRUE
- renderFavorites = TRUE
- renderExtensions = TRUE
- renderBannerTitleGraphic=TRUE
- renderBannerTitle=TRUE
- renderPortletFragmentIDAnchor=FALSE
- breadCrumbMaxLevels = 5
- breadCrumbStartLevel = 1
- rootNavigationStartLevel = 1
- rootNavigationStopLevel = 1
- topNavigationNumRows = 1
- topNavigationStartLevel = 2
- topNavigationStopLevel = 2
- sideNavigationStartLevel = 3
Custom theme attributes
In addition to the attributes in each policy above, you can add an attribute to the theme policies and then use it in your JSP or JSPF. The following code samples show how the custom attribute renderTestAttribute is added to theme policy and how it is accessed in a JSP or JSPF.
<policyValue
Name="renderTestAttribute"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderTestAttributeLock"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>false</value>
</policyValue>
The policy value sets consisting of attributes and their values can be nested. Child attributes can either inherit or override the values from the parent attribute. When you specify the value of a lock attribute corresponding to a policy attribute as true, you lock the policy node. In this case, the child attributes necessarily inherit the values from parent attributes and cannot override these values.
<policyValueSince this is a Boolean, the value would be set to true or false.
Name="renderTestAttribute"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>false</value>
</policyValue>
<% boolean isTestAttribute = themePolicy.getValueAsBoolean("renderTestAttribute", false);
if(isTestAttribute){%>
<p> Display this paragrah if renderTestAttribute is true. </p>
<%}%>
In the above example, if the value of renderTestAttribute is true, the paragraph is displayed. themePolicy is defined in the Using theme policy in a JSP section of this topic.
- getValueAsBoolean(String key, boolean defaultValue);
- getValueAsInt(String key, int defaultValue);
- getValueAsString(String key, String defaultValue);
Setting theme policy on a page using the XML configuration interface
Theme Policy can be applied to a page through the XML configuration interface using the page metadata attribute com.ibm.portal.ThemePolicy . The following provides an example of an XML script that sets the page metadata for the theme policy for the page ThemePolicyPageTest :
<request type="update" create-oids="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd">
<portal action="locate">
<content-node action="update" ordinal="last"
uniquename="ibm.portal.ThemePolicyPageTest" content-parentref="Content.Root"
active="true" allportletsallowed="false" create-type="explicit"
objectid="wp.theme.policytestpage" type="page">
<supported-markup markup="html" update="set"/>
<!--@LocaleData_1@-->
<parameter name="com.ibm.portal.ThemePolicy" type="string"
update="set">theme/SingleTopNavMinimal</parameter>
</content-node>
</portal>
</request>
Using theme policy in a JSP
You can also use a theme policy directly in a JSP. Use the following code to do this:
<themepolicy:initthemepolicy/>
<jsp:useBean id="themePolicy"
class="com.ibm.portal.theme.policy.ThemePolicyBean" scope="page"/>
<% themePolicy.setValuesMap(portalThemePolicyMap);%>
In this code example, the theme bean is initialized which wrappers the theme policy attributes.
To use an attribute in the JSP, reference it with the following syntax: ${themePolicy.attribute) where the attribute would be, for example, renderSideNavigation . The following code tests renderSideNavigation . If it is TRUE, the following code is executed:
<c-rt:if test = "${themePolicy.renderSideNavigation}">
<!-- following code -->
<….>
<….>
</c-rt:if>
The following code example sets startLevel to the value of the theme policy attribute sideNavigationStartLevel :
<portal:navigation startLevel="${themePolicy.sideNavigationStartLevel}"
Creating your own theme policy
The following code example addThemePolicyNode.xml provides an example of how to create and add a new theme policy. This XML file would then be updated to reflect the location and name of the file which contains the theme policy XML definition.
<?xml version="1.0" encoding="UTF-8"?>
<request xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
create-oids="true" type="update"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<portal action="locate">
<policy-node action="update" label="WebPage" type="" path="">
<url>file:///c:/temp/addTestThemePolicyNode.xml</url>
</policy-node>
</portal>
</request>
- Type attribute should be set to "theme"
- PathType attribute should be set to "/theme"
- PznType and Title attributes should have the same value.
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed Materials - Property of IBM, 5724-E76, 5655-R17,
(C) Copyright IBM Corp. 2006 - All Rights reserved.
-->
<policyList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Policy.xsd">
<policy>
<policyValue
Name="Path"
Factory="com.ibm.wps.policy.parse.StringFactory">
<value></value>
</policyValue>
<policyValue
Name="Type"
Factory="com.ibm.wps.policy.parse.StringFactory">
<value>theme</value>
</policyValue>
<policyValue
Name="Description"
Factory="com.ibm.wps.policy.parse.StringFactory">
<value>Test Theme Policy</value>
</policyValue>
<policyValue
Name="Title"
Factory="com.ibm.wps.policy.parse.StringFactory">
<value>TestThemePolicy</value>
</policyValue>
<policyValue
Name="Editor"
Factory="com.ibm.wps.policy.parse.StringFactory">
<value></value>
</policyValue>
<policyValue
Name="NameResKey"
Factory="com.ibm.wps.policy.parse.StringFactory">
<value></value>
</policyValue>
<policyValue
Name="PznRule"
Factory="com.ibm.wps.policy.parse.StringFactory">
<value></value>
</policyValue>
<policyValue
Name="PznType"
Factory="com.ibm.wps.policy.parse.StringFactory">
<value>TestThemePolicy</value>
</policyValue>
<policyValue
Name="Remote"
Factory="com.ibm.wps.policy.parse.StringFactory">
<value></value>
</policyValue>
<policyValue
Name="PathType"
Factory="com.ibm.wps.policy.parse.StringFactory">
<value>/theme</value>
</policyValue>
<policyValue
Name="renderMainMenu"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderTopNavigation"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderMainMenuActions"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderSelfCare"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderBreadCrumbTrail"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>false</value>
</policyValue>
<policyValue
Name="renderSearch"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderToolBar"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderContentPalette"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderPeoplePalette"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderContextMenus"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderSideNavigation"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderTaskBar"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderFavorites"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderExtensions"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderBannerTitleGraphic"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderBannerTitle"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="renderPortletFragmentIDAnchor"
Factory="com.ibm.wps.policy.parse.BooleanFactory">
<value>true</value>
</policyValue>
<policyValue
Name="breadCrumbMaxLevels"
Factory="com.ibm.wps.policy.parse.IntegerFactory">
<value>5</value>
</policyValue>
<policyValue
Name="breadCrumbStartLevel"
Factory="com.ibm.wps.policy.parse.IntegerFactory">
<value>1</value>
</policyValue>
<policyValue
Name="rootNavigationStartLevel"
Factory="com.ibm.wps.policy.parse.IntegerFactory">
<value>1</value>
</policyValue>
<policyValue
Name="rootNavigationStopLevel"
Factory="com.ibm.wps.policy.parse.IntegerFactory">
<value>1</value>
</policyValue>
<policyValue
Name="topNavigationNumRows"
Factory="com.ibm.wps.policy.parse.IntegerFactory">
<value>1</value>
</policyValue>
<policyValue
Name="topNavigationStartLevel"
Factory="com.ibm.wps.policy.parse.IntegerFactory">
<value>2</value>
</policyValue>
<policyValue
Name="topNavigationStopLevel"
Factory="com.ibm.wps.policy.parse.IntegerFactory">
<value>2</value>
</policyValue>
<policyValue
Name="sideNavigationStartLevel"
Factory="com.ibm.wps.policy.parse.IntegerFactory">
<value>3</value>
</policyValue>
<policyValue
Name="Version"
Factory="com.ibm.wps.policy.parse.StringFactory">
<value>1.0</value>
</policyValue>
</policy>
</policyList>
Updating a theme policy
- Export the theme policy.
- Edit the values of the attributes to be updated.
- Use the XML configuration interface to run addThemePolicyNode.xml which references the file that has the updated theme policy definition.
Extending and updating a theme policy
- Export the entire theme policy structure
- Edit the root theme policy.
- Edit the theme policy to be updated by adding the attribute if the value is different than the root theme policy.
- Run addThemePolicyNode.xml which references the file that has the updated definitions.
- Export the theme policy you wish to modify.
- Make the appropriate changes to the attribute.
- Run addThemePolicyNode.xml which references the file that has the updated definitions.
Exporting a theme policy
Use the following code example exportThemePolicyNode.xml to export a theme policy. The file specified is the location to where the exported information is written. The following example exports all theme policies.
<?xml version="1.0" encoding="UTF-8"?>
<request xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
create-oids="true" type="export"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<portal action="locate">
<policy-node action="export" label="WebPage"
type="theme" path="">
<url>file:///c:/temp/exportThemePolicies.xml</url>
</policy-node>
</portal>
</request>
The following example exports only the TestThemePolicy theme policy:
<?xml version="1.0" encoding="UTF-8"?>
<request xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
create-oids="true" type="export"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<portal action="locate">
<policy-node action="export" label="WebPage"
type="theme" path="TestThemePolicy">
<url>file:///c:/temp/exportTestThemePolicy.xml</url>
</policy-node>
</portal>
</request>
Deleting a theme policy
<request xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
create-oids="true" type="update"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<portal action="locate">
<policy-node action="delete" label="WebPage"
type="theme" path="TestThemePolicy">
</policy-node>
</portal>
</request>
Theme extension points
By using the Eclipse Extension Point Framework, the default Portal theme provides various points where theme functionality can be extended by simply putting a new JAR file in the classpath.
Including an extension point in a theme
<%-- Declares extension point ID that you want to retrieve attached extensions for --%>
<portal-theme-ext:themeExtension id="com.ibm.portal.theme.plugin.SimpleLinks" >
<%-- loop over active extensions, if any --%>
<portal-theme-ext:themeExtensionLoop>
<%-- Use extension properties to add content to the page --%>
<a href="<portal-theme-ext:themeExtensionItemUrl />" >
<portal-fmt:title varname=
'<%=(com.ibm.portal.theme.plugin.ThemeItem)themeExtension%>' /></a>
</portal-theme-ext:themeExtensionLoop>
</portal-theme-ext:themeExtension>
Refer to the descriptions in Tags used by the portal JSPs for more information about the theme extension tags and the their usage options. Refer to the Javadoc information for the Themes public API as the <portal-theme-ext> tags will only work with those interfaces.
Using existing extension points in the included Portal theme
- Implement the desired interface, for example, com.ibm.portal.theme.plugin.ThemeLinkItem .
- Create a plugin.xml file declaring the extension.
- Create the necessary JAR file.
- Put the JAR file in a directory that is on the classpath of the Portal application. It is recommended that you create a new directory to separate your custom code from the base code.
- Add the new directory to the Portal enterprise application classpath. For details refer to the WebSphere Application Server documentation.
- Restart the server and your extension should now be visible in the theme.
Default extension points
The table below describes the extension points included in the default theme. The ID field is the extension point identifier used in the plugin.xml . The Default Implementation field describes the interface which provides the information the default extension point requires. Type enforcement is not performed at runtime.
| ID | Description | Default Implementation |
|---|---|---|
| com.ibm.portal.theme.plugin.MetaTagDataItems | provides components with a method of adding data to the meta tags of a page | {@link DefaultThemeTextItem} |
| com.ibm.portal.theme.plugin.Styles | provides components with a method of contributing CSS styles to the page (either a link or embedded css) | {@link DefaultThemeTextItem} |
| com.ibm.portal.theme.plugin.JavascriptItems | provides components with a method of adding javascript to a page (either a link or actual js code) | {@link DefaultThemeTextItem} |
| com.ibm.portal.theme.plugin.HorizontalPageBarItems | provides components with a method of adding jsp content to the horizontal page bar | {@link DefaultThemeJspInclude} |
| com.ibm.portal.theme.plugin.VerticalPageBarItems | provides components with a method of adding jsp content to the vertical page bar | {@link DefaultThemeJspInclude} |
| com.ibm.portal.theme.plugin.MainContextMenuItems | provides components with a method of adding an item to the main context menu | {@link DefaultThemeLinkItem} |
| com.ibm.portal.theme.plugin.PageContextMenuItems | provides components with a method of adding an item to the main context menu | {@link DefaultThemeLinkItem} |
| com.ibm.portal.theme.plugin.PortletContextMenuItems | provides components with a method of adding an item to the portlet context menu | {@link DefaultThemeLinkItem} |
| com.ibm.portal.theme.plugin.Flyouts | provides components with a method of adding a flyout to the page | {@link DefaultThemeJspInclude} |
Screens
A screen is a page of portal content. When the portal page is first loaded, the Home screen is initially shown (Home.jsp ). Other screens can also be displayed, including the Login screen and the Error screen. Selection of screens is determined by links or buttons on the toolbar, which is provided by a theme. The Home screen includes the <portal-core:pageRender/> tag, which renders the pages layout and content.
Creating links to a custom screen
Portlet content is rendered only within the Home screen. However, you can provide content in other screens that you create. For example, you could create an introductory screen that displays a multimedia greeting to users before they log in to your portal site. The <portal-navigation:url screen="name "/> tag is used to create the link to the JSP in the /screens directory. The name value must be the name of the screen JSP file without the .jsp extension.
In the following example from banner_toolbar.jspf , a URL to the ForgotPassword screen is created for the HREF attribute of the link.
<%-- forgot password button --%>
<portal-logic:if loggedIn="no" notScreen="ForgotPassword">
<% if (firstButton) { firstButton = false; } else { %> | <% } %>
<a class="wpsToolBarLink" href='<portal-navigation:url screen="ForgotPassword" home="public"/> '>
<portal-fmt:text key="link.password" bundle="nls.engine"/>
</a>
</portal-logic:if>
Skins
Skins represent the border rendering around components, such as row containers, column containers, or portlets. The skin is loaded in the portal page by the <portal-core:pageRender/> tag. Skins are installed independently from themes. However, a skin can be associated with a theme.
Skins define more than the look and feel of portlets; they define the look and feel of components . These components include the containers and controls. This hierarchical structure is depicted in the following diagram.
The components of the skin are called in the following order.
- The <portal-core:pageRender/> tag in the Home screen, Home.jsp , displays the components for the selected node. The components are implemented as row containers, column containers, and controls depending upon the portal layout that is defined in the topic Portal page customization. Controls are displayed using Control.jsp . The figure in the Underlying layout of the home screen topic depicts one row container that has two column containers, each containing two portlets.
- The row and column containers display their nested components using either Java code or the <portal-skin:layoutNodeLoop/> and <portal-skin:layoutNodeRender/> elements.
-
Each portlet is rendered by the <portal-skin:portletRender/> tag within the Control.jsp. file. The control also builds the border and title bar around the portlet output.
Note: Some of the icons in the portlet title bar have an impact on performance.
Provided skins
More about the IFRAME skin
The IFRAME (inline frame) skin that is provided has a more practical purpose than the other skins. It renders portlet content in an HTML IFRAME on the page. IFRAMES are treated as separate browser windows and are used for the inclusion of external objects including other HTML documents.
The IFRAME skin is especially useful for portlets that are slow to render, allowing the rest of the portal page to render without waiting on the content from the portlet within the IFRAME. The width of this skin is set to 100% and height is set to 250 pixels.
To change this setting, use following steps:
- Locate the /IFrame subdirectory in the ../skins/html directory.
- Edit the file Control.jsp .
- Locate the markup for the IFRAME:
<iframe src='<%wpsURL.write(out);%>' SCROLLING="auto" FRAMEBORDER="0" Width="100%" height="250">
- Change the width and height attributes of this tag.
- Save and close the file.
Automatic portlet maximization
- Portal level
To configure all portlets to automatically maximize when the mode is changed, set the portlet.automaximize configuration service parameter to true.
- Skin level
This behavior can be implemented in portlet skins, using the <portal-navigation:urlGeneration/> tag, so that the administrator can control which portlets are automatically maximized. For example, you could create a skin called Highlight and a skin called Highlight_Max , with the only difference between the two is that Highlight_Max is used to automatically change the portlet state when the portlet enters another mode other than View.
- Portlet level
To configure specific portlets to automatically maximize, the portlet developer can com.ibm.portal.automaximize initialization parameter to true.
Aggregation
WebSphere Portal provides fully dynamic aggregation of pages from page descriptors that are held in the portal database.
The portal should provide users with a consistent view on portal applications and allow users to define specific sets of applications that are presented in a single context. Depending on the device of the user, the rendering of this application set has to vary to fulfill the requirements of the device. Consider, for example, a set of applications that includes News, Stocks, Weather, and Search, that are to be rendered on a conventional phone using voice interactions, on a WML device with a limited display and keyboard, or on a PC-based browser. The aggregation component must provide the following tasks with each request from the device:
- Gather information about the user, the device or client , and the selected language.
- Select the active portlets from the set of applications to which the user has access.
- Aggregate the output of the active portlets into a coherent, usable display.
After the active page is determined, the layout of the selected page is used to aggregate the content of the defined applications, arrange the output, and integrate everything into a complete page. WebSphere Portal provides fully dynamic aggregation of pages from page descriptors that are held in the portal database.
Rendering of page components is done using JSPs, images, style sheets, and other resources. These resources are located in the file system in a path-naming convention that the portal server uses to locate the correct resources for the client. You must first understand how the location of these resources supports aggregation before you can customize the visual appearance, layout, or add support for other markup languages or clients.
Search order for portal resources
During aggregation, the portal server searches for themes and skins starting with the most specific subdirectory and moving up to the more general, higher-level directory.
| Location in the /themes directory | Location in the /skins directory |
|---|---|
|
|
For example, consider a request from a client using Internet Explorer with the locale set to en_US and the user's skins set to Shadow . The aggregation component of the portal server searches for the file Control.jsp in the following order.
1. /skins/html/Shadow/ie/en_US/Control.jsp
2. /skins/html/Shadow/ie/en/Control.jsp
3. /skins/html/Shadow/ie/Control.jsp
4. /skins/html/Shadow/en_US/Control.jsp
5. /skins/html/Shadow/en/Control.jsp
6. /skins/html/Shadow/Control.jsp
7. /skins/html/ie/en_US/Control.jsp
8. /skins/html/ie/en/Control.jsp
9. /skins/html/ie/Control.jsp
10. /skins/html/en_US/Control.jsp
11. /skins/html/en/Control.jsp
12. /skins/html/Control.jsp
13. /skins/Control.jsp
In this example, if the file is not found in the ../ie/en_US directory, the portal server looks for the file in the ../ie/en directory. The portal server keeps moving through this hierarchy until this file is found. If the file is required, it should at least exist in the /skins or /themes directory, with more specific versions of the file placed in the appropriate subdirectory.
After a file is located by aggregation, the information is stored in memory. This search is not repeated for subsequent requests until the portal server is restarted. As a result, if a file is removed from its original location, the file can not be sent to the client on subsequent requests. For example, if aggregation finds and stores the location of /themes/html/ie/en/Styles.css , subsequent requests, from Internet Explorer with the language preferences set to English, are returned without the file rather than returning /themes/html/ie/Styles.css .
本文介绍了WebSphere Portal中门户页面的组成结构,包括主题、屏幕和皮肤的作用及配置方法。详细解释了如何通过定制主题来调整页面布局,并提供了关于主题策略、屏幕选择和皮肤应用的相关信息。

被折叠的 条评论
为什么被折叠?



