Siebel Tools Reference > Physical User Interface Layer >

Understanding Siebel Templates


A Web template is a special kind of file that contains markup (HTML, WML XML, and so on) interspersed with special Siebel Web engine-specific tags (prefixed by "swe"). It defines the layout and formatting of elements of the user interface (such as views, applets, and controls). Web browsers require HTML to define the layout and formatting of a page. Siebel Web Templates provide this HTML layout information to the Siebel Web Engine when rendering Siebel objects in the repository definition of the application. Wireless applications are rendered in the same manner except for the fact that the markup language in the templates is WML or XML. This section focuses on the configuration of Web (HTML) applications, but many of the concepts are generic across markup languages.

Templates are filled with data and user interface elements by associating views, applets, controls, and other objects defined in Siebel Tools with them. For each view, applet, or control, you map the repository definition to a placeholder in the template. For example, you may have a View object with three applets. You associate a View Template with the view, and map each applet to a placeholder in that template.

An important feature of Siebel Web Templates is that they can be shared between many objects in the repository. Because a template has only placeholders, any number of repository objects can be mapped to a specific placeholder. This allows you to propagate style or structural changes to numerous user interface elements by changing only one template. A typical Web application will contain on the order of 5-50 templates, which together form the bases for several hundred views and applets. For instance, a template which defines the layout and formatting of a standard list applet can be shared among all list applets repository definitions in an application.

The reusability of templates is further enhanced in that the Siebel Web Engine skips over template placeholders which are not mapped in the repository. If a placeholder is not mapped, then it and the HTML contained in between the Siebel tags that define the placeholder are simply ignored. Thus, if the template contains layout for a 10 column wide list applet, but only 2 of the columns are mapped, the other 8 are simply ignored.

Siebel Applications provide numerous applet and view templates with the product, which are extremely flexible; you may not have to modify any of the applet and view templates to support your migrated application. However, in some cases (especially customer-facing and partner-facing applications) you may wish to modify the default templates to reflect your corporate look and feel, or, in some cases, create an entirely new template. Siebel templates must use valid HTML. Adding JavaScript beyond what is already generated by the Siebel Web Engine is not recommended. If it is necessary to add JavaScript, it should be done in Siebel Tools using Browser Script.

NOTE:  You can view Web templates using Siebel Tools, but you modify templates using an external editor. For more information, see Web Template Explorer and Setting Web Preferences.

To allow for even greater flexibility, Siebel eBusiness Applications have provided a mechanism in which a particular template file can include another one. This device is used, for example, to separate handling of the title of an applet from the body. A standard applet layout can be defined once and combined with multiple different title layouts by including a template file that defines the title within the applet template.

By convention, the filenames of Siebel Templates take the .SWT extension; for example, CCPageContainer.SWT, CCHomePageView.SWT, and so on. This Siebel-suggested convention is an abbreviation for Siebel Web Template.

You do not have to follow this convention; the Siebel Web Engine recognizes and interprets the files correctly regardless of how you name them. However, ending your siebel filenames with .SWT may help you.

NOTE:  Template files are typically stored in the Web Template directory under your Tools installation directory. The Filename property references the Web Template object type.

The layout and style of HTML Web pages is dynamic, which allows simultaneous support for multiple browser types and versions (for example, Internet Explorer versus Netscape). Siebel Web templates support conditional branching. Conditions are evaluated based on the results of a business service. See Displaying Server Side Errors in Special Behavior Supported by Templates.

Generated HTML Files

After you configure your application and deploy it on your Web site, it becomes available for viewing through a client's browser.

When a client requests a specific view (either through the application URL directly or by clicking the appropriate link from within another page), the Siebel Web Engine does the following:

  1. Retrieves the object definition of the view from the .SRF and retrieves the object definition of each applet in that view.
  2. Retrieves the data specified in the object definition from the data manager layer of the Application Object Manager.
  3. Matches this data with the template specified by the view and each applet within it.
  4. Renders this view by using the placeholders in the template to define where each element (control, list element) in the object definition is to be placed and how it should be formatted.

When the user views the generated HTML file in a Web browser, it is rendered as a Web Page, and includes all the layout specified in the original template as well as the data and controls retrieved.

Figure 222 shows how Siebel Web Engine generates HTML output using templates, repository definitions, and HTML.

Figure 222. How Siebel Web Engine Generates HTML Output

Click for full size image


 Siebel Tools Reference, Version 7.5, Rev. A 
 Published: 18 April 2003