Entering content frameFunction documentation Setting Stylesheets for HTMLB and XHTMLB Locate the document in its SAP Library structure

Use

So that BSP applications look uniform, within BSP extensions HTMLB and XHTMLB you can use stylesheets, JavaScript files and pictures that are stored in the MIME repository. These stylesheets, JavaScript files and pictures are usually located on the same SAP Web Application Server. The default path in the MIME repository is: /sap/public/bsp/sap/public/bc/(x)htmlb. The *.css and *.js files are stored below directories htmlb and xhtmlb. The *.gif files are located in an additional sub-directory.

In specific cases you may want to change the appearance of the HTMLB or XHTMLB libraries. This may be necessary, for example, if a customer’s corporate identity should be depicted exactly. In this case we recommend that you copy and modify the files from the MIME repository for the HTMLB and XHTMLB libraries.

For this reason, the BSP runtime and HTMLB manager contain an infrastructure for handling paths to other locations, from where you may want to insert stylesheets, JavaScript files or pictures.

Note

Alternatively, you can use the theme concept of the MIME repository to change specific files to a different theme.
You can find additional information in
Structure linkLayout Adjustments to BSP Applications.

Prerequisites

You are using a system from SAP Web AS 6.20 and have implemented at least Support Package 7.

Functions

A new directory such as \myRoot is created. This directory has the subdirectories \HTMLB and \XHTMLB and their corresponding files.

Note

You only need to copy the *.css and *.gif files. The *.js files are always loaded from their original location.

The sample directory structure now looks as follows:
  /myRoot/HTMLB/controls_*.css
  /myRoot/HTMLB/subdirectories/*
  /myRoot/XHTMLB/controls_*.css

  /myRoot/XHTMLB/subdirectories/*

To use the new directories for your BSP extensions and, therefore, in your BSP applications, use the URL parameter sap-themeRoot.

Caution

When you specify the external path, be aware of "URL escaping". Usually the colon ( : ) is coded as %3A and the slash ( / ) is coded as %2F, for example.

Here are a few examples with "URL escaping" (%2F and %3A):

Example

Example of /myRoot on the same host:
http://host.domain.ext:port/sap/bc/bsp/sap/sbspext_htmlb/button.bsp?sap-themeRoot=%2FmyRoot

Example of /myRoot on a different host:
http://host.domain.ext:port/sap/bc/bsp/sap/sbspext_htmlb/button.bsp?sap-themeRoot=http%3A%2F%2Fanother.host.domain.ext%3Aport%2FmyRoot

In case specific BSP applications run as public applications and do not require authentication steps, you could proceed as follows: If the copied stylesheets are stored on the SAP Web AS again, you can set up an Structure linkExternal Alias (see also Structure linkCreating an ICF Service) and then access the stylesheets using this alias.

In future, several themes will be delivered with HTMLB/XHTMLB. These additional themes are stored in subdirectories in the MIME repository.

Note

Note that the HTMLB library stores the files for the previous appearance (classic design) in the directory \HTMLB, and the files for the new design (Design2002) are stored in the directory \HTMLB\design2002. For both variants, additional, centrally delivered themes are stored in the subdirectories.

Example

In this example we are assuming that the theme "mono" will be delivered in future. The structure in the MIME repository then looks as follows:

  /sap/public/bsp/sap/public/bc/htmlb/controls_*.css
  /sap/public/bsp/sap/public/bc/htmlb/mono/controls_*.css <-- other theme
  /sap/public/bsp/sap/public/bc/htmlb/design2002/controls_*.css <-- new design
  /sap/public/bsp/sap/public/bc/htmlb/design2002/mono/controls_*.css <-- other theme
  /sap/public/bsp/sap/public/bc/xhtmlb/controls_*.css
  /sap/public/bsp/sap/public/bc/xhtmlb/mono/controls_*.css <-- other theme

Note the following points:

The same sap-themeRoot can be used to access the alternative themes specified in the example above. Use the sap-themeRoot=name to access the various themes that are delivered for the HTMLB/XHTMLB libraries.

Example

http://host.domain.ext:port/sap/bc/bsp/sap/sbspext_htmlb/button.bsp?sap-themeRoot=mono

In all of the above examples, the new sap-themeRoot is coded in the URL as a URI parameter (URL mangling is not executed until the SAP Web AS System is accessed for the first time).

There are, however, cases where it would be practical to set the sap-themeRoot directly in the program. The BSP element <htmlb:content> was enhanced with the themeRoot attribute that has exactly the semantics explained above. Since however URL mangling is not carried out when the BSP page is processed, this means that this attribute is only used on the specific page on which is was also set. We recommend that if this attribute should be used, you should set it for all pages.

Example

<htmlb:content design="design2002" themeRoot="mono">

 

 

Leaving content frame