Bookshelf Home | Contents | Index | Search | PDF | ![]() ![]() ![]() ![]() |
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 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, 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. 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:
- Retrieves the object definition of the view from the .srf and retrieves the object definition of each applet in that view.
- Retrieves the data specified in the object definition from the data manager layer of the Application Object Manager.
- Matches this data with the template specified by the view and each applet within it.
- 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 219 shows how Siebel Web Engine generates HTML output using templates, repository definitions, and HTML.
Types of Templates
The templates you modify fall into one of several groups, depending on the purpose of the template or what the template contains.
- 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. 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.
If Edit/New/Query templates do not exist, Edit List is used in employee applications running high interactivity when editing, creating, and querying. Standard interactivity applications, such as customer and partner applications, do not use Edit List, so you must define an Edit mode template.
- New: Mode for creating a new record.
- Query: Mode that allows you to perform a query-by-example (QBE).
Each mode has a corresponding template. Some templates, such as edit-mode templates, can be shared by many applets.
NOTE: New and Query should only be used if they are different from Edit. Otherwise Edit is used.
- 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).
- 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 Adding Sorting Capabilities to Your Application in Special Behavior Supported by Templates.
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.
Bookshelf Home | Contents | Index | Search | PDF | ![]() ![]() ![]() ![]() |
Siebel Tools Reference Published: 20 October 2003 |