Themes reference

This reference section provides details about cascading style sheet (CSS) and hypertext markup language (HTML) fragments that you can customize for WebSphere® Service Registry and Repository themes.

Overview

A working knowledge of CSS and HTML is essential for the tasks involved. The WebSphere Service Registry and Repository (WSRR) web user interface (UI) is written using CSS 2.1 and XHTML 1.1, wherever possible, for standards compliance and browser compatibility. Inevitably, achieving browser compatibility results in some browser-specific settings in the CSS. These differences are highlighted. The use of a modern standards-compliant browser minimizes any problems encountered.

Page Layout

The web UI operates with two different layout styles:

Standard layout style with no navigation tree:

Banner and Menu bar at top, Content as the main frame, and Footer at bottom.
Standard layout style with the navigation tree:
Banner and Menu Bar at top, Navigation on left, Content on right, and Footer at bottom
The main layout is arranged with CSS styling on division (DIV) elements without the use of frames or tables and supports both left-to-right (LTR) and right-to-left (RTL) alignment. The page content fills the available space in the browser window and has a minimum width applied to avoid crowding the view.

Banner and Footer

You can change the banner and footer theme HTML fragments. These fragments are found in the banner.jsp and footer.jsp files in the root directory of the theme compressed .zip file. These fragments are inserted as the first and last pieces of HTML on the page. The banner supplied with the standard theme gives an example of a simple banner layout that fits any screen width.
<div class="banner">
  <div class="bannerlogo" id="bannerlogo">
    <div class="bannerleft">
      <div class="bannerright"></div>
      <img src="theme/${currentTheme}/images/productLogo.png"
        alt="" id="webspherelogo"/>
      <img src="theme/${currentTheme}/images/productName.png"
        alt="<sr:message key='banner.wsrr.logo'/>"
        title="<sr:message key='banner.wsrr.logo'/>" id="productname"/>
      <img src="theme/${currentTheme}/images/companyLogo.gif"
        alt="<sr:message key='banner.IBM.logo'/>"
        title="<sr:message key='banner.IBM.logo'/>" id="ibmlogo"/>
    </div>
  </div>
  <div class="bannerbottom">
    <div class="bannerbottomleft"></div>
    <div class="bannerbottomright"></div>
  </div>
</div>
The banner graphics are achieved through a combination of CSS background images and absolutely positioned product-specific images. The main banner background is controlled by 3 DIV elements with the following CSS classes:
  • bannerlogo
  • bannerleft
  • bannerright
The first of these classes declares a repeating image for the whole width of the page and the left and right parts then overlay the start and end patterns to form a seamless resizable graphic. The 3 DIV elements below the main background use the same resizable background image technique to provide a thin graphic connecting the main banner with the menu bar.

Keep the outer containing DIV, classed as banner or footer, to provide document containment and an additional selector for CSS style matching specifically for the banner and footer.

The background space between the main banner and the menu bar is controlled by 3 DIV elements with the following CSS classes:
  • bannerbottom
  • bannerbottomleft
  • bannerbottomright

Required images must be referenced from the currently active theme. To do this, the expression language (EL) variable currentTheme can be used as it is in the banner HTML fragment example above. For example, you specify the source location for an image as theme/${currentTheme}/images/productLogo.png which always resolves the image URL in the currently active theme.

Display text can either be given explicitly in the raw HTML or can be supplied in a resource bundle. To supply display text in a resource bundle you must load a UI resource JAR in WSRR that contains the resources you require to display. When the resource JAR is loaded you can then use the <sr:message> tag to place the Resource JAR in the HTML text. For further details about Resource JARs, see the related link.

Gutter

You can change the graphic at the left and right sides of the screen by editing the CSS body and gutters classes:
  • The left gutter is defined in the body class
  • The right gutter is defined in the gutters class

sr:message tag

You can use this tag in HTML fragments in JSP pages to display text from resource bundles loaded into WSRR. The current browser locale is used to resolve the language to use for the text from those listed in the resource JAR.
Table 1. The sr:message tag has the following attributes:
Attribute Type Description
arg0 String The first optional argument.
arg1 String The second optional argument.
arg2 String The third optional argument.
arg3 String The fourth optional argument.
key String The name of the key to find in the message bundle.
filter Boolean Whether to filter unsafe characters from the message value.
resourceBundle String The full name and path of the resource file as contained in the resource JAR. For example, com.ibm.sr.resources.MyResources would be given for a file called MyResources.properties contained in the directory com/ibm/sr/resources in the resource JAR.

Perspective panel

The perspective panel overlay, including the logout link, on the right side of the banner is always present in the page and is set to overlay a blank part of the right side of the banner in the standard theme. If you need to reposition this panel, you must adjust the position information in the CSS class signoutcontainer.

Menu Bar

The menu bar is located below the banner area and provides space for the search box that is aligned to the opposite side of the menus. There are two menu bars present in every page; the perspective panel contains the second menu for the list of perspectives and uses the same basic styling as the primary menu bar.

The HTML text supporting the menu bar is a simple nested unordered list. You can make the menu bar look like a list by editing the menu bar section in CSS. All of the necessary settings for up to 4 levels of cascading menus are provided in the menu bar section of the CSS. Because there are critical CSS attributes that must be present to ensure the correct working of the menus you must change presentation settings only in this section:
  • color
  • border
  • background
  • padding

Navigation

You can show or hide the navigation tree area based on the user's preferences. This is achieved with a fixed-width DIV column present in the content area of the page and the use of the showLeftColumn.css and hideRightColumn.css files. The only change that you might make to either of these two files is to change the default width of 225 pixels. To adjust the navigation column width, change all occurrences of the dimension 225px with the new value, in pixels, in the files pageStyles.css and showLeftColumn.css, including the negative values.

Considerations for right-to-left (RTL) languages

In RTL mode, all elements on screen flow from right to left and are aligned to the right side of the browser window. Additionally, elements that have left or right positional association such as the navigation tree will be presented on the opposite side when in RTL mode. These changes are automatic and are based on the requested locale in the browser. Users who want to change the theme need to be aware of the existence of the RTL support even if the theme is not intended to be used with an RTL language.

CSS

The 4 CSS files found in the CSS directory in the theme contain all the CSS for the product. The main file is pageStyles.css with a secondary file, pageStyles_rtl.css, which is specifically used to override certain layout rules when the web UI is being displayed in RTL mode. This file isorganizedd to include groupings for each of the main areas of the styles to make it easier to find specific settings.
Section Description
Consistency Resets all browser default styles and provides core values inherited by all other elements.
Accessibility Styles to hide the accessibility links from view.
Standard borders Border settings for common HTML elements with borders.
Page structure Defines all the column layouts.
Footer Styles for the page footer.
Banner Styles for the page banner.
Menu bar Defines the appearance of the menu bars.
Search box Styles for the search field.
Misc Miscellaneous selectors.
Home page Styles for the home page.
Graph view Styles for the graph view.
Message boxes Styles for inline message boxes. These are the panels that display messages at the top of most pages.
Portlets Styles for portlets which are the main titled containers used in most web UI views.
Timer animation Styles for the timer animation used in the graph view.
Detail view Styles specific to the detail view and other pages that use the same types of layout.
Structural tables Styles for tables that are used purely to aid in page layout.
Wizard table Styles for wizard-based tables such as the query wizard.
Container divs Styles for DIV elements used to contain sections of the page.
Auto-suggest Styles for the auto-suggest list.
Tabs Defines the appearance of tabs in tabbed views.
Buttons Layout styles for all forms of buttons.
Drop shadow Defines the drop-shadow effect as seen in the logon page.
Dojo template Overrides for the styles provided in the default Dojo theme.
Date time widget Styles for the date and time picker widget used in the business model creation wizard and the detail view.
Policy tree Styles for the policy tree view.
Nav tree Styles for the navigation tree.
Popups Styles for hover popup panels.
Help console Styles for the help console.

Dimensions and measurements

Wherever possible, relative units such as em and ex, must be used to specify dimensions and measurement values. This ensures that font sizes will still appear to be in proportion with the spaces in the page when the text size is changed, either automatically by the choice of locale, or manually by the end user in the browser settings. Absolute units, such as px, pt, pc, cm, and mm, must be avoided except for things such as absolutely positioned items, borders and fixed-size elements such as images.

Fonts

The master font size for the whole page is set in just one place, on the body tag. All other font size values in other CSS selectors are given in units of em and are relative to this master value. For example, a heading style might be set to 1.2em which means it will be displayed at 1.2 times the size of the master font size.
Note: There are some font sizes that are given as 1.0em which, at first glance, would seem to be unnecessary. However, these values are supplied to work around browser font size calculation differences on certain HTML tags such as inputs and tables.
In WSRR, the master font size is variable based on the locale the page is running in and the operating system that the browser is running on. This value can be found in the file dynamiccss.jsp.

The font family property is used very sparingly. The main value which is inherited by most HTML elements comes from the body tag. It is reinforced on inputs and tables for the same reason that the font size is repeated. Additionally, a non-proportional font is given for those elements that require it, pre and samp. This makes it very straightforward to change the master fonts for the whole UI.

Colors and backgrounds

You can apply foreground and background color to most HTML elements through CSS selectors. Adjusting the color scheme for the web UI involves finding the color and background-color properties in the pageStyles.css file as well as the implicit color statements in such items as border definitions.

You can use background images as repeating elements to provide more interesting color options. Several are used in the standard theme. For example, the following property is used for the menu bar background:
background: url(../images/menu_grade.png) top left repeat-x;
Note: You must reference images from CSS in a theme by placing the URL for the image relative to the location of the CSS file.

Browser-specific selectors

The WSRR web UI provides a simplified approach to making browser-specific CSS selectors. The browser type and major browser version are detected from the browser's agent string and are applied as CSS classes on the body tag of every page. For example, if the user is running Firefox version 3, then the body tag will have two additional classes set on it: firefox and firefox3. This allows CSS selectors to be built that apply to all versions of a particular browser or a specific major version of a browser respectively. For example, the following CSS selector is used to override the vertical alignment on an element specifically for Internet Explorer version 6:
.ie6 .checkselection label {
  vertical-align: 50% !important;
}
Note: The browser-specific selector (.ie6) is given as the first term.

Dynamic CSS

You can use the dynamiccss.jsp file to insert CSS into the page at runtime. In the standard theme, this file is used for one selector to set the master font size which can only be calculated when the current locale and browser operating system are known at runtime. Browser-specific selectors mean that dynamic CSS is rarely required. To assist in making conditional checks in the JSP, the following 5 variables are made available to the JSP:
Variable Type Description
browserType String The type of browser currently being used. Possible values:
  • Firefox
  • ie
  • safari
  • chrome
  • opera
browserVersion String The major version of the current browser.
browserLocale String The locale the browser is currently operating in that is in the supported list of languages that WSRR is translated to.
browserPlatform String The operating system the browser is currently running on. Possible values:
  • nt
  • aix
  • solaris
  • linux
  • hp_ux
fontMultiplier String representation of a double The adjustment factor applied to the font size to compensate for locale and platform.
The value of each variable can be accessed in the JSP by using the following method call:
request.getParameter("<var_name>")
Where <var_name> is the name of the variable given in the table above.

Logon pages

The logon pages in the logon theme compressed .zip file provide for full customisation of the panel that users see on first accessing WSRR. The pages allow anyone customizing the logon theme access to all the HTML starting immediately after the body tag. However, there are some usage restrictions:
  1. 1.The following include statement must be added as the first page instruction:
    <%@ include file="../../logonHeader.jsp" %>
    This ensures that the correct page initialization takes place.
  2. 2.The form field inputs for user name and password must be left untouched. Any changes to the attributes on these fields might result in a complete inability to logon to the product. This includes the logic used for adjusting the display for when security is on or off.
  3. 3.The paragraph (p) element with the id of errormsg must remain in the page for the input validation messages to be presented to the user.
There are two EL variables provided for use in the page.
Variable Description
${theme} The name of the current logon theme. Used to reference images in the theme.
${securityOn} Determines whether security is enabled for the application server. It is a Boolean value.