Configuring Siebel eBusiness Applications > Overview of Web Templates and Siebel Tags >

About Siebel Templates

A Web template is a file that contains markup tags (HTML, WML, XML, and so on) interspersed with Siebel tags (prefixed by "swe"). Siebel Web templates define the layout and formatting 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. Each view, applet, or control, is mapped 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 and partner 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 about using Siebel Tools to view Web templates, see Using Siebel Tools.

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. Siebel Web templates support conditional branching. Conditions are evaluated based on the results of a business service.

How SWE Generates 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 124 shows how Siebel Web Engine generates HTML output using templates, repository definitions, and HTML.

Figure 124.  How Siebel Web Engine Generates HTML Output
Click for full size image

Types of Templates

The templates fall into one of several groups, depending on the purpose of the template or what the template contains.

  • Web Page template. Specifies the layout of the whole display. Has information about where the screen bar/view bar/view should appear.
  • Page Container template. Used as container pages for view templates. The overall purpose of the page container is to provide a structure for the overall application. There is one page container per application, but views can be flagged indicating they should not use the container page (for example, the login page cannot use the page container).
  • View template. Used for displaying a view; specifies where to lay out applets and other page-level controls on the view, and what the formatting of the view should be.
  • Applet template. Specifies where to lay out fields and controls for an applet. Also specifies the formatting for elements within the applet.

    Applets can have more than one mode. Each mode is associated with a template. The types of modes are:

    • Base: Read-only mode for displaying but not editing data. Views appear by default in Base mode.
    • Edit. Mode for editing an existing record.

      If New/Query templates do not exist, Edit is used when creating and querying.

    • Edit List. Allows users to edit fields in a list applet.

      Edit List is used for editing, creating, and querying in employee applications running in high interactivity. Standard interactivity applications, such as customer and partner applications, do not use Edit List, so you must define an Edit mode template (even if Edit/New/Query templates are defined).

    • New: Mode for creating a new record.
    • Query: Mode that allows you to perform a query-by-example (QBE).

NOTE:  New and Query should only be used if they are different from Edit. Otherwise, Edit is used.

  • Formatting templates. Templates that allow you to create custom HTML types, such as specialized controls, list items, and page items. These templates have the extension .SWF (Siebel Web Format). For more information about .SWF files, refer to Creating Custom HTML Control Types.

Your application can contain other pages, of course, that do not contain any Siebel tags. For example, you may have an About This Application help page. However, this page, by definition, is not a template.

Configuring Siebel eBusiness Applications