Vous êtes sur la page 1sur 192

Siebel Self-Service Application Developers Guide

Version 8.1, Rev. A January 2010

Copyright 2005, 2010 Oracle and/or its affiliates. All rights reserved. The Programs (which include both the software and documentation) contain proprietary information; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs, except to the extent required to obtain interoperability with other independently created software or as specified by law, is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. This document is not warranted to be errorfree. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose. If the Programs are delivered to the United States Government or anyone licensing or using the Programs on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the Programs, including documentation and technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19, Commercial Computer Software--Restricted Rights (June 1987). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065. The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup, redundancy and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and we disclaim liability for any damages caused by such use of the Programs. The Programs may provide links to Web sites and access to content, products, and services from third parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites. You bear all risks associated with the use of such content. If you choose to purchase any products or services from a third party, the relationship is directly between you and the third party. Oracle is not responsible for: (a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the third party, including delivery of products or services and warranty obligations related to purchased products or services. Oracle is not responsible for any loss or damage of any sort that you may incur from dealing with any third party. Oracle, JD Edwards, and PeopleSoft are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Contents

Siebel Self-Service Application Developers Guide 1

Chapter 1: Chapter 2:

Whats New in This Release Siebel Self-Service Application Architecture


13

About Siebel Self-Service Applications

High-Level Architecture of Siebel Self-Service Applications 13 Self-Service Application Components and How They Interact 15

About the Siebel Database and Business Objects About the Model-View-Controller Design Pattern
Model Layer 19 Data Binding Layer 20 Controller Layer 21 View Layer 22

16 19

Project Structure of Self-Service Applications


Siebel Web Service Authentication 24 Siebel Web Service Handler Class 24 SessionAM Application Module 25 Session Attributes in the View Layer 25 Access Control and Authorization 25 ADF Binding Filter 26 Session Cookie 27 Failover 27

22 23

About Session Handling in Self-Service Applications

Chapter 3:

Overview of Customizing Siebel Self-Service Applications


29 30

Customization Strategy for Self-Service Applications Customization Support for Self-Service Applications Customizable Files for Self-Service Applications 30

Files That Must Be Renamed Before Customization 30 Files That Cannot Be Renamed Before Customization 31

Roadmap for Customizing Siebel Self-Service Applications

32 33

About the Application Configuration File for Self-Service Applications

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Contents

About the Source Code for Java Classes in Self-Service Applications

33

Chapter 4:

Setting Up the Development Environment for Siebel Self-Service Applications


35
35

Installing and Configuring Siebel Business Applications


Installing and Configuring Siebel Business Applications Activating Self-Service Web Services 36 Activating Self-Service Workflow Processes 36

Installing Oracle JDeveloper

37 37 38 37 38

Installing and Configuring the Oracle Application Server Connecting to the Oracle Application Server

Deploying the Standard Java EE Application to the Oracle Application Server Importing the Java EE Application Into Oracle JDeveloper Process of Cleaning Up After Importation 39
40 Cleaning the Model and ViewController Projects Removing Duplicate Class Files 40

Connecting to an Oracle Database for Data Passivation Configuring Endpoint URLs 42 44 46 Configuring Authentication in Oracle JDeveloper Deploying a Patch to a Development Workstation

41

Chapter 5:

Customizing Pages for Siebel Self-Service Applications


50

About User Interface Page Templates for Self-Service Applications


Standard Page Skeleton File 51 af:panelBorder Tag and Facets 54 Regions 55 Page Header 55 Page Footer 58 Error Messages and Generic Error Page

59

Service Request Page Example for Siebel E-Support

60 62 63 64 64

Customizing Page Templates for Self-Service Applications Customizing Regions for Siebel Self-Service Applications About Template Indirection 64

Creating Page Templates for Siebel Self-Service Applications

About Page Template Mappings for Siebel Self-Service Applications


4

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Contents

Page Template Mapping Example for Self-Service Applications Setting Page Template Mappings for Self-Service Applications About Page Flows for Self-Service Applications 76 77 80 Page Flow Example for the Self-Service Shopping Cart Customizing Page Flows for Self-Service Applications About Process Trains for Self-Service Applications
Sample Process Train for Self-Service Applications

66 74 75

Customizing Page Template Mappings for Self-Service Applications

80
81

Service Request Process Train Example for Siebel E-Support Customizing Process Trains for Self-Service Applications
Customizing the Service Request Process Train 94 Customizing the Menu Model to Add the Survey Page 96

85

94

Chapter 6:

Customizing Menus for Siebel Self-Service Applications


99
101

About the Menu Model for Self-Service Applications


About Permissions 100 About Locale-Specific Menus About Bookmarking 101

Menu Model Example for Self-Service Applications Customizing the Menu for Self-Service Applications

101 113 114 114 118

Showing and Hiding Menu Nodes Based on Business Logic

Using the Condition Property to Hide Detail Nodes in List-Detail Pages Using the af:goLink Tag for Navigating to Secure and Nonsecure Pages

Chapter 7:

Customizing the Appearance of Siebel SelfService Applications


119 120 120

About Skins for ADF Faces

Customizing Self-Service Application Appearance

Customizing Menu Orientation for Self-Service Applications

Chapter 8:

Customizing the Model Layer for Siebel SelfService Applications


123
124
5

About the Java Object Cache

Cache Lifetime and Size 124 Default Attributes of a Cache Region

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Contents

Declarative Cache File Sample

124

Configuring the Java Object Cache

125 126
129

Creating Java Object Cache Loader Classes


Creating a Java Object Cache Loader Class

About ADF Business Components

130 131

Optimizing ADF Business Component Performance

Configuring Lazy Component Load During Deployment 131 Configuring Lazy Component Load in Oracle JDeveloper 132

Process of Creating New ADF Business Components from Siebel Web Services
Creating a Web Service Client Proxy 132 Creating a Programmatic View Object 133 Creating an Application Module 134 Modifying ADF Business Component Code to Access Web Service Data

132

136

Process of Extending ADF Business Components

161
162

Adding a Field to a Siebel Business Component 162 Adding the Business Component Field to an Integration Object Exposing Siebel Data to External Applications 163 Re-Creating the Web Service Client Proxy 164 Extending ADF Business Components 167

Configuring Failover on the SessionAM Application Module About ADF Data Control About ADF Binding 171 171 169

169

Binding a View Object to a User Interface Page

Chapter 9:

Deploying and Testing Customized Siebel SelfService Applications


173 174

Testing a Java EE Application in Oracle JDeveloper


Creating Creating Creating Creating Creating a a a a a Deployment Deployment Deployment Deployment Deployment

Process of Packaging the Java EE Application for Deployment

Project 174 Profile for the Model Project 174 Profile for the ViewController Project 175 Profile for the Java EE Application 175 Descriptor 176

Deploying a Customized Java EE Application to the Oracle Application Server Deploying a Customized Java EE Application to an Enterprise Archive File Deploying the EAR File to the Oracle Application Server in the Development Environment 178
6 Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

177

177

Contents

Configuring the Endpoint URL After Deployment Testing Deployed Java EE Applications 180

179 180

Deploying the EAR File to the Production Environment

Chapter 10: Monitoring Diagnostic Information and Error Messages for Siebel Self-Service Applications
About the Oracle Dynamic Monitoring Service Configuring Java EE Logging 181
Creating the j2ee-logging.xml File 182 Configuring the logging.properties File 183 Configuring the Java Policy File 183

181

About Oracle Application Diagnostics for Java About Error Pages for Self-Service Applications

183 184 184 184 185

About Enabling Web Services Tracing on the Siebel Server About Monitoring Siebel Application Performance Configuring Diagnostic Logging on the Siebel Server

Index

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Contents

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Whats New in This Release

Siebel Self-Service Application Developers Guide describes the architecture and configuration of Oracles Siebel Self-Service Applications, version 8.1. Its audience is developers who are familiar with the Java programming language, Java Platform, Enterprise Edition (Java EE) applications, and Oracle JDeveloper.

Whats New in Siebel Self-Service Application Developers Guide Version 8.1, Rev. A
Table 1 lists changes described in this version of the documentation to support release 8.1 of the software.

Table 1. Topic

New Product Features in Siebel Self-Service Application Developers Guide, Version 8.1, Rev. A Description Modified topic. Click Yes when asked whether to migrate the projects in the application to Oracle JDeveloper version 10.1.3.3. Modified topic. Better performance is obtained by adding a custom extension column to a base table, rather than by using a join to an extension table.

Importing the Java EE Application Into Oracle JDeveloper on page 38 Adding a Field to a Siebel Business Component on page 162

Additional Changes in Siebel Self-Service Application Developers Guide Version 8.1, Rev. A
Directory paths in examples have been modified to conform to UNIX syntax rather than Microsoft Windows.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Whats New in This Release

Whats New in Siebel Self-Service Application Developers Guide Version 8.1


Table 2 lists changes described in this version of the documentation to support release 8.1 of the software.

Table 2. Topic

New Product Features in Siebel Self-Service Application Developers Guide, Version 8.1 Description Structure of the Siebel Self-Service Applications, which are Java EE applications. Tasks for customizing applications and testing and deploying customized applications. It also lists the customizable files. Initial deployment of applications to the development environment for customization, as well as other setup tasks. Detailed description of the page templates and customization tasks. Detailed description of the menu model and customization tasks. Customizing the appearance of user interface features, such as buttons and tabs. Customizing Oracle ADF Business Components, Web service client proxies, and the Java Object Cache. Binding user interface (UI) objects to business logic. Testing your customized applications in Oracle JDeveloper and in the development environment, and then deploying the applications to the production environment. Provides log file, diagnostics, and troubleshooting information.

Chapter 2, Siebel Self-Service Application Architecture Chapter 3, Overview of Customizing Siebel Self-Service Applications Chapter 4, Setting Up the Development Environment for Siebel Self-Service Applications Chapter 5, Customizing Pages for Siebel Self-Service Applications Chapter 6, Customizing Menus for Siebel Self-Service Applications Chapter 7, Customizing the Appearance of Siebel Self-Service Applications Chapter 8, Customizing the Model Layer for Siebel Self-Service Applications Chapter 9, Deploying and Testing Customized Siebel Self-Service Applications Chapter 10, Monitoring Diagnostic Information and Error Messages for Siebel Self-Service Applications

Related Documents
For more information on deploying Siebel Self-Service Applications, see Siebel Self-Service Application Deployment Guide on the Siebel Bookshelf. NOTE: The Siebel Bookshelf is available on Oracle Technology Network (OTN), Oracle E-Delivery, or it might be installed locally on your intranet, or on a network location. For more information on individual applications, see the following guides on the Siebel Bookshelf: Siebel E-Commerce Administration Guide

10

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Whats New in This Release

Siebel E-Support Administration Guide Siebel Chat Guide

For more information on Oracle application development tools and Oracle Application Server, see the following documentation on Oracle Technology Network: Oracle Application Development Framework Developers Guide For Forms/4GL Developers Oracle Application Server Administrators Guide Oracle Application Server Installation Guide for the operating system you are using Oracle JDeveloper 10g Online Help

For information on configuring Siebel Business Applications other than Siebel Self-Service Applications, see Configuring Siebel Business Applications on the Siebel Bookshelf.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

11

Whats New in This Release

12

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Siebel Self-Service Application Architecture

This chapter describes the architecture of Siebel Self-Service Applications. It includes the following topics: About Siebel Self-Service Applications on page 13 About the Siebel Database and Business Objects on page 16 About the Model-View-Controller Design Pattern on page 19 Project Structure of Self-Service Applications on page 22 About Session Handling in Self-Service Applications on page 23

About Siebel Self-Service Applications


Siebel Self-Service Applications are Java Platform, Enterprise Edition (Java EE) applications that obtain their business logic from Siebel Business Applications and their data from a Siebel Database. From the Siebel perspective, these applications retain the Siebel Database and Data Objects and Business Objects layers of Siebel Business Applications, while using Java EE for the User Interface (UI) Objects and Physical UI Layers.

High-Level Architecture of Siebel Self-Service Applications


Siebel Business Applications version 8.1 are enabled for Service-Oriented Architecture (SOA). Siebel business logic can be accessed using Web services, which allow applications to be built on top of Siebel Business Applications using any technology that can make Web service calls. Siebel SelfService Applications have been built using Java EE technologies that call specific Siebel Self-Service Web services. Siebel Self-Service Applications make the business logic of Siebel customer applications available to users outside the deploying company's corporate network. The business logic is implemented in Java EE applications on a server placed in a demilitarized zone (DMZ) between the deploying companys internal and external firewalls. NOTE: For Siebel Public Sector E-Support, interpret references to deploying company throughout this guide as deploying agency.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

13

Siebel Self-Service Application Architecture About Siebel Self-Service Applications

Figure 1 illustrates the high-level architecture of Siebel Self-Service Applications, showing their relation to Siebel Business Applications.

Figure 1.

High-Level Architecture of Siebel Self-Service Applications

14

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Siebel Self-Service Application Architecture About Siebel Self-Service Applications

Self-Service Application Components and How They Interact


The detailed architecture of Siebel Self-Service Applications is shown in Figure 2.

Figure 2.

Components of Siebel Self-Service Applications

The application flow in Figure 2 is as follows:

1 2 3 4

Siebel business objects retrieve and organize data from the Siebel Database. Integration objects and business services abstract a useful subset of the data. Business services are deployed as Web services to be consumed by the Java EE application. Siebel Web services are called from the Model layer of the Java EE application, which is organized according to the Model-View-Controller design pattern. Data is passed by a Simple Object Access Protocol (SOAP) message. The Java EE application populates view objects within the ADF Business Components with Siebel data.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

15

Siebel Self-Service Application Architecture About the Siebel Database and Business Objects

6 7 8

ADF Binding and ADF Data Control associate data from the view objects with user interface objects. The Controller layer selects views for presentation. Data is displayed in the UI by the View layer and sent to the client through HTTP or HTTPS.

For more information on the architecture of Siebel Business Applications, see Configuring Siebel Business Applications. NOTE: Oracle Application Development Framework (Oracle ADF) requires a connection to an Oracle database for data passivation, which is not shown in Figure 2 on page 15. For more information on the database connection, see Connecting to an Oracle Database for Data Passivation on page 41.

About the Siebel Database and Business Objects


Table 3 provides an overview of the Siebel objects used in Siebel Self-Service Applications. The creation and configuration of these objects are described in detail in Configuring Siebel Business Applications and Integration Platform Technologies: Siebel Enterprise Application Integration.

Table 3. Object Database

Siebel Objects Description Standard relational database organized into tables containing columns. Siebel business objects retrieve data from the Siebel Database according to the required business logic. Associates columns from one or more tables into a single structure. Business components provide a layer of wrapping over tables, allowing UI objects to reference business components rather than the underlying tables. Business components contain fields, which correspond to table columns. For example, Contact is a Siebel business component containing contact information such as first name, last name, and address. NOTE: Siebel business components are not the same as ADF Business Components. For more information on Siebel business components, see Configuring Siebel Business Applications. For more information on ADF Business Components, see Oracle Application Development Framework Developers Guide For Forms/4GL Developers on Oracle Technology Network.

Business component

16

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Siebel Self-Service Application Architecture About the Siebel Database and Business Objects

Table 3. Object

Siebel Objects Description Groups related business components together. Business objects allow you to establish relationships among business components according to your business logic. For example, the Opportunity business object links business components such as Opportunity, Product, and Contact allowing you to display products related to an opportunity or contacts associated with the opportunity. For more information on Siebel business objects, see Configuring Siebel Business Applications.

Business object

Integration component

Abstracts business component data for integrating Siebel Business Applications with external applications. For more information on Siebel integration components, see Integration Platform Technologies: Siebel Enterprise Application Integration.

Integration object

Abstracts a business object for integrating Siebel Business Applications with external applications. For more information on Siebel integration objects, see Integration Platform Technologies: Siebel Enterprise Application Integration.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

17

Siebel Self-Service Application Architecture About the Siebel Database and Business Objects

Table 3. Object

Siebel Objects Description Contains a set of methods that operate on integration objects. Siebel business services can simplify the task of moving data and converting data formats between Siebel Business Applications and external applications. While business components and business objects are typically tied to specific tables in the Siebel data model, Siebel business services are not tied to specific objects, but act upon objects to achieve a particular goal. NOTE: In Java EE, business logic is often referred to as business services. These business services are not the same as Siebel business services. For more information on Siebel business services, see Integration Platform Technologies: Siebel Enterprise Application Integration.

Business service

Web service

Exposes business logic in a way that can be accessed by any application. Business services in Siebel Business Applications can be exposed as Web services to be consumed by an external application. Web services combine component-based development with Internet standards and protocols that include HTTP, XML, Simple Object Access Protocol (SOAP), and Web Services Description Language (WSDL). You can reuse Web services regardless of how they are implemented. Web services can be developed on any computer platform and in any development environment as long as they can communicate with other Web services, using these common protocols. Siebel EAI UI Data Sync (UDS) Web services provide external Web applications access to Siebel data and functionality. UDS Web services expose version-independent interfaces with strongly typed arguments and provide access to UI operations, such as insert, delete, update, query and execute. These Web services are available through the Custom Application Object Manager (CustomAppObjMgr) component. For more information on Siebel UDS Web services, see Integration Platform Technologies: Siebel Enterprise Application Integration. For more information on Custom Application Object Manager components, see Siebel Self-Service Application Deployment Guide.

18

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Siebel Self-Service Application Architecture About the Model-View-Controller Design Pattern

About the Model-View-Controller Design Pattern


The Model-View-Controller (MVC) design pattern for Java EE applications separates business and presentation logic within these applications. This separation minimizes code duplication and maintenance when the Java EE application is updated, for example, to support a browser on a new mobile device. It also allows developers to specialize in visual design or implementing business logic. Oracle Application Development Framework (Oracle ADF), which is used to build Siebel Self-Service Applications, follows the MVC design pattern. For more information on Oracle ADF, see Oracle Application Development Framework Developers Guide For Forms/4GL Developers on Oracle Technology Network. The MVC design pattern used in Siebel Self-Service Applications consists of the following layers: Model Layer on page 19 Data Binding Layer on page 20 Controller Layer on page 21 View Layer on page 22

Model Layer
The Model layer of an application consists mainly of the ADF Business Components module. An ADF Business Component encloses an application module and one or more view objects. A view object calls a Web service and retrieves the required number of rows from the Siebel Database as needed. Pagination is also implemented in the view objects. For information on using view objects to access Siebel Web services, see Modifying ADF Business Component Code to Access Web Service Data on page 136. The Model layer does the following: Contains the business logic and the operations that control data access and modification Notifies the View layer when the user interface needs to be refreshed Allows the View layer to query it

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

19

Siebel Self-Service Application Architecture About the Model-View-Controller Design Pattern

The Model layer in Siebel Self-Service Applications consists of the modules described in Table 4.

Table 4. Module

Model Layer Modules Description Contain application modules with programmatic view objects that retrieve rows from the Siebel database by calling Web services. Simplify building business logic for developers familiar with fourthgeneration programming language (4GL) tools, such as Oracle Forms. For more information on ADF Business Components, see Oracle Application Development Framework Developers Guide For Forms/ 4GL Developers on Oracle Technology Network. For more information on configuring ADF Business Components, see Chapter 8, Customizing the Model Layer for Siebel Self-Service Applications.

ADF Business Components

Java Object Cache

Is a distributed cache of Java objects that can be used on any Java platform and by any Java application. It allows applications to share objects across requests and users, and coordinates the life cycle of the objects across processes. Objects are cached within the process memory space. The Java Object Cache is a single service shared by all threads running in the process. The Java Object Cache can manage any Java object. To facilitate sharing of cached objects, all objects within the cache are accessed by name. For more information about the Java Object Cache, see About the Java Object Cache on page 123. For information on configuring the Java Object Cache, see Configuring the Java Object Cache on page 125.

Web Service Client Proxy

Calls Siebel Web services. Created by Oracle JDeveloper. For information on creating Web service client proxies, see Creating a Web Service Client Proxy on page 132.

Data Binding Layer


Data binding implements the JSR-227 specification of the Java programming language. It adds another layer of abstraction between the business logic and the presentation logic, allowing user interface objects to be bound (by dragging and dropping in Oracle JDeveloper) to a variety of data controls exposed from ADF Business Components, Enterprise JavaBean (EJB) session beans, and TopLink Plain Old Java Objects (POJOs). In Oracle ADF, data binding is also called ADF Model.

20

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Siebel Self-Service Application Architecture About the Model-View-Controller Design Pattern

The data binding layer in Siebel Self-Service Applications consists of the modules described in Table 5.

Table 5. Module

Data Binding Modules Description Describes and manages the characteristic interactions between specific kinds of UI components (View and Controller layers) and the methods provided by the Model layer. For more information on using ADF Binding, see About ADF Binding on page 171. For more information on ADF Binding, see Oracle Application Development Framework Developers Guide For Forms/4GL Developers on Oracle Technology Network.

ADF Binding

ADF Data Control

Provides supplemental metadata about the Model layer's capabilities and constraints, as well as a simple interface for normalizing typical transactional interactions with the Model layer. For more information on using ADF Data Control, see About ADF Data Control on page 169. For more information on ADF Data Control, see Oracle Application Development Framework Developers Guide For Forms/4GL Developers on Oracle Technology Network.

For more information on the JSR-227 specification, see the following: JSR 227: A Standard Data Binding & Data Access Facility for J2EE at http://jcp.org JSR 227 FAQ on Oracle Technology Network at http://www.oracle.com/technology/products/jdev/htdocs/techinfo/jsr227.html

Controller Layer
The Controller layer defines the Java EE applications behavior: Controls UI navigation, selecting views for presentation Determines what happens when a user interacts with a component, such as clicking a button Dispatches user requests, such as database queries

The Controller allows the business logic (Model) and presentation logic (View) to be changed independently, simplifying application maintenance.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

21

Siebel Self-Service Application Architecture Project Structure of Self-Service Applications

In Siebel Self-Service Applications, the JavaServer Faces (JSF) framework is used as the Controller layer. JSF is a server-side, component-based framework for developing Web applications. It separates the navigation and data flow, consistent with the MVC framework, and allows developers to manipulate standard UI components with visual editors. For more information on JSF, see JavaServer Faces Technology at http://java.sun.com

View Layer
The View layer renders the contents of the Model layer and determines how data is displayed. It forwards user input to the Controller. JSF can be used for the View, as well as for the Controller. However, Siebel Self-Service Applications use ADF Faces as the View layer. ADF Faces is a set of UI components based on JSF. ADF Faces conforms to Java specification JSR-127 and extends the functionality of JSF version 1.1: Has more than 100 types of components Supports client-side validation Allows partial-page rendering Provides page-flow scoped variables, making it easier to pass values from one page to another Supports internationalization

ADF Faces is implemented as JavaServer Pages (JSP) files. These files, which have the extension .jspx, are XML files with specialized tags in them. For more information on ADF Faces, see Oracle Application Development Framework Developers Guide For Forms/4GL Developers on Oracle Technology Network.

Project Structure of Self-Service Applications


The Java EE application that contains Siebel Self-Service Applications comprises the following projects in Oracle JDeveloper: Model. This project contains the following:

ADF Business Components Java Object Cache Web Service Client Proxy

ViewController. This project contains the following:


JSPX pages with JSF and ADF Faces components JSF navigation Data bindings to the Model layer

22

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Siebel Self-Service Application Architecture About Session Handling in Self-Service Applications

JSF managed beans

The applications are supplied in an Enterprise Archive (EAR) file, which is deployed to the Oracle Application Server. For information on deploying EAR files, see Chapter 9, Deploying and Testing Customized Siebel Self-Service Applications.

About Session Handling in Self-Service Applications


Siebel Self-Service Applications use the ADF Business Component state management facility for session handling. This provides the advantage of accessing session information at the Model layer. For more information on the ADF Business Component state management facility, see Oracle Application Development Framework Developers Guide For Forms/4GL Developers on Oracle Technology Network. Figure 3 shows the session handling flow in Siebel Self-Service Applications.

Figure 3.

Session Handling in Siebel Self-Service Applications

The session handling flow is described in the following topics: Siebel Web Service Authentication on page 24 Siebel Web Service Handler Class on page 24 SessionAM Application Module on page 25 Session Attributes in the View Layer on page 25 Access Control and Authorization on page 25 Session Cookie on page 27 Failover on page 27

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

23

Siebel Self-Service Application Architecture About Session Handling in Self-Service Applications

Siebel Web Service Authentication


Because Siebel Web services maintain their own sessions, every call must either authenticate or use the Siebel session token, sent in a previous response, to recognize the session. The session-related information is accepted in the SOAP header of the Web service request. Therefore, every Web service request must contain the following SOAP header information: <UsernameToken ... >username</UsernameToken> <PasswordText ... >password</PasswordText> <SessionType ... >None|ServerDetermine|Stateful</SessionType> <SessionToken ... >SiebelSessionToken</SessionToken> The SOAP header information will vary according to the following: Guest (anonymous) users. For anonymous users, the anonymous Siebel session is used. There is no session ID in the SOAP header. UsernameToken and PasswordText are blank, and SessionType is None. Authenticated users. For authenticated users, SessionType is ServerDetermine, so that there is a Siebel session ID established or reused. To allow developers to change the SessionType to Stateful from ServerDetermine if there are response-time issues with Stateless interaction, the code can get the session type from a configurable parameter. For more information on authentication in Siebel Web services, see Integration Platform Technologies: Siebel Enterprise Application Integration. Session token. If the Siebel session token is present, it is not necessary to send the username and password in the SOAP header. Single sign-on (SSO). If there is an SSO mechanism in place, PasswordText is the TrustToken configuration value of the Siebel Server. In Siebel Self-Service Applications, the TrustToken value is stored in the SSO_TRUST_TOKEN parameter in the SelfServiceConfiguration.properties file in Model/classes/oracle/apps/ss/base/model/resources. For more information on SSO setup in Siebel Self-Service Applications, see Siebel E-Support Administration Guide and Siebel Security Guide.

Siebel Web Service Handler Class


The Siebel Web service handler, a Java class named SiebelWSHandler, is called during Web service requests and responses. After user authentication, the handler gets the session token from the Web service response and puts it in the SessionAM application module. On subsequent Web service calls, the handler adds the session token to the Web service request. NOTE: When you create a Siebel Web service client proxy, you must attach the Siebel Web service handler to the proxy. For more information on attaching SiebelWSHandler, see Creating a Web Service Client Proxy on page 132.

24

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Siebel Self-Service Application Architecture About Session Handling in Self-Service Applications

SessionAM Application Module


There is one root application module, SessionAM, for the entire Java EE application. All other application modules are nested under SessionAM, so that they all share the same oracle.jbo.Session package therefore a single Application Module pool for the Siebel Self-Service Applications. The oracle.jbo.Session package can be seen as an equivalent to HttpSession for the Model layer. It is bound to a HttpSession object by default. The transaction and application module states are reset when HttpSession expires. For more information on HttpSession, see the Javadoc page Interface HttpSession at http://java.sun.com SessionAM stores the AppSession object, which contains session-related information such as username, password, Siebel session token, locale, account ID, and so on. The high-level components of the AppSession object are the following: Accessor and mutator methods on attributes stored in AppSession, for example, getUserName() and setPrimaryAccountId() Hash map of permissions assigned to the user Hash map of responsibilities assigned to the user

Session information can persist after HttpSession timeout or browser closure, a feature not supported by HttpSession. Thus if one node in a clustered environment fails, the transaction can be activated from other nodes. For more information, see Failover on page 27.

Session Attributes in the View Layer


The session information is also exposed in the View layer with the help of a managed bean, sessionBean, and a page definition for SessionAM. This enables Oracle ADF pages to refer to the appSession instance using Expression Language, for example: #{sessionBean.userName} This managed bean does not hold any attributes, but uses data control bindings to reference the AppSession object stored in SessionAM to return values.

Access Control and Authorization


After authentication, the logged-in user's responsibilities and permissions come into effect, which determines the features in Siebel Self-Service Applications to which he or she has access.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

25

Siebel Self-Service Application Architecture About Session Handling in Self-Service Applications

The user's responsibility assignments are stored in Siebel Business Applications. Each responsibility contains a number of permissions. The responsibility-permissions mappings are stored in the AccessControl.xml file. This file is based on a defined XML schema. The mappings contained in this file are loaded the first time the ADF Binding filter, SelfServiceFilter, is accessed. They are stored in application scope. Logged-in and anonymous user permissions are loaded into the session based on the responsibilities returned by the Siebel Web service. All requests to the application are through SelfServiceFilter. For more information on authentication in Siebel Self-Service Applications, see Siebel Self-Service Application Deployment Guide and Siebel Security Guide.

ADF Binding Filter


When you use Oracle ADF data controls to build Web pages, the following must be configured in the web.xml file: ADF Binding filter. A servlet filter to create the ADFContext, which contains context information about ADF, including the security context and the environment class that contains the request and response object. Oracle ADF applications use this filter to preprocess any HTTP requests that might require access to the binding context. Servlet context parameter for the application binding container. Specifies which CPX file the filter reads at runtime to define the application binding context. For information about CPX files, see About ADF Binding on page 171.

In Oracle JDeveloper, when you first use the Data Control Palette to build your data-bound JSF page, the Oracle ADF data binding configuration settings are automatically added to web.xml. The following example shows part of a web.xml file containing ADF Binding settings: <context-param> <param-name>CpxFileName</param-name> <param-value>view.DataBindings</param-value> </context-param> <filter> <filter-name>adfBindings</filter-name> <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class> </filter> <filter-mapping> <filter-name>adfBindings</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <filter-mapping>

26

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Siebel Self-Service Application Architecture About Session Handling in Self-Service Applications

<filter-name>adfBindings</filter-name> <url-pattern>*.jspx</url-pattern> </filter-mapping> For more information about the Data Control Palette and binding objects, see Binding a View Object to a User Interface Page on page 171.

Session Cookie
Session information is passed to the client browser as a session cookie. The session stays active while the user continues to send new requests within the time frame configured by the <sessiontimeout> element in the web.xml file. The default session length is 35 minutes.

Failover
The session cookie can be persistent if the deploying company wants to use a failover mechanism. In failover mode, the Oracle ADF run time saves an additional browser cookie that the run time uses to track the latest passivation snapshot ID for each client running an application. Even though the users next request will be processed in the context of a new HttpSession, perhaps even in a different application server instance, the user is unaware that this has occurred. The additional browser cookie is used to reactivate any available application module instance with the user's last pending state snapshot before handling the request. Failover is configured at the application module level. For information on configuring failover, see Configuring Failover on the SessionAM Application Module on page 169. For information on data passivation and activation of the application module state, see Oracle Application Development Framework Developers Guide For Forms/4GL Developers on Oracle Technology Network.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

27

Siebel Self-Service Application Architecture About Session Handling in Self-Service Applications

28

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Overview of Customizing Siebel Self-Service Applications

This chapter describes the process of customizing Siebel Self-Service Applications. It includes the following topics: Customization Strategy for Self-Service Applications on page 29 Customization Support for Self-Service Applications on page 30 Customizable Files for Self-Service Applications on page 30 Roadmap for Customizing Siebel Self-Service Applications on page 32 About the Application Configuration File for Self-Service Applications on page 33 About the Source Code for Java Classes in Self-Service Applications on page 33

Customization Strategy for Self-Service Applications


The general strategy for the customization of Siebel Self-Service Applications is copy and customize. To make changes, developers must copy files to new files, and then customize the new files. This ensures that patches and upgrades will not overwrite customizations. After a patch or upgrade, developers must manually merge relevant changes into their customized files. The following guidelines for customization are strongly recommended: Keep backup copies of the out-of-the-box files that you customize. Then you can restore the original files, if necessary, to help isolate and troubleshoot any problems that might occur. Make incremental customizations, for example, to one JSPX page or ADF Business Component at a time. Test those customizations thoroughly before making others. This will make it easier to isolate and troubleshoot problems. Document your custom code with comments to make it easier for you and others to follow. Monitor and log events on both the Java EE and Siebel sides of Siebel Self-Service Applications while testing them during the development process. For more information on monitoring and logging, see Chapter 10, Monitoring Diagnostic Information and Error Messages for Siebel SelfService Applications. Test all customizations thoroughly in the development environment before moving them to the production environment. For more information on testing applications, see Chapter 9, Deploying and Testing Customized Siebel Self-Service Applications.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

29

Overview of Customizing Siebel Self-Service Applications Customization Support for Self-Service Applications

Customization Support for Self-Service Applications


Oracle Global Customer Support (GCS) will assist deploying companies in implementing the customizations documented in this guide. Customizations that go beyond this are outside the scope of Oracle GCS, and deploying companies might be referred to other Oracle product documentation. It might also be suggested that they engage Oracle Professional Services. If you encounter problems with a customized application, try to isolate the behavior in an environment that it is as close to the out-of-box application as possible. Problems that are identified as being caused by customizations might also be considered beyond the scope of Oracle Global Customer Support. For help with such issues, contact your Oracle sales representative to request assistance from Oracle's Professional Services.

Customizable Files for Self-Service Applications


All files in Siebel Self-Service Applications are customizable. Some deploying companies will change only the company information, such as the logo and copyright, and use Siebel Self-Service Applications as they are supplied. At the other extreme, some deploying companies will customize entire applications.

Files That Must Be Renamed Before Customization


Copy the files and file types in Table 6, rename them, and then customize them. CAUTION: If you do not rename these files before customizing them, any patch or upgrade will overwrite your customizations.

Table 6.

Customizable Files to Copy and Rename Filename *.jspx faces-config-*.xml *.css *.js *.gif, *.jpg, *.png *.tld Description Pages and panels JSF configuration and page flows Style sheets JavaScript files Images Custom tag library definitions

Classification User interface (UI)

30

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Overview of Customizing Siebel Self-Service Applications Customizable Files for Self-Service Applications

Table 6.

Customizable Files to Copy and Rename Filename *.java *.class *.jar *bc4j.xcfg *AM.xml, *VO.xml, *EO.xml Description Java classes (source) Java classes (compiled) Java libraries ADF Business Component configuration ADF Business Component definitions Data binding context Data bindings Java resource bundles XML data XML data

Classification Business logic

UIbusiness logic bindings Data

DataBindings.cpx *PageDef.xml *.properties *Data.xml faces-config-*.xml

Files That Cannot Be Renamed Before Customization


The files in Table 7 cannot be renamed, because other names are not recognized by Java EE and Oracle ADF. These files can be customized directly. Patches or upgrades must include these files with a different name or version number, for example, web.xml.8.1.1, to avoid overwriting customizations. NOTE: Before customizing these files, make a backup copy of them.

Table 7.

Customizable Files Not to Rename Filename adf-faces-skins.xml region-metadata.xml Description Skin (UI look-and-feel) definitions, such as button and tab appearance Panel definitions ADF Faces configuration Java EE configuration (deployment descriptor)

Classification User interface (UI)

Configuration

adf-faces-config.xml web.xml

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

31

Overview of Customizing Siebel Self-Service Applications Roadmap for Customizing Siebel Self-Service Applications

Roadmap for Customizing Siebel SelfService Applications


In the customization process, developers perform one or more of the following tasks: Set up the development environment, which includes the following:

Install and configure Siebel Business Applications. Install the Oracle Application Server and Oracle JDeveloper. Import the Java EE application into Oracle JDeveloper for customization.

See Chapter 4, Setting Up the Development Environment for Siebel Self-Service Applications. Configure the View and Controller layers. These two layers are contained in a single project, ViewController, in the Java EE application in Oracle JDeveloper. For more information on the ViewController project, see Project Structure of Self-Service Applications on page 22. Customization strategies for the View and Controller layers are the following:

Copy and customize JSPX files. Leverage page, panel, and image indirections to reference physical filenames. After a patch or upgrade, manually merge new features into customized JSPX files, if needed. Copy and customize faces-config-*.xml files for page flows, menus, and process trains. Create new resource bundles to override default prompts and messages.

For information on customization, see the following chapters:


Chapter 5, Customizing Pages for Siebel Self-Service Applications Chapter 6, Customizing Menus for Siebel Self-Service Applications Chapter 7, Customizing the Appearance of Siebel Self-Service Applications

Configure the Siebel Business Objects and Data Objects layers. For information on configuring these Siebel objects, see Configuring Siebel Business Applications.

Configure Siebel business services and Web services. For information on configuring these Siebel objects, see Integration Platform Technologies: Siebel Enterprise Application Integration.

Configure the Model layer. The Model layer is contained in the Model project in the Java EE application in Oracle JDeveloper. The Model project contains ADF Business Components, as well as Web service calls. Customization strategies for the Model layer are the following:

Extend ADF Business Components and override their logic.

32

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Overview of Customizing Siebel Self-Service Applications About the Application Configuration File for Self-Service Applications

Create new ADF Business Components where needed, create new UI objects, and then bind the UI objects to the new ADF Business Components. Expose Siebel business services as Web services, create Web service proxies in Oracle JDeveloper, create new ADF Business Components, new UI objects, and then bind the new ADF Business Components to the new UI. Copy and customize DataBindings.cpx to update the data binding context.

See Chapter 8, Customizing the Model Layer for Siebel Self-Service Applications. Test customized applications in Oracle JDeveloper and on the Oracle Application Server in the development environment. See Chapter 9, Deploying and Testing Customized Siebel Self-Service Applications. Deploy customized applications to the Oracle Application Server on the production environment. See Chapter 9, Deploying and Testing Customized Siebel Self-Service Applications. Enable event monitoring and logging for Siebel Self-Service Applications. See Chapter 10, Monitoring Diagnostic Information and Error Messages for Siebel Self-Service Applications.

About the Application Configuration File for Self-Service Applications


The web.xml file, which is in the ViewController/public_html/WEB-INF directory, contains application configuration information for Siebel Self-Service Applications, for example, security constraints and session timeout. It is also where you register your customized faces-config-*.xml files, in the javax.faces.CONFIG_FILES parameter. NOTE: The web.xml file is also referred to as a deployment descriptor. This is not the same as the Web application deployment descriptor, orion-application-xml. For more information on orionapplication.xml, see Creating a Deployment Descriptor on page 176.

About the Source Code for Java Classes in Self-Service Applications


The source code for all of the Java classes in Siebel Self-Service Applications is provided.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

33

Overview of Customizing Siebel Self-Service Applications About the Source Code for Java Classes in Self-Service Applications

34

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Setting Up the Development Environment for Siebel SelfService Applications

This chapter describes the tasks necessary for setting up the development environment to customize Siebel Self-Service Applications. It includes the following topics: Installing and Configuring Siebel Business Applications on page 35 Installing Oracle JDeveloper on page 37 Installing and Configuring the Oracle Application Server on page 37 Connecting to the Oracle Application Server on page 37 Deploying the Standard Java EE Application to the Oracle Application Server on page 38 Importing the Java EE Application Into Oracle JDeveloper on page 38 Process of Cleaning Up After Importation on page 39 Connecting to an Oracle Database for Data Passivation on page 41 Configuring Endpoint URLs on page 42 Configuring Authentication in Oracle JDeveloper on page 44 Deploying a Patch to a Development Workstation on page 46

Installing and Configuring Siebel Business Applications


To set up the development environment to customize Siebel Self-Service Applications, you start by installing and configuring Siebel Business Applications. You then activate Siebel Web services and workflow processes.

Installing and Configuring Siebel Business Applications


Siebel Self-Service Applications use Siebel Business Applications for their business logic. Therefore, you must install, and configure if necessary, the following: Siebel Enterprise Server, which includes the Siebel Gateway Name Server and Siebel Server Siebel Database Web server Siebel Web Server Extension (SWSE) Siebel Client Siebel Tools

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

35

Setting Up the Development Environment for Siebel Self-Service Applications Installing and Configuring Siebel Business Applications

For information on installing and initially configuring Siebel Business Applications, see the Siebel Installation Guide for the operating system you are using. For additional information about Siebel Enterprise Server deployment and common component setup tasks, see Siebel Self-Service Application Deployment Guide. For information on supported versions of Siebel Business Applications and other Oracle software required for using Siebel Self-Service Applications, see Siebel System Requirements and Supported Platforms on Oracle Technology Network.

Activating Self-Service Web Services


Siebel Self-Service Applications use specific Web services to exchange data with Siebel Business Applications. As part of the process of setting up Siebel Self-Service Applications, you must activate these Web services. You activate Web services in the Inbound Web Services view. After activating the Web services, you must clear the Web services cache. For a list of Self-Service Web services, see Siebel Self-Service Application Deployment Guide. For more information on Self-Service Web services, see Siebel CRM Web Services Reference.

To activate Self-Service Web services 1 2 3


In the Siebel client, navigate to the Administration - Web Services screen, Inbound Web Services view. Change the status of each Self-Service Web service to Active. Click Clear Cache.

Activating Self-Service Workflow Processes


Certain tasks in Siebel Self-Service Applications require workflow processes to be running. You publish and activate workflow processes in Siebel Tools. For a list of Self-Service workflow processes, see Siebel Self-Service Application Deployment Guide.

To activate Self-Service workflow processes 1 2 3


In Siebel Tools, select Workflow Process in the Object Explorer. Query for the desired workflow processes in the Object List Editor. For each workflow process, select it, and then click the Publish/Activate icon in the WF/Task Editor Toolbar.

36

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Setting Up the Development Environment for Siebel Self-Service Applications Installing Oracle JDeveloper

Installing Oracle JDeveloper


You create and configure Java Platform, Enterprise Edition (Java EE) applications in Oracle JDeveloper 10g Release 3 (10.1.3.3). For information on using Oracle JDeveloper, see Oracle JDeveloper 10g Online Help. For the patches that you must install to use Oracle JDeveloper with Siebel Self-Service Applications, see Siebel SelfService Application Deployment Guide on the Siebel Bookshelf and Siebel CRM 8.1.1 Self-Service Quick Start Guide (Doc ID 579245.1) on My Oracle Support.

Installing and Configuring the Oracle Application Server


For application development purposes you can use the embedded Oracle Application Server 10g Containers for Java EE (OC4J) in Oracle JDeveloper. However, to test applications in an environment similar to that in which they will run, you must use an Oracle Application Server. You can install the Oracle Application Server on the same computer that you are using for application development. For information on installing the Oracle Application Server, see the Oracle Application Server Installation Guide for the operating system you are using. For the patches that you must install to use the Oracle Application Server with Siebel Self-Service Applications, see Siebel Self-Service Application Deployment Guide on the Siebel Bookshelf and Siebel CRM 8.1.1 Self-Service Quick Start Guide (Doc ID 579245.1) on My Oracle Support.

Connecting to the Oracle Application Server


To deploy and test Siebel Self-Service Applications on an Oracle Application Server 10g Release 3 (10.1.3.3), you must create a connection to it in Oracle JDeveloper. NOTE: The Oracle Application Server service, for example, Oracle-OracleAS_10_1_3ProcessManager, must be started and the Oracle Application Server must be running for Oracle JDeveloper to connect to it.

To connect to the Oracle Application Server 1 2


In Oracle JDeveloper, click the Connections Navigator tab. Right-click the Application Server node in the Connections tree, and then choose New Application Server Connection. The Application Server Connection wizard starts.

3 4

On the Welcome page, click Next. In Step 1 of the wizard:

Enter the connection name, for example, OracleAS.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

37

Setting Up the Development Environment for Siebel Self-Service Applications Deploying the Standard Java EE Application to the Oracle Application Server

b c 5 a b c d 6

Choose the connection type that matches the server version, for example, Oracle Application Server 10g 10.1.3. Click Next.

In Step 2 of the wizard: Enter the user name of the application server administrator, for example, oc4jadmin. Enter the password of the application server administrator, for example, welcome1. Select the Deploy Password check box. Click Next.

In Step 3 of the wizard, enter values in the following fields:


Host Name. Computer running the Oracle Application Server. If the same computer is used for both development and testing, this will be localhost. OPMN Port. Port for Oracle Process Manager and Notification Server (OPMN) requests, for example, 6003. OC4J Instance Name. This is typically home.

7 8 9

Select the Single Instance check box, and then click Next. In Step 4 of the wizard, click Test Connection. If the word Success! is displayed in the Status box, click Finish. If not, make sure that the Oracle Application Server is running, and then start the wizard again.

Deploying the Standard Java EE Application to the Oracle Application Server


You use the installer for Siebel Self-Service Applications to deploy the standard Java EE application to the Oracle Application Server. For more information on installing Siebel Self-Service Applications, see Siebel Self-Service Application Deployment Guide.

Importing the Java EE Application Into Oracle JDeveloper


To work with Siebel Self-Service Applications in Oracle JDeveloper, you must extract the Enterprise Archive (EAR) file, 81SelfService.ear, into folders for the application and the Model and ViewController projects, and then open the Java workspace file in Oracle JDeveloper.

38

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Setting Up the Development Environment for Siebel Self-Service Applications Process of Cleaning Up After Importation

The EAR file is found in ORACLE_HOME/j2ee/home/applications after you deploy the standard Java EE application to the Oracle Application Server (see Deploying the Standard Java EE Application to the Oracle Application Server on page 38). NOTE: After importing Siebel Self-Service Applications into Oracle JDeveloper, you can add source files for additional applications. For a detailed example of importing source files for Siebel Communications E-Commerce into Oracle JDeveloper, see Siebel Self-Service Application Deployment Guide.

To import the Java EE application into Oracle JDeveloper 1 2 3 4 5 6 7 8 9


Using an extraction utility, extract 81SelfService.ear to the SelfService_ROOT directory, for example, /usr/Siebel/SelfService81. Extract ViewController.war to a ViewController directory inside SelfService_ROOT. Extract Model.jar to a Model directory inside SelfService_ROOT. Move all of the files from SelfService_ROOT/META_INF to SelfService_ROOT. Create a public_html directory under ViewController. Move all of the files and directories in ViewController, except ViewController.jpr and /src and /classes, to ViewController/public_html. Launch Oracle JDeveloper. From the File menu, choose Open. In the Open dialog, navigate to SelfService_ROOT, select SelfService.jws, and then click Open. The first time you open SelfService.jws, the Open Warning dialog appears, asking if you want to migrate the projects contained in the application to Oracle JDeveloper version 10.1.3.3.

10 Click Yes.
The Java EE application is imported into JDeveloper.

Process of Cleaning Up After Importation


After importing the Java EE application into Oracle JDeveloper, certain cleanup tasks must be performed:

1 2

Cleaning the Model and ViewController Projects on page 40 Removing Duplicate Class Files on page 40

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

39

Setting Up the Development Environment for Siebel Self-Service Applications Process of Cleaning Up After Importation

Cleaning the Model and ViewController Projects


By default the Model and ViewController projects contain data when they are created in Oracle JDeveloper. You remove this data by cleaning the projects, which deletes the compiled class files. NOTE: The class files in the Model and ViewController projects are regenerated when you run the application in Oracle JDeveloper or deploy it to the application server.

To clean the Model and ViewController projects 1 2


In Oracle JDeveloper, select the Model project in the Applications Navigator. From the Run menu, choose Clean Model.jpr. A warning appears asking whether you want to recursively delete the content of the output directory Model\classes.

Click Yes. The Model project is cleaned.

4 5

Select the ViewController project in the Applications Navigator. From the Run menu, choose Clean ViewController.jpr. A warning appears asking whether you want to recursively delete the content of the output directory ViewController\classes.

Click Yes. The ViewController project is cleaned.

Removing Duplicate Class Files


To eliminate run-time errors due to duplicate class files, you must remove the ViewController\public_html\WEB-INF\classes directory. NOTE: The correct classes are in ViewController\classes.

To remove duplicate class files


Delete the ViewController\public_html\WEB-INF\classes directory.

40

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Setting Up the Development Environment for Siebel Self-Service Applications Connecting to an Oracle Database for Data Passivation

Connecting to an Oracle Database for Data Passivation


Data passivation is the storage of a pending transaction if it cannot be handled immediately. In the Oracle Application Development Framework (Oracle ADF), data passivation requires a connection to an Oracle database. For standard (non-customized) Siebel Self-Service Applications, the connection information is provided when deploying the applications to the Oracle Application Server (see Deploying the Standard Java EE Application to the Oracle Application Server on page 38). For more information on deploying the standard applications, see Siebel Self-Service Application Deployment Guide. For working with the development environment in Oracle JDeveloper, the database connection can be a dummy connection, for example, to the SRDemo or SOADEMO demonstration application schema installed into an Oracle XE database while installing Oracles SOA Suite. You can download the Oracle XE database free of charge from Oracle Technology Network. NOTE: If you do not create a connection to an Oracle database and refer to that connection in Model/ src/Model.jpx, you will receive a warning during the compilation of the Model project by Oracle JDeveloper. CAUTION: Before deploying customized applications to an Oracle Application Server, you must create a connection to an active Oracle database, such as one used in production. After deployment, the data source appears in Oracle Enterprise Manager 10g Application Server Control under Cluster Topology, <Application_Server>, OC4J:home, and then the JDBC Resources page. The connection credentials can be configured here, including the password in clear text. This information is stored under ORACLE_HOME/j2ee/home/application-deployments/ <application_name>/<application_name>-data-sources.xml. For more information on data passivation and the ADF Business Component state management facility, see About Session Handling in Self-Service Applications on page 23 and Oracle Application Development Framework Developers Guide For Forms/4GL Developers on Oracle Technology Network. The following procedure details how to create a database connection.

To create a connection to an Oracle database 1 2


In Oracle JDeveloper, click the Connections Navigator tab. Right-click Database, and then choose New Database Connection. The Create Database Connection Wizard appears.

In the Create Database Connection Wizard:

a b c d

Name the database connection, for example, SelfServiceDS. Provide authentication parameters. Provide connection parameters. Test the connection.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

41

Setting Up the Development Environment for Siebel Self-Service Applications Configuring Endpoint URLs

If the word Success! is displayed in the Status box, click Finish. If not, make sure that the database is running, and then start the wizard again.

The new database connection appears in the Connections Navigator.

4 5 6

From the Tools menu, choose Embedded OC4J Server Preferences. The Embedded OC4J Server Preferences for Application_Name dialog appears. Select the Data Sources node under Current Workspace. In the Data Sources dialog, make sure that the following check boxes are selected:

Create data-source elements where not defined Update existing data-source elements Auto-update data-sources.xml when running or deploying to OC4J

7 8 9

Click Refresh Now, and then click OK. Open Model/src/META-INF/data-sources.xml. Make sure that the password for SelfServiceDS is stored in clear text.

10 Open Model/src/Model.jpx in a text editor. 11 Edit the _NamedConnection line to refer to the new database connection:
<Attr Name="_NamedConnection" Value="SelfServiceDS" />

Configuring Endpoint URLs


To access Siebel data while working with applications in Oracle JDeveloper, you must configure the endpoint URL that accesses the Siebel Web Server Extension. You do this in the project properties for the ViewController project.

To configure the endpoint URL for the Siebel Web Server Extension 1 2 3
In Oracle JDeveloper, right-click the ViewController project, and then choose Project Properties. In the Project Properties window, click Run/Debug. The Run/Debug dialog appears. Under Run Configurations, click Edit. The Launch Setting dialog appears.

In the Java Options field, add the following parameter, separating it from other expressions by a space: -DSIEBEL_WEBSERVER_URL=http://<host>[:<port>]/custappsvcs/ start.swe?SWEExtSource=WebService&SWEExtCmd=Execute where host is a Siebel Server and port is optional NOTE: Do not include the language code in the custappsvcs virtual directory name.

42

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Setting Up the Development Environment for Siebel Self-Service Applications Configuring Endpoint URLs

5 6

Click OK in the Launch Settings dialog. Click OK in the Run/Debug dialog to close the Project Properties window.

NOTE: When working with deployed applications, you can configure the endpoint URL in Oracle Enterprise Manager during deployment or in the Web application deployment descriptor file, orionapplication.xml, after deployment. For more information on endpoint URL configuration, see Deploying the EAR File to the Oracle Application Server in the Development Environment on page 178 and Configuring the Endpoint URL After Deployment on page 179. You can also specify the Adobe Form Server for Siebel Public Sector E-Support.

To configure the endpoint URL for the Adobe Form Server (Siebel Public Sector ESupport only) 1 2 3
In Oracle JDeveloper, right-click the ViewController project, and then choose Project Properties. In the Project Properties window, click Run/Debug. The Run/Debug dialog appears. Under Run Configurations, click Edit. The Launch Setting dialog appears.

In the Java Options field, add the following parameter, separating it from other expressions by a space: -DADOBE_FORM_SERVER_URL=http://<host>[:<port>]/jboss-net/services/ AdobeFSService where host is the Adobe Form Server and port is optional

5 6

Click OK in the Launch Settings dialog. Click OK in the Run/Debug dialog to close the Project Properties window.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

43

Setting Up the Development Environment for Siebel Self-Service Applications Configuring Authentication in Oracle JDeveloper

Configuring Authentication in Oracle JDeveloper


To use the SelfServiceLoginModule for authentication when working with Siebel Self-Service Applications in Oracle JDeveloper, you must configure the Java Authentication and Authorization Service (JAAS). This is performed by making modification to the files shown in Table 8.

Table 8. File

Files to Modify for Configuring JAAS Directory Self-Service root directory (SelfService_ROOT) For example: /usr/Siebel/SelfService81

SelfService-oc4j-app.xml

application.xml

JDeveloper_ROOT\jdev\system\oracle.j2ee.10.1.3.mm.nn
\embedded-oc4j\config For example: JDeveloper 10.1.3.3/jdev/system/ oracle.j2ee.10.1.3.41.57/embedded-oc4j/config

system-jazn-data.xml web.xml

Same directory as application.xml

SelfService_ROOT\ViewController\public_html\WEB-INF

To configure authentication in Oracle JDeveloper 1 2


Open SelfService_ROOT\SelfService-oc4j-app.xml in a text editor. Make sure that the <jazn> element contains the following code: <jazn provider="XML" jaas-mode="doAsPrivileged" location="SelfService-jazn-data.xml" default-realm="jazn.com"> <property name="role.mapping.dynamic" value="true"/> <property name="custom.loginmodule.provider" value="true"/> </jazn>

3 4

Open JDeveloper_ROOT/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/ application.xml in a text editor. Edit the <jazn> element to read the following: <jazn provider="XML" jaas-mode="doAsPrivileged"> <property name="role.mapping.dynamic" value="true"/> <property name="custom.loginmodule.provider" value="true"/> </jazn>

44

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Setting Up the Development Environment for Siebel Self-Service Applications Configuring Authentication in Oracle JDeveloper

Add the SelfServiceLoginModule class to system-jazn-data.xml.

a b c d

In Oracle JDeveloper, from the Tools menu, choose Embedded OC4J Server Preferences Under the Global node, expand Authentication (JAZN), then Login Configuration. Click New. In the Create Application Login Configuration dialog, type the following in the Application Name field, then click OK: current-workspace-app

e f

Under current-workspace-app, click Add next to Login Modules. In the Create Login Module dialog, type the following in the Class field, then click OK: oracle.apps.ss.base.view.security.SelfServiceLoginModule

g h i

From the Control Flag pull-down menu, choose required. Click the Options tab, then click Add. In the Create Login Config Option dialog, add the following parameter, and then click OK: Name debug Value true

Protect your customized pages by customizing ViewController\public_html\WEB-INF\web.xml. NOTE: This applies if you are not using single sign-on (SSO). For SSO, resource protection setup is done is the SSO client software.

a b c d e

In Oracle JDeveloper, expand the ViewController project, then the Web Content node, and then the WEB-INF node. Under WEB-INF, right-click web.xml, then choose Properties. In the Web Application Deployment Descriptor window, select Security Constraints, then click New. With the Web Resources tab selected under Constraint, click Add (if protected does not already exist). In the Create Web Resource Collection dialog, type the following in the Web Resource Name field, then click OK: protected

f g

With the protected Web Resource selected, select the URL Patterns tab, then click Add. In the Create URL Pattern dialog, type the URL pattern in the URL Pattern field, then click OK. For example: /faces/ss/ABC/common/* where ABC is the name of your company

Under Constraint, click the Authorization tab.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

45

Setting Up the Development Environment for Siebel Self-Service Applications Deploying a Patch to a Development Workstation

Select the security roles that will have access to the JSPX pages that follow the URL pattern, for example:

Web Administrator Web Delegated Customer Administrator

j k

Click OK. Save your changes to web.xml.

Deploying a Patch to a Development Workstation


The patch source code EAR file contains a subset of the entire source code. The patch EAR file contains only the source code files changed since the initial release. It is a cumulative roll-up of patches, with the exception of some system files, that lose access to customizations if they are overwritten. The patch EAR file does not include files, such as project (JPR) or application (JWS) files, that reference the customized files that you might have created. Nor does it include files specific to a deployment, such as web.xml. When expanding the EAR file you must overwrite the previous, standard source code files, while leaving your customized files untouched. The customization guidelines require that you never directly modify Siebel source code files. If you want to modify or extend the functionality of the standard source code files, you must copy the files that you want to change to a separate directory tree.

To deploy a patch to a development workstation 1 2 3 4


Obtain the patch EAR file from Oracle. Using a file decompression utility, expand the EAR file in the directory that you use for EAR files. In Oracle JDeveloper, choose Import from the File menu to import the application files. In the Import window, choose EAR File, then click OK. The Import EAR File wizard starts.

Click Next.

46

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Setting Up the Development Environment for Siebel Self-Service Applications Deploying a Patch to a Development Workstation

In the Location page, complete fields using values from the following table, then click Next. Field EAR File Application File Directory Copy Files to Application Source Roots Description The location of the EAR file containing the source code. The name of the application file to be used in JDeveloper. The default is the name of the EAR file. The location of the application directory to be used. Select this check box. The location of the EAR file containing the source code.

The EAR Modules page appears and lists the module names and project names found in the EAR file.

Click Next. The Finish page displays a list of the projects installed with the new application.

Click Finish.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

47

Setting Up the Development Environment for Siebel Self-Service Applications Deploying a Patch to a Development Workstation

48

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications

This chapter describes user interface (UI) page templates in Siebel Self-Service Applications and how to customize them. It includes the following topics: About User Interface Page Templates for Self-Service Applications on page 50 Service Request Page Example for Siebel E-Support on page 60 Customizing Page Templates for Self-Service Applications on page 62 Customizing Regions for Siebel Self-Service Applications on page 63 Creating Page Templates for Siebel Self-Service Applications on page 64 About Template Indirection on page 64 About Page Template Mappings for Siebel Self-Service Applications on page 64 Page Template Mapping Example for Self-Service Applications on page 66 Customizing Page Template Mappings for Self-Service Applications on page 74 Setting Page Template Mappings for Self-Service Applications on page 75 About Page Flows for Self-Service Applications on page 76 Page Flow Example for the Self-Service Shopping Cart on page 77 Customizing Page Flows for Self-Service Applications on page 80 About Process Trains for Self-Service Applications on page 80 Service Request Process Train Example for Siebel E-Support on page 85 Customizing Process Trains for Self-Service Applications on page 94

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

49

Customizing Pages for Siebel Self-Service Applications About User Interface Page Templates for Self-Service Applications

About User Interface Page Templates for Self-Service Applications


Siebel Self-Service Applications use templates for all content pages. Pages contain a context-based menu, global icons, product branding, an error message placeholder, and various placeholders for developers to attach and render content. A typical Siebel E-Support page is shown in Figure 4.

Figure 4.

Example Page Layout

Menus and branding information are at the top, sidebars (such as for searching and for displaying menu trees) are on the left side, useful links are on the right side, and the main page content is in the middle. The underlying template structure for this page is shown in Figure 5.

Contained within af:panelBorder tag

Figure 5.

Page Template Structure

50

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications About User Interface Page Templates for Self-Service Applications

Every page in Siebel Self-Service Applications starts from a standard page skeleton, allowing developers to concentrate on the application-specific display contents. The page skeleton, a .jspx file, provides an af:panelBorder tag to encapsulate the content. The af:panelBorder tag includes references to a page header region and a page footer region. The purpose of these regions is to render the top and bottom portions of a page; they include branding information, menus, copyright information, and other similar components. Template indirection is used to avoid the hard coding of any image or .jspx filename used for regions. For more information about template indirection, see About Template Indirection on page 64. For more information about page templates, see the following topics: Standard Page Skeleton File on page 51 af:panelBorder Tag and Facets on page 54 Regions on page 55 Page Header on page 55 Page Footer on page 58 Error Messages and Generic Error Page on page 59 Service Request Page Example for Siebel E-Support on page 60

Standard Page Skeleton File


The standard page skeleton file, PageSkeleton.jspx, maps the content regions within the af:panelBorder tag, including the references to the page header and footer files. The following is an example of PageSkeleton.jspx, which is in the ViewController/public_html/ss/base/common directory: <?xml version="1.0" encoding="UTF-8"?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:af="http://xmlns.oracle.com/adf/faces" xmlns:afc="http://xmlns.oracle.com/adf/faces/webcache" xmlns:f="http://java.sun.com/jsf/core" xmlns:ss="http://oracle.com/apps/selfService" version="2.0"> <jsp:output doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-root-element="HTML" doctype-system="http://www.w3.org/TR/html4/loose.dtd" omit-xml-declaration="true"/> <jsp:directive.page contentType="text/html;charset=windows-1252"/> <f:view> <!-- The title is looked up from the message bean. --> <af:document title="#{sessionBean.siteName}: Title comes from the resource bundle">

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

51

Customizing Pages for Siebel Self-Service Applications About User Interface Page Templates for Self-Service Applications

<!-- Remove the afc:cache tag if the page is not full-page cacheable. You can add more varyBy constraints based on the page cacheability, as in the following example. A page cached should vary based on user permission for various menu bars and menu tabs. --> <!-- <afc:cache rendered="#{configBean[FULL_PAGE_CACHE_ENABLED]}" varyBy="menuAdapterBean.menuTabCacheString menuAdapterBean.menuBarCacheString"> --> <af:form id="compId8"> <!-- Enter the permission for the user to view this page. --> <af:panelBorder rendered="#{!(empty sessionBean.permission['PERMISSION_NAME'])}"> <f:facet name="top"> <!-- Reference to the page header file --> <af:region id="pageHeaderBin" regionType="ss.common.region.pageHeader"/> </f:facet> <f:facet name="left"> <af:panelGroup layout="vertical" styleClass="ss_left_bin"> <!-The left facet contents go here. -->

</af:panelGroup> </f:facet> <f:facet name="right"> <af:panelGroup layout="vertical" styleClass="ss_right_bin"> <!-- The right facet contents go here. --> </af:panelGroup> </f:facet> <f:facet name="innerTop"> <af:panelGroup layout="vertical" styleClass="ss_itop_bin"> <!-- The inner top facet contents go here. --> </af:panelGroup> </f:facet> <f:facet name="innerBottom"> <af:panelGroup layout="vertical"> <!-- The inner bottom facet contents go here. This is a reference to the page footer file. --> <af:region id="pageFooterBin" regionType="ss.common.region.pageFooter"/>

52

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications About User Interface Page Templates for Self-Service Applications

</af:panelGroup> </f:facet> <!-- Main content of the page starts here. It is rendered in the page central content area. --> <!-- Uncomment the third- and fourth-level menu components if you are using custom third- and fourth-level menus and they have been defined in the menu model. Third- and fourth- level menus are used only for discrete and unrelated top-level pages. --> <!-- Custom third-level menu --> <!-- <ss:menuThird var="menuThird" value="#{menuModel.model}"> <f:facet name="nodeStamp"> <af:goMenuItem text="#{menuThird.label}" rendered="#{menuThird.rendered}"/> </f:facet> </ss:menuThird> --> <!-- Custom fourth-level menu --> <!-- <ss:menuFourth var="menuFourth" value="#{menuModel.model}"> <f:facet name="nodeStamp"> <af:goMenuItem text="#{menuFourth.label}" rendered="#{menuFourth.rendered}"/> </f:facet> </ss:menuFourth> --> <!-- Main content of the page ends --> </af:panelBorder> <!-- Check whether the user has permission to view the page. The rendered attribute is the negation of the rendered attribute of af:panelBorder. --> <af:panelGroup layout="vertical" rendered="#{empty sessionBean .permission['PERMISSION_NAME']}"> <af:region id="pageHeaderBinNoPerm" regionType="ss.common.region.pageHeader"/> <af:outputLabel value="#{messageBean['USER_NOT_AUTHORIZED_TO_VIEW']}"/> <af:region id="pageFooterBinNoPerm" regionType="ss.common.region.pageFooter"/> </af:panelGroup> </af:form> <!--</afc:cache> --> </af:document>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

53

Customizing Pages for Siebel Self-Service Applications About User Interface Page Templates for Self-Service Applications

</f:view> </jsp:root>

af:panelBorder Tag and Facets


The standard page template, PageSkeleton.jspx, uses the af:panelBorder tag as the main enclosing tag. The page template exposes a total of 11 areas, called facets, as shown in Figure 5 on page 50. These areas include top, bottom, left, right, innerTop, innerBottom, innerLeft, and innerRight facets. The property, rendered, of af:panelBorder determines whether the page is displayed. This property is Boolean, set to true or false depending on whether the user has the necessary permission to view the page. If rendered is set to false, a warning message is shown using the af:outputText tag, which checks the negative permission condition. The following guidelines are used for the facets: If a tag is included within af:panelBorder, but not in a specific facet, it is displayed in the page central content area. The top facet includes the page header (see Page Header on page 55). The bottom, inner-left, and inner-right facets are not used in the standard applications. If developers need these facets, they can add the appropriate tags. The right facet has two regions, of which only one is used. The left facet can include a custom component that displays the first two levels of the menu vertically. The menu layout is derived from the faces-config-base-skin-properties.xml file, where the layout can be defined for a skin type. To support that, a two-level vertical menu custom component is available in sample code in the left facet of the page. The rendered property of this component is tied to the layout of the skin in the session: <ss:twoLevelVetricalMenu value="#{menuModel.model}" rendered="#{skinFamily.menuLayout=='vertical'}"/> NOTE: The literal name of the custom component is ss:twoLevelVetricalMenu. This is not a typographical error. For an example of the use of this custom component, see ViewController/public_html/ss/ base/asset/AssetList.jspx. For more information about the menu model, see About the Menu Model for Self-Service Applications on page 99. The left facet also includes empty regions for developers to use. The inner-top and inner-bottom facets both have a region that can be used. The inner-bottom facet also contains the page footer (see Page Footer on page 58).

54

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications About User Interface Page Templates for Self-Service Applications

Regions
A region is a logical subdivision of a page. Regions are used extensibly to modularize pages, as well as for reusability. A region can be included anywhere within a page by using the af:region tag, but it is typically included within the af:panelGroup tag, which determines the layout. A facet can contain multiple regions by having multiple af:region tags. Regions are defined in the region-metadata.xml file in the ViewController/public_html/META-INF directory. The definition of each region consists of the region name and a corresponding JSPX filename. The region name is used in top-level pages to include a region. At run time, the physical filename is looked up and included in the container page. NOTE: The custom component for the vertical menu, if used, is located in the top portion of the left facet. Any additional region is rendered below the vertical menu if the rendered property is true. Based on their requirements, developers can also include one or more regions in any of the unused (top, bottom, inner left, and inner right) facets. The following example shows two regions that are laid out vertically in the right facet: <f:facet name=right> <af:panelGroup layout=vertical> <af:region id="pageRightBin1" regionType="ss.base.common.region.rightBin1"/> <af:region id="pageRightBin2" regionType="ss.base.common.region.rightBin2"/> </af:panelGroup> </f:facet>

Page Header
The header file, pageHeader.jspx, includes such items as the company logo, global menus and icons (for example, Help), menu tabs, menu bars, and a message tag. The following is an example pageHeader.jspx file, which is in the ViewController/public_html/ss/base/common/region directory: <?xml version='1.0' encoding='windows-1252'?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0" xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces" xmlns:afh="http://xmlns.oracle.com/adf/faces/html"> <af:regionDef var="attr"> <!-- <af:goLink text="" id="pageContent" destination="#pageContent" shortDesc="#{messageBean.SS_SKIP_NAV_LNK}">

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

55

Customizing Pages for Siebel Self-Service Applications About User Interface Page Templates for Self-Service Applications

<af:objectImage shortDesc="#{messageBean.SS_SKIP_NAV_LNK}" source="/ss/image/ t.gif"/> </af:goLink> --> <af:panelPageHeader styleClass="ss0"> <f:facet name="branding"> <af:panelGroup styleClass="ss_brand"> <af:objectImage shortDesc="#{imageBean['SS_COMPANY_LOGO'].description}" source="#{imageBean['SS_COMPANY_LOGO'].physicalName}"/> </af:panelGroup> <!-- <af:panelGroup> <jsp:include page="${templateManagerBean['ss.base.util.brand']}"/> </af:panelGroup> --> </f:facet> <f:facet name="menuGlobal"> <af:panelGroup layout="horizontal" styleClass="ss00" rendered="#{attr.globalMenuShown}"> <f:facet name="separator"> <af:objectImage source="#{imageBean['SS_GLOBAL_SEPARATOR'].physicalName}" shortDesc="#{imageBean['SS_GLOBAL_SEPARATOR'].description}"/> </f:facet> <af:menuButtons> <af:goMenuItem text="#{sessionBean.authenticated?pageHeaderBean .loggedInUserInfo:messageBean.SS_GEN_GUEST}"/> </af:menuButtons> <af:menuButtons startDepth="0" var="menuGlobal" value="#{menuModel.model}"> <f:facet name="nodeStamp"> <af:goMenuItem text="#{menuGlobal.label}" destination="#{menuGlobal.fileName}" rendered="#{menuGlobal.type=='global' &amp;&amp; menuGlobal.rendered}" /> </f:facet> </af:menuButtons> </af:panelGroup> </f:facet>

56

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications About User Interface Page Templates for Self-Service Applications

<f:facet name="menu1" > </f:facet> <f:facet name="menu2" > <af:panelGroup rendered="#{skinFamily.menuLayout=='horizontal' and attr.otherMenuShown}"> <af:menuTabs startDepth="0" var="menuTab" value="#{menuModel.model}"> <f:facet name="nodeStamp"> <af:goMenuItem text="#{menuTab.label}" destination="#{menuTab.fileName}" rendered="#{menuTab.rendered and menuTab.type!='global'}"/> </f:facet> </af:menuTabs> <af:menuBar startDepth="1" var="menuBar" value="#{menuModel.model}"> <f:facet name="nodeStamp"> <af:goMenuItem text="#{menuBar.label}" destination="#{menuBar.fileName}" rendered="#{menuBar.rendered}" /> </f:facet> </af:menuBar> </af:panelGroup> </f:facet> </af:panelPageHeader> <!--<f:verbatim> <a name="pageContent"></a> </f:verbatim>--> <!-- <afh:script text="function addFavIco() { try { var _pagehead = document.getElementsByTagName('head')[0]; var favico = document.createElement('link'); favico.setAttribute('rel','shortcut icon'); favico.setAttribute('href','../../../ss/skin/img/fav.ico'); _pagehead.appendChild(favico); } catch(e){} } addFavIco();" /> -->

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

57

Customizing Pages for Siebel Self-Service Applications About User Interface Page Templates for Self-Service Applications

</af:regionDef> </jsp:root>

Page Footer
The page footer file, pageFooter.jspx, includes the links for the global menus and copyright messages. The following is an example pageFooter.jspx file, which is in the ViewController/ public_html/ss/base/common/region directory: <?xml version='1.0' encoding='windows-1252'?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0" xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces" xmlns:afh="http://xmlns.oracle.com/adf/faces/html"> <af:regionDef> <af:panelGroup layout="horizontal" styleClass=ss51 id=footerOuterPGrp> <af:panelGroup layout="horizontal" styleClass="ss50" id="footerInnerPGrp"> <af:panelHorizontal halign="start" id="copyRightPHz"> <af:outputLabel value="#{messageBean.SS_GEN_COPY_RIGHT}" id="copyRightOlb"/> </af:panelHorizontal> <af:panelHorizontal halign="end" id="footerPHz"> <f:facet name="separator"> <af:objectImage source="#{imageBean['SS_FOOTER_SEPARATOR'].physicalName}" shortDesc="#{imageBean['SS_FOOTER_SEPARATOR'].description}" id="footerSeparator"/> </f:facet> <af:goLink text="#{messageBean.SS_GEN_ABOUT_US}" destination="http://www.oracle.com" styleClass="ss16" /> <af:goLink text="#{messageBean.SS_GEN_CONTACT_US}" destination="#{sessionBean.URL['/ss/base/contact/email/SendEmail.jspx']}" styleClass="ss16"/> <af:goLink text="#{messageBean.SS_GEN_LEGAL_NOTICE_AND_TERMS_OF_USE}" destination="#" styleClass="ss16"/> <af:goLink text="#{messageBean.SS_GEN_PRIVACY_STATEMENT}" destination="http://www.oracle.com/html/privacy.html" styleClass="ss16"/> </af:panelHorizontal> </af:panelGroup>

58

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications About User Interface Page Templates for Self-Service Applications

</af:panelGroup> <af:panelGroup rendered="#{sessionBean.developmentMode}" id="developModePGrp"> <afh:script text="// ----- AppSession attribute Begin ----Account=#{sessionBean.accountsString}, AccountId=#{sessionBean.accountId}, AccountType=#{sessionBean.accountType}, AddrCity=#{sessionBean.addrCity}, AddrCountry=#{sessionBean.addrCountry}, AddrState=#{sessionBean.addrState}, AddrZip=#{sessionBean.addrZip}, Authenticated=#{sessionBean.authenticated}, b2BUser=#{sessionBean.b2BUser}, b2CUser=#{sessionBean.b2CUser}, cartId=#{sessionBean.cartId}, contactId=#{sessionBean.contactId}, currencyCode=#{sessionBean.currencyCode}, emailAddress=#{sessionBean.emailAddress}, faxNumber=#{sessionBean.faxNumber}, firstName=#{sessionBean.firstName}, guest=#{sessionBean.guest}, homePhoneNumber=#{sessionBean.homePhoneNumber}, lastName=#{sessionBean.lastName}, locale=#{sessionBean.locale}, merchantAdmin=#{sessionBean.merchantAdmin}, Permission=#{sessionBean.permission}, priceListId=#{sessionBean.priceListId}, primaryAccountId=#{sessionBean.primaryAccountId}, primaryAccountType=#{sessionBean.primaryAccountType}, primaryAddressId=#{sessionBean.primaryAddressId}, responsibility=#{sessionBean.responsibilities}, rootAccountId=#{sessionBean.rootAccountId}, siteCode=#{sessionBean.siteCode}, siteName=#{sessionBean.siteName}, skinFamily=#{sessionBean.skinFamily}, userName=#{sessionBean.userName}, userType=#{sessionBean.userType}, workPhoneNumber=#{sessionBean.workPhoneNumber} ----- AppSession attribute End -----" /> </af:panelGroup> </af:regionDef> </jsp:root>

Error Messages and Generic Error Page


In the page file you can include an af:messages tag after the third-level menu to display any error messages that are put into the FacesContext class. These error messages can be added to FacesContext by calling the FacesContext.addMessage API. For example: <af:panelHeader text="#{messageBean['SS_ASSET_MODIFY_ASSET']}"> <ss:menuThird value="#{menuModel.model}" var="menuThird"> <f:facet name="nodeStamp"> <af:goMenuItem rendered="#{menuThird.rendered}" text="#{menuThird.rendered}"/> </f:facet> </ss:menuThird>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

59

Customizing Pages for Siebel Self-Service Applications Service Request Page Example for Siebel E-Support

<af:messages globalOnly="true"/> <af:panelGroup layout="vertical" styleClass="af_showOneTab_body"> The error page defined in the web.xml file contains the generic error page functionality for unhandled exceptions.

Service Request Page Example for Siebel E-Support


The following is an example of a Service Request page for the Siebel E-Support application. The regions are defined in the region-metadata.xml file in the ViewController/public_html/META-INF directory. The regions referenced in the template file, but not defined in it, are placeholders for developers to add content without having to modify the template. <?xml version='1.0' encoding='windows-1252'?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0" xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces"> <jsp:output omit-xml-declaration="true" doctype-root-element="HTML" doctype-system="http://www.w3.org/TR/html4/loose.dtd" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/> <jsp:directive.page contentType="text/html;charset=windows-1252"/> <f:view> <!-- Service Request is used as an example. You can replace "sr" with another module name and "ServiceRequest" with another page name. --> <af:document title="#{res['ss.base.common.companyName']}: #{res['ss.base.sr.ServiceRequest.pageTitle']}"> <af:form>

<!-- Main page content --> <af:panelBorder> <!-- Page header is in the top facet. --> <f:facet name="top"> <af:region id="header" regionType="ss.base.common.pageHeader"/> </f:facet>

<f:facet name="left">

60

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Service Request Page Example for Siebel E-Support

<af:panelGroup layout="vertical" styleClass="ss_left_bin"> <af:region id="left1" regionType="ss.base.sr.ServiceRequest.left1"/> <af:region id="left2" regionType="ss.base.sr.ServiceRequest.left2"/> <af:region id="left3" regionType="ss.base.sr.ServiceRequest.left3"/> <af:region id="left4" regionType="ss.base.sr.ServiceRequest.left4"/> <af:region id="left5" regionType="ss.base.sr.ServiceRequest.left5"/> <af:region id="left6" regionType="ss.base.sr.ServiceRequest.left6"/> </af:panelGroup> </f:facet> <f:facet name="right"> <af:panelGroup layout="vertical" styleClass="ss_right_bin"> <af:region id="right1" regionType="ss.base.sr.ServiceRequest.right1"/> <af:region id="right2" regionType="ss.base.sr.ServiceRequest.right2"/> <af:region id="right3" regionType="ss.base.sr.ServiceRequest.right3"/> <af:region id="right4" regionType="ss.base.sr.ServiceRequest.right4"/> <af:region id="right5" regionType="ss.base.sr.ServiceRequest.right5"/> <af:region id="right6" regionType="ss.base.sr.ServiceRequest.right6"/> </af:panelGroup> </f:facet> <f:facet name="innerTop"> <af:region id="innerTop1" regionType="ss.base.sr.ServiceRequest.innerTop1"/> </f:facet> <f:facet name="innerBottom"> <af:region id="innerBottom1" regionType="ss.base.sr.ServiceRequest.innerBottom1"/> </f:facet>

<!-- Page footer is in the bottom facet. --> <f:facet name="bottom"> <af:region id="footer" regionType="ss.base.common.pageFooter"/>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

61

Customizing Pages for Siebel Self-Service Applications Customizing Page Templates for Self-Service Applications

</f:facet>

<!-- Body is not within a facet, therefore rendered in page central content area. --> <af:region id="body" regionType="ss.base.sr.ServiceRequest.body"/>

</af:panelBorder> </af:form> </af:document> </f:view> </jsp:root>

Customizing Page Templates for SelfService Applications


To customize a page template, copy, rename, and then edit its .jspx file. For example the page file for the Home template (catalog home page) is ViewController/public_html/ss/base/catalog/ Catalog.jspx. You will also need to copy, rename, and edit its page definition file, as well as copy, rename, and edit references to it in the DataBindings.cpx file in the ViewController/WEB-INF/classes/view directory. DataBindings.cpx maps physical JSPX pages to page definitions. For more information on DataBindings.cpx, see About ADF Binding on page 171.

To customize a page template 1 2 3


Copy the page template file and rename it, for example, CatalogABC.jspx, where ABC is the name of your company. Make changes to the copy in Oracle JDeveloper or a text editor. Update the page template mappings in your customized version of template-faces-config.xml to use the new template. For more information on templates, see Customizing Page Template Mappings for Self-Service Applications on page 74.

Copy the page definition file for the page template and rename it. For example, Catalog.jspx is defined in ViewController/classes/oracle/apps/ss/base/view/ pageDefs/catalog/CatalogPageDef.xml. Copy this file and rename the copy to CatalogABCPageDef.xml.

Copy DataBindings.cpx and rename it, for example to DataBindingsABC.cpx.

62

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Customizing Regions for Siebel Self-Service Applications

Open DataBindingsABC.cpx and edit the mappings for your customized page template and its page definition in the <pageMap> and <pageDefinitionUsages> sections, for example: <pageMap> ... <page path="/ss/base/catalog/CatalogABC.jspx" usageId="CatalogABCPageDef"/> ... </pageMap> ... <pageDefinitionUsages> ... <page id="CatalogABCPageDef" path="oracle.apps.ss.base.view.pageDefs.catalog.CatalogABCPageDef"/> ... </pageDefinitionUsages>

7 8

Open ViewController/public_html/WEB-INF/web.xml in a text editor or Oracle JDeveloper. Under the CpxFileName parameter, make an entry for your customized DataBindingsABC.cpx file, for example: <param-name>CpxFileName</param-name> <param-value>view.DataBindingsABC</param-value>

Customizing Regions for Siebel SelfService Applications


Regions (for example, /ss/base/catalog/region/CatalogNarrowByBinRegion.jspx) are defined in ViewController/public_html/META-INF/region-metadata.xml. To customize a region, you create a new JSPX page for the region, and then redefine the mapping in ViewController/public_html/WEB-INF/region-metadata.xml. WEB-INF/region-metadata.xml is applied after META-INF/region-metadata.xml. You need to redefine only those regions you wish to customize.

To customize a region 1 2 3
Copy the regions JSPX file and rename it, for example, CatalogNarrowByBinRegionABC.jspx, where ABC is the name of your company. Make changes to the copy in Oracle JDeveloper or a text editor. Redefine the mapping in WEB-INF/region-metadata.xml to use the new region.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

63

Customizing Pages for Siebel Self-Service Applications Creating Page Templates for Siebel Self-Service Applications

Creating Page Templates for Siebel SelfService Applications


The procedure for creating a new page template is the same as for customizing page templates, but you start from the base page template file, ViewController/public_html/ss/base/common/ PageSkeleton.jspx.

To create a page template 1 2 3


Copy the PageSkeleton.jspx file and rename it, for example, ABCPageSkeleton.jspx, where ABC is the name of your company. Make changes to the copy in Oracle JDeveloper or a text editor. Update the page template mappings in your customized version of template-faces-config.xml to use the new template. For more information on templates, see Customizing Page Template Mappings for Self-Service Applications on page 74.

About Template Indirection


Template indirection is the process of mapping logical names to physical page (.jspx) files. Template indirection conforms to the Model-View-Controller design pattern by separating the presentation logic from the physical page files. Template indirection can be done dynamically as well as statically. Dynamic template indirection is based on the context variables such as user type, service request type, and product category. It is available for only eight pages (see Table 9 on page 65). Static template indirection is used to avoid hard coding of the jspx pages and images.

About Page Template Mappings for Siebel Self-Service Applications


A page template is a logical name given to a .jspx file that has the contents of a page. For example, /ss/base/catalog/ProductsListView.jspx has the name SS_CATALOG_PROD_LIST_PAGE.

64

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications About Page Template Mappings for Siebel Self-Service Applications

Template mappings allow you to use different pages for different functions, such as product category and service request. In the standard application, page template mappings are stored in a file called template-faces-config.xml. Each template is represented as a set of five properties that are defined in the TemplateListLoader managed bean. These properties shown in Table 9.

Table 9. Property

Page Template Mapping Properties Description Template name. Do not use spaces to separate words, for example: BrowseProduct SS_CATALOG_CATEGORY_PAGE

logicalName

physicalName

Relative path of the page or image, for example: /ss/base/setup/TemplateRules.jspx /ss/base/image/Logo.png

description

Seeded message code used to show the template name in the language of the user. Use capital letters separated by underscores, for example: SS_MY_ACCOUNT_B2B_PAGE_TEMPLATE SS_SR_CASE_DESC

type

The possible values are: image (for images) ViewId (for .jspx files; that is, pages)

pageName

Used to group the templates based on the page name (mainly for pages with template rules). Can be one of the following values (context type in parentheses): Home (User Type) Browse Products (Product Category) Checkout Start (User Type) My Accounts (UserType) Product Categories (Product Category) Product Details (Product Category) Promotion Details (Product Category) Service Request Start (SR Type) General

NOTE: The pageName value is General for all images and for page templates (.jspx files) with no template mapping rules.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

65

Customizing Pages for Siebel Self-Service Applications Page Template Mapping Example for Self-Service Applications

Entries for templates take the forms shown in the following examples: Page with a template mapping rule: <value>SS_CATALOG_PROD_LIST_PAGE</value> <value>/ss/base/catalog/ListView.jspx</value> <value>SS_CATALOG_PRODUCT_TEMPLATE</value> <value>ViewId</value> <value>Product Details</value> Page without a template mapping rule: <value>SS_LOGIN</value> <value>/ss/base/common/LaunchLogin.jspx</value> <value>SS_LOGIN_TEMPLATE</value> <value>ViewId</value> <value>General</value> Image: <value>SS_ORACLE_LOGO</value> <value>/ss/base/image/logo.png</value> <value>SS_ORACLE_LOGO</value> <value>image</value> <value>General</value>

Page Template Mapping Example for Self-Service Applications


The following is an example of the template-faces-config.xml file: <?xml version="1.0" encoding="windows-1252"?> <!-- Used to define the templates for the pages and images --> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> <faces-config xmlns="http://java.sun.com/JSF/Configuration"> <managed-bean>

66

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Page Template Mapping Example for Self-Service Applications

<managed-bean-name>templateListLoader</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.setup.template.TemplateListLoader</ managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <!-- Template Properties --> <managed-property> <property-name>beanProps</property-name> <list-entries> <value-class>java.lang.String</value-class> <value>logicalName</value> <value>physicalName</value> <value>description</value> <value>type</value> <value>pageName</value> </list-entries> </managed-property> <!-- Template Mappings --> <managed-property> <property-name>mappings</property-name> <list-entries> <value>Login</value> <value>/ss/base/auth/LoginLaunch.jsp</value> <value>Login Template</value> <value>ViewId</value> <value>Login</value>

<value>Logout</value> <value>/ss/base/auth/LogoutLaunch.jsp</value> <value>Logout Template</value> <value>ViewId</value>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

67

Customizing Pages for Siebel Self-Service Applications Page Template Mapping Example for Self-Service Applications

<value>Logout</value>

<value>Merchant</value> <value>/ss/base/setup/Merchant.jsp</value> <value>Merchant Template</value> <value>ViewId</value> <value>Merchant</value>

<value>SITE_SELECTION_PAGE</value> <value>/ss/base/site/SiteList.jspx</value> <value>SITE_SELECTION_PAGE_DESC</value> <value>ViewId</value> <value>Site Page</value>

<value>SS_REG_B2C_PAGE</value> <value>/ss/base/um/registration/RegIndividualUser.jspx</value> <value>SS_REG_B2C_PAGE_DESC</value> <value>ViewId</value> <value>General</value>

<value>SS_REG_B2BPRIM_PAGE</value> <value>/ss/base/um/registration/RegPrimaryUser.jspx</value> <value>SS_REG_B2BPRIM_PAGE_DESC</value> <value>ViewId</value> <value>General</value>

<value>SS_REG_B2BSEC_PAGE</value> <value>/ss/base/um/registration/RegSecondaryUser.jspx</value> <value>SS_REG_B2BSEC_PAGE_DESC</value> <value>ViewId</value>

68

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Page Template Mapping Example for Self-Service Applications

<value>General</value>

<value>SS_COMPANY_LOGO</value> <value>/ss/image/logo.gif</value> <value>SS_COMPANY_IMAGE</value> <value>image</value> <value>General</value>

<value>SS_HOME_DEF</value> <value>/ss/base/catalog/Catalog.jspx</value> <value>SS_HOME_DEF_DESC</value> <value>ViewId</value> <value>Home</value> <!-- Service Request Pages --> <value>SS_SR_START_PAGE</value> <value>/ss/base/sr/SRIdentifyProblem.jspx</value> <value>SS_SR_START_DEFAULT_TMPL</value> <value>ViewId</value> <value>Service Request Start</value>

<value>SS_SR_CASE</value> <value>/ss/base/sr/SRIdentifyProblem.jspx</value> <value>SS_SR_CASE_TMPL</value> <value>ViewId</value> <value>Service Request Start</value>

<value>SS_SR_INCIDENT</value> <value>/ss/base/sr/SRIdentifyProblem.jspx</value> <value>SS_SR_INCIDENT_TMPL</value>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

69

Customizing Pages for Siebel Self-Service Applications Page Template Mapping Example for Self-Service Applications

<value>ViewId</value> <value>Service Request Start</value>

<value>SS_SR_TROUBLE_TICKET</value> <value>/ss/base/sr/SRIdentifyProblem.jspx</value> <value>SS_SR_TROUBLE_TICKET_TMPL</value> <value>ViewId</value> <value>Service Request Start</value> ... <!-- Service Request Images --> <!-- The logicalName values are from MLOVs --> <value>Case</value> <value>/ss/image/case.gif</value> <value>SS_SR_CASE_DESC</value> <value>image</value> <value>General</value>

<value>Incident</value> <value>/ss/image/incident.gif</value> <value>SS_SR_INCIDENT_DESC</value> <value>image</value> <value>General</value>

<value>Trouble Ticket</value> <value>/ss/image/troubleticket.gif</value> <value>SS_SR_TROUBLE_TICKET_DESC</value> <value>image</value> <value>General</value>

70

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Page Template Mapping Example for Self-Service Applications

<value>Support Site</value> <value>/ss/image/supportsite.gif</value> <value>SS_SR_SUPPORT_SITE_DESC</value> <value>image</value> <value>General</value>

<value>Billing Problem</value> <value>/ss/image/billingproblem.gif</value> <value>SS_SR_BILLING_PROBLEM_DESC</value> <value>image</value> <value>General</value>

<value>Installation</value> <value>/ss/image/installation.gif</value> <value>SS_SR_INSTALLATION_DESC</value> <value>image</value> <value>General</value>

<value>Request for Information</value> <value>/ss/image/requestinformation.gif</value> <value>SS_SR_REQ_FOR_INFO_DESC</value> <value>image</value> <value>General</value>

<value>Defective Product</value> <value>/ss/image/defectiveproduct.gif</value> <value>SS_SR_DEFECTIVE_PRODUCT_DESC</value> <value>image</value> <value>General</value>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

71

Customizing Pages for Siebel Self-Service Applications Page Template Mapping Example for Self-Service Applications

<value>Technical Problem</value> <value>/ss/image/technicalproblem.gif</value> <value>SS_SR_TECH_PROBLEM_DESC</value> <value>image</value> <value>General</value> <!-- General Images --> <value>SS_EXPAND_BUTTON</value> <value>/ss/skin/img/plus.gif</value> <value>Expand Button</value> <value>image</value> <value>General</value>

<value>SS_HIDE_BUTTON</value> <value>/ss/skin/img/minus.gif</value> <value>Hide Button</value> <value>image</value> <value>General</value>

<value>SS_CONFIG_EXCLUDED_ITEM_ICON</value> <value>/ss/image/excluded.gif</value> <value>Excluded Item</value> <value>image</value> <value>General</value> ... <!-- Product Categories, Browse Products, Product Details, and Promotion Details --> <value>SS_CATALOG_CATEGORY_PAGE</value> <value>/ss/base/catalog/Category.jspx</value> <value>SS_CATALOG_CAT_TMPL</value> <value>ViewId</value>

72

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Page Template Mapping Example for Self-Service Applications

<value>Product Categories</value>

<value>SS_CATALOG_PROD_LIST_PAGE</value> <value>/ss/base/catalog/ProductsListView.jspx</value> <value>SS_CATALOG_PROD_LIST_TMPL</value> <value>ViewId</value> <value>Browse Products</value>

<value>SS_CATALOG_PROD_DTLS_PAGE</value> <value>/ss/base/catalog/ProductDetails.jspx</value> <value>SS_CATALOG_PROD_DTLS_TMPL</value> <value>ViewId</value> <value>Product Details</value>

<value>SS_CATALOG_PROMO_DTLS_PAGE</value> <value>/ss/base/catalog/promotion/PromotionDetails.jspx</value> <value>SS_CATALOG_PROMO_DTLS_TMPL</value> <value>ViewId</value> <value>Promotion Details</value> <!-- My Accounts --> <value>SS_MY_ACCOUNT_B2B</value> <value>/ss/base/home/MyAccountHomeB2B.jspx</value> <value>SS_MY_ACCOUNT_B2B_PAGE_TEMPLATE</value> <value>ViewId</value> <value>My Accounts</value>

<value>SS_MY_ACCOUNT_B2C</value> <value>/ss/base/home/MyAccountHomeB2C.jspx</value> <value>SS_MY_ACCOUNT_B2C_PAGE_TEMPLATE</value>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

73

Customizing Pages for Siebel Self-Service Applications Customizing Page Template Mappings for Self-Service Applications

<value>ViewId</value> <value>My Accounts</value> <!-- Home --> <value>SS_ESERVICE_HOME_PAGE</value> <value>/ss/base/km/EserviceHome.jspx</value> <value>SS_ESERVICE_HOME_PAGE_TEMPLATE</value> <value>ViewId</value> <value>Home</value> <!-- Checkout --> <value>SS_CART_CHECKOUT_HOME</value> <value>/ss/base/cart/checkout/Shipping.jspx</value> <value>Checkout Page Template</value> <value>ViewId</value> <value>CheckoutHome</value> ... </list-entries> </managed-property> </managed-bean> </faces-config>

Customizing Page Template Mappings for Self-Service Applications


In the standard application, the page template mappings are stored in a file called template-facesconfig.xml, which is in the ViewController/public_html/WEB-INF directory. To customize the template mappings, copy, rename, and then edit this file.

To customize page template mappings 1 2


Copy the template-faces-config.xml file and rename it, for example, template-faces-configABC.xml, where ABC is the name of your company. Replace template-faces-config.xml with template-faces-config-ABC.xml in ViewController/ public_html/web.xml under the context parameter javax.faces.CONFIG_FILES:

74

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Setting Page Template Mappings for Self-Service Applications

<context-param> <param-name>javax.faces.CONFIG_FILES</param-name> <param-value>...,/WEB-INF/template-faces-config-ABC.xml,...</param-value> </context-param>

Open template-faces-config-ABC.xml in a text editor and make the necessary changes to create your new page mappings. For the available properties of page template mappings, see Table 9 on page 65.

Setting Page Template Mappings for Self-Service Applications


The Page Templates page in Site Administration is used for setting the page template mappings according to the values of condition variables, such as User Type and SR Type. The choice of templates is determined by the templates defined in template-config-faces.xml, or your customized version of it.

To set page template mappings 1 2


Log in to the Siebel Self-Service Applications Site Administration URL. Navigate to the Site Administration screen, Application tab, and then the Page Templates view. The Page Templates page appears.

Make the changes to the page template mappings.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

75

Customizing Pages for Siebel Self-Service Applications About Page Flows for SelfService Applications

About Page Flows for Self-Service Applications


Page flows control the navigation from one page to another, for example, from the Shopping Cart to the shipping information page during checkout. Page flows are defined in a file called faces-configbase.xml, which is in the ViewController/public_html/WEB-INF directory. To customize the page flows, copy, rename, and then edit this file. A portion of the Diagram view of faces-config-base.xml in Oracle JDeveloper is shown in Figure 6 on page 76.

Figure 6.

Diagram View of faces-config-base.xml

The arrows in Figure 6 represent the page flows to and from the Shopping Cart detail page, CartDetail.jspx, which shows the items in the Shopping Cart. Arrow labels represent the actions taken on the starting page that lead to the destination page. For example, users can continue shopping and rename their Shopping Cart, or examine product details (page not shown). Anonymous users must log in to be able to check out. For information on using Oracle JDeveloper, see Oracle JDeveloper 10g Online Help.

76

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Page Flow Example for the Self-Service Shopping Cart

Page Flow Example for the Self-Service Shopping Cart


The following code example shows the sections of the faces-config-base.xml file that define the behavior of the Shopping Cart: Navigation rules Backing beans, which are managed beans that contain event handler methods

<!-- Shopping Cart Navigation Rules --> <navigation-rule> <!--from-view-id>/ss/base/cart/CartDetail.jspx</from-view-id--> <!--from-view-id>/*</from-view-id--> <!-- Without from-view-id, access is allowed to Shopping Cart detail and checkout pages from the Shopping Cart bin on any page. --> <navigation-case> <from-outcome>dialog:viewcart</from-outcome> <to-view-id>/ss/base/cart/CartDetail.jspx</to-view-id> </navigation-case> <navigation-case> <from-action>#{CartDetailBean.checkOutAction}</from-action> <from-outcome>B2BCheckOut</from-outcome> <to-view-id>/ss/base/cart/checkout/Shipping.jspx</to-view-id> <redirect/> </navigation-case> <navigation-case> <from-action>#{CartDetailBean.checkOutAction}</from-action> <from-outcome>B2CCheckOut</from-outcome> <to-view-id>/ss/base/cart/checkout/ShippingAndBillingB2C.jspx</to-view-id> <redirect/> </navigation-case> <navigation-case> <from-action>#{CartDetailBean.checkOutAction}</from-action>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

77

Customizing Pages for Siebel Self-Service Applications Page Flow Example for the Self-Service Shopping Cart

<from-outcome>GUESTCheckOut</from-outcome> <to-view-id>/ss/base/cart/checkout/PreCheckout.jsp</to-view-id> <redirect/> </navigation-case> </navigation-rule> <!-- Navigation from Shopping Cart Detail Page --> <navigation-rule> <from-view-id>/ss/base/cart/CartDetail.jspx</from-view-id> <navigation-case> <from-action>#{CartDetailBean.executeCartAction}</from-action> <from-outcome>login</from-outcome> <to-view-id>/ss/base/common/Login.jspx</to-view-id> <redirect/> </navigation-case> <navigation-case> <from-action>#{CartDetailBean.reconfigure}</from-action> <from-outcome>reconfigure</from-outcome> <to-view-id>/ss/base/catalog/ProductDetails.jspx</to-view-id> </navigation-case> <navigation-case> <from-action>#{CartDetailBean.executeCartAction}</from-action> <from-outcome>dialog:renameCart</from-outcome> <to-view-id>/ss/base/cart/popup/RenameCart.jspx</to-view-id> </navigation-case> <navigation-case> <from-outcome>continueShopping</from-outcome> <to-view-id>#{CartDetailBean.continueShopping}</to-view-id> <redirect/> </navigation-case>

78

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Page Flow Example for the Self-Service Shopping Cart

</navigation-rule> ... <!-- Shopping Cart Backing Beans --> <managed-bean> <managed-bean-name>CartManageDisplayBean</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.cart.CartManageDisplayBean</ managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean> <managed-bean> <managed-bean-name>CartDetailBean</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.cart.CartDetailBean</managed-beanclass> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>bindings</property-name> <value>#{bindings}</value> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>CartListBean</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.cart.CartListBean</managed-beanclass> <managed-bean-scope>request</managed-bean-scope> </managed-bean> ... </faces-config>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

79

Customizing Pages for Siebel Self-Service Applications Customizing Page Flows for Self-Service Applications

Customizing Page Flows for SelfService Applications


Page flows are defined in faces-config-base.xml, which is in the ViewController/public_html/WEBINF directory. To customize the page flows, copy, rename, and then edit this file in Oracle JDeveloper.

To customize page flows 1 2


Copy the faces-config-base.xml file in the ViewController/public_html/WEB-INF directory and rename it, for example, faces-config-ABC.xml, where ABC is the name of your company. Replace faces-config-base.xml with faces-config-ABC.xml in ViewController/public_html/ web.xml under the context parameter javax.faces.CONFIG_FILES: <context-param> <param-name>javax.faces.CONFIG_FILES</param-name> <param-value>...,/WEB-INF/faces-config-ABC.xml,...</param-value> </context-param>

In the Applications Navigator in Oracle JDeveloper, expand the WEB-INF node under ViewController/public_html, and then double-click faces-config-ABC.xml to open it. NOTE: This file is very large. It is recommended to open it in the Overview view.

Click the Diagram tab. The schematic view of the pages, page flows, and navigation rules opens, as shown in Figure 6 on page 76. NOTE: Working with this file in the Diagram view in Oracle JDeveloper is computationally intensive.

Edit the page flows and navigation rules using the Structure window and Properties Inspector. You can also edit the source code by clicking the Source tab.

About Process Trains for Self-Service Applications


When you want to specify that a set of pages in an application must be visited in a particular order, such as a registration or checkout process, a process train can be used for navigation. A process train shows users the total number of steps in a process, as well as where they are in the series of steps. The ADF Faces CoreProcessTrain component implements the process train. Its nodeStamp facet is bound to a process train model, which uses the MenuModel class, along with the ProcessMenuModel and ProcessUtils classes, to generate the process train dynamically.

80

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications About Process Trains for SelfService Applications

Process trains are rendered by classes that build on CoreProcessTrain. For example, in Siebel SelfService Applications, the VerticalProcessTrainRenderer class, which is referenced in faces-configbase.xml, implements a vertical process train. For more information on process train classes, see Oracle JDeveloper 10g Online Help. Process trains are defined in a configuration file, typically called faces-config-baseapplication_name-train.xml, which is in the ViewController/public_html/WEB-INF directory.

Sample Process Train for Self-Service Applications


The following is an example of a process train template, faces-config-sample-train.xml. First the process train menu model is defined as a set of managed beans. Then order of the steps in the train is defined as a list of values. Finally, the menu is built. <?xml version="1.0" encoding="windows-1252"?> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> <faces-config xmlns="http://java.sun.com/JSF/Configuration">

Building the Menu Model <!-- Sample Menu Model For Process Train in SampleSkinPage.jspx --> <managed-bean> <managed-bean-name>menuItem_a1</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>Select Request Type</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/ss/base/common/train1.jspx</value> </managed-property> </managed-bean>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

81

Customizing Pages for Siebel Self-Service Applications About Process Trains for SelfService Applications

<managed-bean> <managed-bean-name>menuItem_a2</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>Identify Problem</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/ss/base/common/train2.jspx</value> </managed-property> </managed-bean>

<managed-bean> <managed-bean-name>menuItem_a3</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>Suggested Solutions</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/ss/base/common/train3.jspx</value> </managed-property> </managed-bean>

<managed-bean> <managed-bean-name>menuItem_a4</managed-bean-name>

82

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications About Process Trains for SelfService Applications

<managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>Contact Information</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/node4.jspx</value> </managed-property> </managed-bean>

<managed-bean> <managed-bean-name>menuItem_a5</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>Review and Submit</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/node5.jspx</value> </managed-property> </managed-bean>

<managed-bean> <managed-bean-name>menuItem_a6</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

83

Customizing Pages for Siebel Self-Service Applications About Process Trains for SelfService Applications

<managed-property> <property-name>label</property-name> <value>Confirmation</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/node6.jspx</value> </managed-property> </managed-bean> Defining the Process Train <managed-bean> <managed-bean-name>menuTreeModelTrain</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuTreeModelAdapter </managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>childProperty</property-name> <value>children</value> </managed-property> <managed-property> <property-name>listInstance</property-name> <list-entries> <value-class>oracle.apps.ss.base.view.util.MenuItem</value-class> <value>#{menuItem_a1}</value> <value>#{menuItem_a2}</value> <value>#{menuItem_a3}</value> <value>#{menuItem_a4}</value> <value>#{menuItem_a5}</value> <value>#{menuItem_a6}</value> </list-entries>

84

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Service Request Process Train Example for Siebel E-Support

</managed-property> </managed-bean> Building the Menu <managed-bean> <managed-bean-name>menuModelTrain</managed-bean-name> <managed-bean-class> oracle.apps.ss.base.view.util.MenuModelAdapter</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>viewIdProperty</property-name> <value>viewId</value> </managed-property> <managed-property> <property-name>instance</property-name> <value>#{menuTreeModelTrain.model}</value> </managed-property> </managed-bean> </faces-config>

Service Request Process Train Example for Siebel E-Support


In the faces-config-base-sr-train.xml file, a process train is defined for each service request type according to the following syntax: <value>SR Type</value> <value>PageNameNode</value> ... <value>SR Type</value> Each Node line calls a specific Web page. The pages appear in the order in which the lines are entered in faces-config-base-sr-train.xml, for example: <value>Request for Information</value>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

85

Customizing Pages for Siebel Self-Service Applications Service Request Process Train Example for Siebel E-Support

<value>IdentifyProblemSinglePageNode</value> <value>ReviewandSubmitNode</value> <value>ConfirmationNode</value> <value>Request for Information</value> When a user submits a Request for Information SR, the user sees first an expanded (single-page) Identify Problem page, then a Review and Submit page, and finally a Confirmation page. The following is the process train model for service requests in Siebel E-Support, faces-config-base-sr-train.xml: <?xml version="1.0" encoding="windows-1252"?> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> <faces-config xmlns="http://java.sun.com/JSF/Configuration"> <!-- DO NOT CHANGE ANY OF THE MANAGED BEAN NAMES IN THIS FILE --> Defining the Menu Model <managed-bean> <managed-bean-name>SelectRequestTypeNode</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.sr.SRMenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>SS_SR_SELECT_SR_TYPE</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/ss/base/sr/SRSelectRequestTypeBody.jspx</value> </managed-property> <managed-property> <property-name>viewId</property-name> <value>/ss/base/sr/SRSelectRequestTypeBody.jspx</value>

86

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Service Request Process Train Example for Siebel E-Support

</managed-property> </managed-bean>

<managed-bean> <managed-bean-name>IdentifyProblemNode</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.sr.SRMenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>SS_SR_IDENTIFY_PROBLEM</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/ss/base/sr/SRIdentifyProblem.jspx</value> </managed-property> <managed-property> <property-name>viewId</property-name> <value>/ss/base/sr/SRIdentifyProblem.jspx</value> </managed-property> </managed-bean>

<managed-bean> <managed-bean-name>IdentifyProblemSinglePageNode</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.sr.SRMenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>SS_SR_IDENTIFY_PROBLEM</value> </managed-property> <managed-property>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

87

Customizing Pages for Siebel Self-Service Applications Service Request Process Train Example for Siebel E-Support

<property-name>fileName</property-name> <value>/ss/base/sr/SRIdentifyProblemSingle.jspx</value> </managed-property> <managed-property> <property-name>viewId</property-name> <value>/ss/base/sr/SRIdentifyProblemSingle.jspx</value> </managed-property> </managed-bean>

<managed-bean> <managed-bean-name>SuggestedSolutionsNode</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.sr.SRMenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>SS_SR_SUGGESTED_SOLUTION</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/ss/base/sr/SRSuggestedSolutions.jspx</value> </managed-property> <managed-property> <property-name>viewId</property-name> <value>/ss/base/sr/SRSuggestedSolutions.jspx</value> </managed-property> </managed-bean>

<managed-bean> <managed-bean-name>ContactInformationNode</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.sr.SRMenuItem</managed-bean-class>

88

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Service Request Process Train Example for Siebel E-Support

<managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>SS_SR_CONTACT_INFORMATION</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/ss/base/sr/SRContactInformation.jspx</value> </managed-property> <managed-property> <property-name>viewId</property-name> <value>/ss/base/sr/SRContactInformation.jspx</value> </managed-property> </managed-bean>

<managed-bean> <managed-bean-name>AddAttachmentsNode</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.sr.SRMenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>SS_SR_ADD_ATTACHMENT</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/ss/base/sr/SRCreateAttachContainer.jspx</value> </managed-property> <managed-property> <property-name>viewId</property-name> <value>/ss/base/sr/SRCreateAttachContainer.jspx</value>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

89

Customizing Pages for Siebel Self-Service Applications Service Request Process Train Example for Siebel E-Support

</managed-property> </managed-bean>

<managed-bean> <managed-bean-name>ReviewandSubmitNode</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.sr.SRMenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>SS_SR_REVIEW_SUBMIT</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/ss/base/sr/SRReviewandSubmit.jspx</value> </managed-property> <managed-property> <property-name>viewId</property-name> <value>/ss/base/sr/SRReviewandSubmit.jspx</value> </managed-property> </managed-bean>

<managed-bean> <managed-bean-name>ConfirmationNode</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.sr.SRMenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>SS_SR_CONFIRMATION</value> </managed-property> <managed-property>

90

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Service Request Process Train Example for Siebel E-Support

<property-name>fileName</property-name> <value>/ss/base/sr/SRCreateConfirmation.jspx</value> </managed-property> <managed-property> <property-name>viewId</property-name> <value>/ss/base/sr/SRCreateConfirmation.jspx</value> </managed-property> </managed-bean>

<managed-bean> <managed-bean-name>ReviewandSubmitSinglePageNode</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.sr.SRMenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>SS_SR_REVIEW_SUBMIT</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/ss/base/sr/SRReviewandSubmitSingle.jspx</value> </managed-property> <managed-property> <property-name>viewId</property-name> <value>/ss/base/sr/SRReviewandSubmitSingle.jspx</value> </managed-property> </managed-bean> Building the Menu <managed-bean> <managed-bean-name>menuModelSRTrain</managed-bean-name>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

91

Customizing Pages for Siebel Self-Service Applications Service Request Process Train Example for Siebel E-Support

<managed-bean-class>oracle.apps.ss.base.view.sr.MenuModelSRAdapter</managed-beanclass> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>viewIdProperty</property-name> <value>viewId</value> </managed-property> <managed-property> <property-name>instance</property-name> <value>#{menuTreeModelSRTrain.model}</value> </managed-property> Defining the Process Trains <managed-property> <property-name>srPageFlowList</property-name> <!-- The case of the request type must match the case in the database. --> <list-entries> <value-class>java.lang.String</value-class> <value>Request for Information</value> <value>IdentifyProblemSinglePageNode</value> <value>ReviewandSubmitSinglePageNode</value> <value>ConfirmationNode</value> <value>Request for Information</value>

<value>Case</value> <value>IdentifyProblemNode</value> <value>SuggestedSolutionsNode</value> <value>ContactInformationNode</value> <value>AddAttachmentsNode</value> <value>ReviewandSubmitNode</value> <value>ConfirmationNode</value>

92

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Service Request Process Train Example for Siebel E-Support

<value>Case</value>

<value>Incident</value> <value>IdentifyProblemNode</value> <value>SuggestedSolutionsNode</value> <value>ContactInformationNode</value> <value>AddAttachmentsNode</value> <value>ReviewandSubmitNode</value> <value>ConfirmationNode</value> <value>Incident</value>

<value>Defective Product</value> <value>IdentifyProblemSinglePageNode</value> <value>ReviewandSubmitSinglePageNode</value> <value>ConfirmationNode</value> <value>Defective Product </value>

<value>Installation</value> <value>IdentifyProblemNode</value> <value>SuggestedSolutionsNode</value> <value>ContactInformationNode</value> <value>AddAttachmentsNode</value> <value>ReviewandSubmitNode</value> <value>ConfirmationNode</value> <value>Installation</value>

<value>Default</value> <value>IdentifyProblemNode</value> <value>SuggestedSolutionsNode</value> <value>ContactInformationNode</value>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

93

Customizing Pages for Siebel Self-Service Applications Customizing Process Trains for Self-Service Applications

<value>AddAttachmentsNode</value> <value>ReviewandSubmitNode</value> <value>ConfirmationNode</value> <value>Default</value> </list-entries> </managed-property> </managed-bean> </faces-config>

Customizing Process Trains for SelfService Applications


Process trains are defined in a configuration file, typically called faces-config-baseapplication_name-train.xml, which is in the ViewController/WEB-INF directory. To customize the template mappings, copy, rename, and then edit this file. For example, suppose you want to add a step to the Case service request type to survey the customer about whether the suggested solutions were helpful. You must perform the following tasks: Customizing the Service Request Process Train on page 94 Customizing the Menu Model to Add the Survey Page on page 96

Customizing the Service Request Process Train


In your customized version of faces-config-base-sr-train.xml, you must create a managed bean to define the survey node, and then add that node to the Case process train.

To customize a service request process train 1


Copy the faces-config-base-sr-train.xml file in the ViewController/public_html/WEB-INF directory and rename it, for example, faces-config-ABC-sr-train.xml, where ABC is the name of your company. Open ViewController/public_html/WEB-INF/web.xml in a text editor or Oracle JDeveloper. Under the javax.faces.CONFIG_FILES parameter, make an entry for the newly added facesconfig-ABC-sr-train.xml, for example: <param-name>javax.faces.CONFIG_FILES</param-name> <param-value>...,/WEB-INF/faces-config-ABC-sr-train.xml,...</param-value>

2 3

Open faces-config-ABC-sr-train.xml in a text editor or Oracle JDeveloper.

94

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Customizing Process Trains for Self-Service Applications

Create a managed bean for the survey node, for example: <managed-bean> <managed-bean-name>SurveyNode</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.sr.SRMenuItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>SS_SR_SURVEY</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/ss/base/sr/SRSurvey.jspx</value> </managed-property> <managed-property> <property-name>viewId</property-name> <value>/ss/base/sr/SRSurvey.jspx</value> </managed-property> </managed-bean>

Edit the process train for the Case service request type, adding a survey node: <value>Case</value> <value>IdentifyProblemNode</value> <value>SuggestedSolutionsNode</value> <value>SurveyNode</value> <value>ContactInformationNode</value> <value>AddAttachmentsNode</value> <value>ReviewandSubmitNode</value> <value>ConfirmationNode</value> <value>Case</value>

7 8

Save your changes. Create the SRSurvey.jspx page in Oracle JDeveloper.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

95

Customizing Pages for Siebel Self-Service Applications Customizing Process Trains for Self-Service Applications

Customizing the Menu Model to Add the Survey Page


To customize the menu model to add the survey page, SRSurvey.jspx, you must do the following: Add an entry in your customized version of the faces-config-base-menu.xml file to create the third-level menu for the survey page. Add a managed bean property to control the rendering. Modify the survey page to reference the SRSummary backing bean. Modify the SRSummary backing bean.

For more information on the menu model and customizing it, see Chapter 6, Customizing Menus for Siebel Self-Service Applications.

To customize the menu model to add the survey page 1


Copy the faces-config-base-menu.xml file in the ViewController/public_html/WEB-INF directory, and rename it, for example, faces-config-ABC-menu.xml, where ABC is the name of your company. Replace faces-config-base-menu.xml with faces-config-ABC-menu.xml in ViewController/ public_html/web.xml under the context parameter javax.faces.CONFIG_FILES: <context-param> <param-name>javax.faces.CONFIG_FILES</param-name> <param-value>...,/WEB-INF/faces-config-ABC-menu.xml,...</param-value> </context-param>

3 4

Open faces-config-ABC-menu.xml in a text editor. Add a managed bean for the third-level menu: <managed-bean> <managed-bean-name>m3_SRSURVEY</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>SS_SR_CREATE_REQUEST</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/ss/base/sr/SRSurvey.jspx</value>

96

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Pages for Siebel Self-Service Applications Customizing Process Trains for Self-Service Applications

</managed-property> <managed-property> <property-name>condition</property-name> <value>backing_ss_base_sr_SRSummary.SRSurveyRendered</value> </managed-property> </managed-bean>

Add the third-level menu as a child of the second-level Service Request menu: <managed-bean> <managed-bean-name>m2_ServiceRequest</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> ... <managed-property> <property-name>children</property-name> <list-entries> <value-class>oracle.apps.ss.base.view.util.MenuItem</value-class> <value>#{m3_SRCRCONFIRM}</value> <value>#{m3_SRCRSELECTTYPE}</value> <value>#{m3_SRREVIEW}</value> <value>#{m3_SRCONTACTINFO}</value> ... <value>#{m3_SRSUGGESTSOLUTION}</value> <value>#{m3_SRSURVEY}</value> <value>#{m3_SRREVIEWSINGLE}</value> ... </list-entries> </managed-property> </managed-bean>

Open SRSurvey.jspx in Oracle JDeveloper or a text editor, and then modify the af:form tag as follows: <af:form binding="#{backing_ss_base_sr_SRSummary.srSurveyform}">

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

97

Customizing Pages for Siebel Self-Service Applications Customizing Process Trains for Self-Service Applications

Open the SRSummary managed bean (ViewController/src/oracle/apps/ss/base/view/sr/ SRSummary.java) in Oracle JDeveloper or a text editor, and then add the following code: private CoreForm srSurveyform; public void setSrSurveyform(CoreForm form) { createSRTabCount = 12 //Assign a unique value. this.srSurveyform = form; } public CoreForm getSrSurveyform() { return srSurveyform; } public boolean getSRSurveyRendered() { if (createSRTabCount == 12) //Use the same value as above. return true; else return false; } NOTE: You must assign to createSRTabCount a value that does not already exist in the SRSummary.java file.

98

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Menus for Siebel Self-Service Applications

This chapter describes the menu model in Siebel Self-Service Applications and how to customize it. It includes the following topics: About the Menu Model for Self-Service Applications on page 99 Menu Model Example for Self-Service Applications on page 101 Customizing the Menu for Self-Service Applications on page 113 Showing and Hiding Menu Nodes Based on Business Logic on page 114 Using the Condition Property to Hide Detail Nodes in List-Detail Pages on page 114 Using the af:goLink Tag for Navigating to Secure and Nonsecure Pages on page 118

About the Menu Model for Self-Service Applications


Siebel Self-Service Applications all use the same context-based, hierarchical menu model for primary navigation. The structure of this hierarchical menu model is defined in the faces-config-basemenu.xml file, which is in the ViewController/public_html/WEB-INF directory. The faces-configbase-menu.xml file is registered in web.xml, also found in WEB-INF. Figure 7 shows the structure of the hierarchical menu model. Not all menu nodes are displayed.

Figure 7.

Menu Model

At depth 0, global menus and menu tabs are defined, with the only difference being the type of node. If the type is global, a node is rendered as a global menu item; if not, it is rendered as a tab. Each node in the menu model can have child menu nodes, for example, the Shopping Cart child node of the Products node and the Current Cart node of the Shopping Cart node.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

99

Customizing Menus for Siebel Self-Service Applications About the Menu Model for Self-Service Applications

Every node of the menu is encapsulated as a MenuItem JavaBean that consists of various properties for each node, shown in Table 10.

Table 10. Property children condition

Menu Node Properties Description Associates a list of children with the node, if applicable. Used to display the node based on some business rule. A valid value is ManagedBean.method as a String. For more information, see Showing and Hiding Menu Nodes Based on Business Logic on page 114.

fileName label permission rendered

Filename of the node. Name of the node. One or more permissions attached to the node that determine which users can view it. Determines whether the node is rendered. The default value is true. An expression can be used to get the value from the configuration parameters, for example, to hide a product tree if Siebel E-Commerce is not implemented. Set to true only for the eight types of pages that support template mappings. If this property is set to true, the fileName property will be interpreted as a template name and the view ID for the page will be retrieved using the ContextTemplateBean API. For more information on templates, see About Page Template Mappings for Siebel Self-Service Applications on page 64. Type of node; that is, global or default.

pageTemplate

type

The entire menu model is loaded when the session is created and placed in the session scope. Later, the menu model is used to render the context-based menus depending on the logged-in end user's permissions.

About Permissions
Users are assigned responsibilities in Siebel Self-Service Applications, and every responsibility is associated with a set of permissions. When the user first logs in, the application loads the complete set of permissions that are assigned to the logged-in user using the PermissionLoader class (oracle.apps.ss.base.model.security.PermissionLoader.java). Further, because every menu node can be assigned one or more permissions, the menu implementation displays either only those menu nodes that do not have any permissions associated with them, or those nodes that have the same permission assigned to the logged-in user. The code needed for this specific implementation is in the MenuItem.isRendered() function.

100

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Menus for Siebel Self-Service Applications Menu Model Example for Self-Service Applications

When a user requests a page, such as by clicking a menu tab, the product-specific contents within this container page are shown only if the user has the necessary permission to view that page. Otherwise, an error message is shown. For more information, see af:panelBorder Tag and Facets on page 54. Additionally, developers can use this same Permission bean for controlling the display of buttons on their pages by using the Expression Language expression: sessionBean.permission['PermissionName'] The menu model is easily customizable. For example, if a developer creates a new permission to control the display of a specific page, he or she needs to add only this permission to any menu node where it applies, and then stop and restart the Oracle Application Server.

About Locale-Specific Menus


Because Siebel Self-Service Applications need to support menu display in any locale, the label property of the menu node uses a Messages bean, which loads the translations from a resource bundle.

About Bookmarking
All the pages that are constructed using the af:goXYZ tag can be bookmarked. Because menus are constructed using the af:goMenuItem tag and links on a page are constructed using the af:goLink tag, menus and links on a page can be bookmarked. However, the end page from a navigation rule cannot be bookmarked because a navigation rule is executed using a forward request to the end page. When a request is forwarded, the page from which the navigation rule is executed is shown in the URL. To retrieve the URL for product pages, the products.getUrl() API is used, which in turn calls the contextTemplateBean.getProductsPage() API. The ContextTemplateBean API returns a view Id based on the rule defined. Other parameters needed to show the page must be appended to the products.getUrl() API. Bookmarkable pages in the application are not just for bookmarking, but can also be indexed by search engines. Therefore, the site ID and language parameters are added while constructing the URL.

Menu Model Example for Self-Service Applications


The following is an abbreviated example of a faces-config-base-menu.xml file that implements a hierarchical menu model: <?xml version="1.0" encoding="windows-1252"?> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

10 1

Customizing Menus for Siebel Self-Service Applications Menu Model Example for Self-Service Applications

"http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> <faces-config xmlns="http://java.sun.com/JSF/Configuration"> <!-- Global Menu Items --> <managed-bean> <managed-bean-name>menuGlobal_Preferences</managed-bean-name> <managed-bean-class>oracle.apps.ss.common</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>GlobalPreferences</value> </managed-property> <!-- Setting the image for the global menu --> <managed-property> <property-name>icon</property-name> <value>/images/preferences.gif</value> </managed-property> <managed-property> <property-name>type</property-name> <value>global</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/global/Preferences.jspx</value> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>menuGlobal_Help</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope>

102

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Menus for Siebel Self-Service Applications Menu Model Example for Self-Service Applications

<managed-property> <property-name>label</property-name> <value>GlobalHelp</value> </managed-property> <managed-property> <property-name>icon</property-name> <value>/images/help.gif</value> </managed-property> <managed-property> <property-name>type</property-name> <value>global</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/global/Help.jspx</value> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>menuGlobal_Logout</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>GlobalLogout</value> </managed-property> <managed-property> <property-name>icon</property-name> <value>/images/logout.gif</value> </managed-property> <managed-property>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

10 3

Customizing Menus for Siebel Self-Service Applications Menu Model Example for Self-Service Applications

<property-name>type</property-name> <value>global</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/global/Logout.jspx</value> </managed-property> <!-- Displays the logout menu item only when the user is logged in --> <managed-property> <property-name>condition</property-name> <value>sessionBean.isUserLoggedIn</value> </managed-property> </managed-bean> <!-- Global Menu Items End --> <!-- Third-level Menu --> <managed-bean> <managed-bean-name>menuList_MyCart</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>MenuList_MyCart</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/CurrentCart.jspx </value> </managed-property> <!-- The condition property defaults to false in the application and can therefore be omitted unless they need to be true. -->

104

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Menus for Siebel Self-Service Applications Menu Model Example for Self-Service Applications

<managed-property> <property-name>condition</property-name> <value>FALSE</value> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>menuList_SavedCart</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>MenuList_SavedCart </value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/SavedCart.jspx </value> </managed-property> <!-- Declaring permissions attached to the node --> <managed-property> <property-name>permission</property-name> <list-entries> <value>SAVED_CART</value> <value>ANOTHER_PERMISSION</value> <!-- Can have multiple permissions --> </list-entries> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>menuList_SharedCart</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

10 5

Customizing Menus for Siebel Self-Service Applications Menu Model Example for Self-Service Applications

<managed-property> <property-name>label</property-name> <value>MenuList_SharedCart </value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/SharedCart.jspx </value> </managed-property> <managed-property> <property-name>permission</property-name> <list-entries> <value>SHARED_CART</value> </list-entries> </managed-property> </managed-bean> <!-- Third-level Menu Ends --> <!-- Menu Bar Items and Second-level Menu --> <managed-bean> <managed-bean-name>menubar_Browse</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>MenuBar_Browse </value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>BrowseProduct</value> </managed-property>

106

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Menus for Siebel Self-Service Applications Menu Model Example for Self-Service Applications

</managed-bean> <managed-property> <property-name>pageTemplate</property-name> <value>true</value> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>menubar_ShoppingCart</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>MenuBar_ShoppingCart </value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/CurrentCart.jspx </value> </managed-property> <!-- Declaring Children for the Menu Bar Items --> <managed-property> <property-name>children</property-name> <list-entries> <value-class>oracle.apps.ss.base.view.util.MenuItem</value-class> <value>#{menuList_MyCart}</value> <value>#{menuList_SavedCart}</value> <value>#{menuList_SharedCart}</value> </list-entries> </managed-property>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

10 7

Customizing Menus for Siebel Self-Service Applications Menu Model Example for Self-Service Applications

<!-- Declaration of Children Ends --> </managed-bean> <managed-bean> <managed-bean-name>menubar_OrderStatus</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>MenuBar_OrderStatus</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/Order.jspx</value> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>menubar_OrderApproval</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>MenuBar_OrderApproval</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/OrderApproval.jspx</value> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>menubar_Lists</managed-bean-name>

108

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Menus for Siebel Self-Service Applications Menu Model Example for Self-Service Applications

<managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>MenuBar_Lists</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/Lists.jspx</value> </managed-property> </managed-bean> <!-- Menu Bar Items End --> <!-- Menu Tabs and First-level Menu --> <managed-bean> <managed-bean-name>menuTab_MyAccount</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>MenuTab_MyAccount</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/myAccount.jspx</value> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>menuTab_Statements</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

10 9

Customizing Menus for Siebel Self-Service Applications Menu Model Example for Self-Service Applications

<managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>MenuTab_Statements</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/Statements.jspx</value> </managed-property> <managed-property> <property-name>type</property-name> <value>external</value> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>menuTab_Products</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>MenuTab_Products</value> </managed-property> <!-- The fileName value is the same as the first node of the menu bar to make sure that the first node of the menu bar is selected when this tab is selected. --> <managed-property> <property-name>fileName</property-name> <value>/CurrentCart.jspx</value> </managed-property> <!-- Setting Children for Product Menu Tab --> <managed-property>

110

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Menus for Siebel Self-Service Applications Menu Model Example for Self-Service Applications

<property-name>children</property-name> <list-entries> <value-class>oracle.apps.ss.base.view.util.MenuItem</value-class> <value>#{menubar_Browse}</value> <value>#{menubar_ShoppingCart}</value> <value>#{menubar_OrderStatus}</value> <value>#{menubar_OrderApproval}</value> <value>#{menubar_Lists}</value> </list-entries> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>menuTab_Support</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>MenuTab_Support</value> </managed-property> <!-- The rendered property is true by default, but can be mapped to a configuration parameter using Expression Language. ->> <managed-property> <property-name>rendered</property-name> <value>#{configBean.eServiceEnabled}</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/Statements.jspx</value> </managed-property> <managed-property>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

11 1

Customizing Menus for Siebel Self-Service Applications Menu Model Example for Self-Service Applications

<property-name>type</property-name> <value>external</value> </managed-property> </managed-bean> <!-- Menu Tabs End --> <!-- Menu Tree Model Adapter from Menu Nodes --> <managed-bean> <managed-bean-name>menuTreeModel</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuTreeModelAdapter</managedbean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>childProperty</property-name> <value>children</value> </managed-property> <!-- Passing Instances of the Menu Node to Create the Tree --> <managed-property> <property-name>listInstance</property-name> <list-entries> <value-class>oracle.apps.ss.base.view.util.MenuItem</value-class> <value>#{menuGlobal_Preferences}</value> <value>#{menuGlobal_Help}</value> <value>#{menuGlobal_Logout}</value> <value>#{menuTab_MyAccount}</value> <value>#{menuTab_Statements}</value> <value>#{menuTab_Products}</value> <value>#{menuTab_Support}</value> </list-entries> </managed-property>

112

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Menus for Siebel Self-Service Applications Customizing the Menu for Self-Service Applications

</managed-bean> <!-- Menu Tree Model Adapter Ends --> <!-- Menu Model Starts --> <managed-bean> <managed-bean-name>menuModel</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuModelAdapter</managed-beanclass> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>viewIdProperty</property-name> <value>viewId</value> </managed-property> <!-- Passing Menu Tree Model Instances to Create the Menu Model --> <managed-property> <property-name>instance</property-name> <value>#{menuTreeModel.model}</value> </managed-property> </managed-bean> <!-- Menu Model Ends --> </faces-config>

Customizing the Menu for Self-Service Applications


In the standard application, the menu structure is stored in the faces-config-base-menu.xml file. To customize the menu structure, copy, rename, and then edit this file.

To customize the menu 1


Copy the faces-config-base-menu.xml file in the ViewController/public_html/WEB-INF directory, and rename it, for example, faces-config-ABC-menu.xml, where ABC is the name of your company.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

11 3

Customizing Menus for Siebel Self-Service Applications Showing and Hiding Menu Nodes Based on Business Logic

Replace faces-config-base-menu.xml with faces-config-ABC-menu.xml in ViewController/ public_html/web.xml under the context parameter javax.faces.CONFIG_FILES: <context-param> <param-name>javax.faces.CONFIG_FILES</param-name> <param-value>...,/WEB-INF/faces-config-ABC-menu.xml,...</param-value> </context-param>

Open faces-config-ABC-menu.xml in a text editor, and make the necessary changes to create your new menu structure. For the available properties of each menu node, see Table 10 on page 100. For an example of customizing the menu, see Customizing the Menu Model to Add the Survey Page on page 96.

Showing and Hiding Menu Nodes Based on Business Logic


The condition managed property in faces-config-base-menu.xml for a menu node can be set to ManagedBean.Method to show or hide the node based on business logic. In the following example, the managed bean with the business logic for showing and hiding the nodes is controlBean, and the method invoked for getting the rendered property is isNodeShown(). This method returns a Boolean value and does not take any parameters. Set the managed bean with the business logic to request scope. For example: <managed-property> <property-name>condition</property-name> <value>controlBean.isNodeShown</value> </managed-property> Set the condition property only for nodes that are controlled by business logic. If this property is set, it is checked in the isRendered() API of the menu-node managed bean class (MenuItem.java) after checking the configuration parameters and permissions associated with the bean if they are set.

Using the Condition Property to Hide Detail Nodes in List-Detail Pages


In a typical application: The Orders node shows the list of orders based on a search The Order Details node shows the detail of the order selected in the Orders node The Line Details node shows the details of the line selected in the Order Details node

114

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Menus for Siebel Self-Service Applications Using the Condition Property to Hide Detail Nodes in List-Detail Pages

If there are no results shown in the Orders node (a search returns no rows) the Order Details and Line Details nodes must not be shown. The condition property is used to accomplish this result. The following example shows the sample code for the Orders, Order Details, and Line Details nodes in faces-config-base-menu.xml: <managed-bean> <managed-bean-name>m3_OrderStatus_Orders</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>Orders</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/faces/ss/base/order/Orders.jspx</value> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>m3_OrderStatus_OrderDetails</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>Order Details</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/faces/ss/base/order/OrderDetails.jspx</value> </managed-property> <managed-property> <property-name>condition</property-name>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

11 5

Customizing Menus for Siebel Self-Service Applications Using the Condition Property to Hide Detail Nodes in List-Detail Pages

<value>orderBean.isOrderDetailsShown</value> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>m3_OrderStatus_LineDetails</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>Line Details</value> </managed-property> <managed-property> <property-name>fileName</property-name> <value>/faces/ss/base/order/LineDetails.jspx</value> </managed-property> <managed-property> <property-name>condition</property-name> <value>orderBean.isLineDetailsShown</value> </managed-property> </managed-bean> NOTE: The condition managed property is not set for the Orders node, because it does not depend on the business logic. Only the Order Details and Line Details nodes are hidden if there are no records under the Orders node. The Java code for orderBean will be similar to the following example: public class OrderBean { public OrderBean() { } boolean lineDetailsNode = false; boolean orderDetailsNode = false;

public void setLineDetailsShown(boolean lineDetailsShown) {

116

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing Menus for Siebel Self-Service Applications Using the Condition Property to Hide Detail Nodes in List-Detail Pages

this.lineDetailsShown = lineDetailsShown; } public boolean isLineDetailsShown() { // Check whether one or more results are in the View Object. If yes return true; else return false. HttpServletRequest httpRequest = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(); BindingContext ctx = DCUtil.getBindingContext(httpRequest); DCDataControl dc = ctx.findDataControl("SessionAMDataControl"); SessionAMImpl sessionAM = (SessionAMImpl) dc.getDataProvider(); OrderAMImpl ordersAM = (OrderAMImpl)sessionAM.getOrderAM(); ordersVOImpl orderVO = (ordersVOImpl)ordersAM.getordersVO1(); if (orderVO.getFetchedRowCount() != 0) { return true; } else { return false; } } public void setOrderDetailsShown(boolean orderDetailsShown) { this.orderDetailsShown = orderDetailsShown; } public boolean isOrderDetailsShown() { // Check whether one or more results are in the View Object. If yes return true; else return false. HttpServletRequest httpRequest = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(); BindingContext ctx = DCUtil.getBindingContext(httpRequest); DCDataControl dc = ctx.findDataControl("SessionAMDataControl"); SessionAMImpl sessionAM = (SessionAMImpl) dc.getDataProvider(); OrderAMImpl ordersAM = (OrderAMImpl)sessionAM.getOrderAM(); ordersVOImpl orderVO = (ordersVOImpl)ordersAM.getordersVO1();

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

11 7

Customizing Menus for Siebel Self-Service Applications Using the af:goLink Tag for Navigating to Secure and Nonsecure Pages

if (orderVO.getFetchedRowCount() != 0) { return true; } else { return false; } } }

Using the af:goLink Tag for Navigating to Secure and Nonsecure Pages
An application can have both secure (SSL-enabled) and nonsecure (not SSL-enabled) pages. Depending on the page type, a request must be forwarded to either a secure or nonsecure server. To do so, generate the destination for the af:goLink tag by using one of the APIs in Table 11.

Table 11. API

APIs for Generating Page Destinations Destination Page Is SSL Enabled Yes No

sessionBean.secureURL['filename'] sessionBean.nonsecureURL['filename'] Both of these APIs return absolute URLs.

118

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Appearance of Siebel Self-Service Applications

This chapter describes the tasks involved in customizing the overall appearance of Siebel Self-Service Applications. It includes the following topics: About Skins for ADF Faces on page 119 Customizing Self-Service Application Appearance on page 120 Customizing Menu Orientation for Self-Service Applications on page 120

About Skins for ADF Faces


A skin is a global style sheet that determines how an application appears. One skin is used for the entire application. Skins are loaded at run time; no additional coding is needed to render the changes to the skins. By default, Java EE applications whose user interfaces are based on ADF Faces use the Oracle skin, which is defined in the oracle.adf.desktop render kit. Individual components, such as buttons and menu tabs, are defined in the cascading style sheet (CSS) for the Java EE application. These properties are set in the adf-faces-skins.xml file, which is in the ViewController/public_html/WEBINF directory. The following is an example of an adf-faces-skins.xml file: <?xml version="1.0" encoding="ISO-8859-1" ?> <!-- $Header: $ --> <skins xmlns="http://xmlns.oracle.com/adf/view/faces/skin"> <skin> <id>ss.desktop</id> <family>SelfService</family> <render-kit-id>oracle.adf.desktop</render-kit-id> <style-sheet-name>/ss/skin/ss.css</style-sheet-name> </skin> </skins>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

11 9

Customizing the Appearance of Siebel Self-Service Applications Customizing SelfService Application Appearance

Customizing Self-Service Application Appearance


The CSS for Siebel Self-Service Applications, ss.css, is in the ViewController/public_html/ss/skin directory. You can copy, rename, and customize the style sheet, as well as the image files to which it refers. For a complete list of selectors that can be used in a .css file to provides skins for ADF Faces components, see Selectors for Skinning ADF Faces Components on Oracle Technology Network. CAUTION: Do not rename adf-faces-skins.xml. Its name must remain constant for Siebel SelfService Applications to work.

To customize the appearance of Siebel Self-Service Applications 1 2 3 4 5 6


Copy the ss.css file and rename it, for example, ABC_skin.css, where ABC is the name of your company. Copy the contents of the ViewController/public_html/ss/skin/img directory into a new directory, for example, /skin/ABC_image. Make changes to the image files in the ABC_image directory. Open ABC_skin.css in a text editor, and update the references to the image files. Make other changes, such as background colors, in ABC_skin.css. Open adf-faces-skins.xml in a text editor, and edit the style-sheet-name tag to point to ABC_skin.css.

Customizing Menu Orientation for SelfService Applications


In Siebel Self-Service Applications, menus can be laid out vertically or horizontally for the selected skins. This is controlled by the faces-config-base-skin-properties.xml file in the ViewController/ public_html/WEB-INF directory. Menus are rendered either horizontally in page headers or vertically in the left facets of page central content areas depending on the values set in this file. The following is an example of faces-config-base-skin-properties.xml: <?xml version="1.0" encoding="windows-1252"?> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> <faces-config xmlns="http://java.sun.com/JSF/Configuration"> <managed-bean> <managed-bean-name>SelfService</managed-bean-name>

120

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Appearance of Siebel Self-Service Applications Customizing Menu Orientation for Self-Service Applications

<managed-bean-class>oracle.apps.ss.base.view.util.SkinProperties</managed-beanclass> <managed-bean-scope>application</managed-bean-scope> <managed-property> <property-name>menuLayout</property-name> <value>horizontal</value> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>Sample</managed-bean-name> <managed-bean-class>oracle.apps.ss.base.view.util.SkinProperties</managed-beanclass> <managed-bean-scope>application</managed-bean-scope> <managed-property> <property-name>menuLayout</property-name> <value>vertical</value> </managed-property> </managed-bean> </faces-config> You can copy, rename, and customize the faces-config-base-skin-properties.xml file to determine the orientation of menus in your applications.

To customize menu layout for Self-Service applications 1 2


Copy the faces-config-base-skin-properties.xml file and rename it, for example, faces-configABC-skin-properties.xml, where ABC is the name of your company. Replace faces-config-base-skin-properties.xml with faces-config-ABC-skin-properties.xml in ViewController/public_html/web.xml under the context parameter javax.faces.CONFIG_FILES: <context-param> <param-name>javax.faces.CONFIG_FILES</param-name> <param-value>...,/WEB-INF/faces-config-ABC-skin-properties.xml,...</paramvalue> </context-param>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

12 1

Customizing the Appearance of Siebel Self-Service Applications Customizing Menu Orientation for Self-Service Applications

3 4 5

Open faces-config-ABC-skin-properties.xml in a text editor. Create a managed bean with the same name as the skin family defined in the adf-faces-skins.xml file. Set the value of the menuLayout property to either horizontal or vertical, depending on how you want the menus in the application to appear.

122

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications

This chapter describes the tasks involved in customizing the Model layer of Siebel Self-Service Applications. It includes the following topics: About the Java Object Cache on page 123 Configuring the Java Object Cache on page 125 Creating Java Object Cache Loader Classes on page 126 About ADF Business Components on page 130 Optimizing ADF Business Component Performance on page 131 Process of Creating New ADF Business Components from Siebel Web Services on page 132 Process of Extending ADF Business Components on page 161 Configuring Failover on the SessionAM Application Module on page 169 About ADF Data Control on page 169 About ADF Binding on page 171 Binding a View Object to a User Interface Page on page 171

About the Java Object Cache


The Java Object Cache is a distributed cache of Java objects that allows Java applications to share objects across requests and users, and coordinates the life cycle of the objects across processes. The Java Object Cache manages objects within a cache region. A cache region defines a namespace within the cache. Each cache region name must be unique from other region names and each object name within a cache region must be unique; the combination of the cache region name and the object name uniquely identifies the object. Multiple objects can have the same name if they are within different regions. All similar data that needs to be cached is placed in a region. For example, permissions are stored in a cache that stores only permissions. Regions and attributes are defined declaratively in the cache configuration file, SelfServiceCacheRegion.xml, which is in the oracle.apps.ss.base.model.resources directory. This avoids the duplication of code. NOTE: The Java Object Cache is cleared by the template indirection rules page whenever a template rule is created, updated, or deleted. However, if the underlying Siebel data changes, for example, a catalog is updated, you will need to flush the cache. For more information on flushing the cache, see the topic on managing system settings in Siebel E-Commerce Administration Guide. For more information on the Java Object Cache, see the Oracle Application Server portal on Oracle Technology Network.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

12 3

Customizing the Model Layer for Siebel Self-Service Applications About the Java Object Cache

Cache Lifetime and Size


The maximum and minimum lifetimes and sizes of Java Object Cache regions are defined in the cache tag in SelfServiceCacheRegion.xml. These configuration parameters are listed in Table 12.

Table 12. Name

Java Object Cache Configuration Parameters Description Maximum cache lifetime in seconds. Default is 36000 (10 hours). Minimum cache lifetime in seconds. Default is 3600 (1 hour). Maximum cache region size in bytes. Default is 5242880 (5 MB). Minimum cache region size in bytes. Default is 1048576 (1 MB).

MaxTimeToLive MinTimeToLive MaxComponentSize MinComponentSize

Regions do not have these parameters hard-coded. Instead they have user-defined attributes in SelfServiceCacheRegion.xml that reference the configuration parameters: ttl-type. Valid values are high and low, which correspond to MaxTimeToLive and MinTimeToLive, respectively. max-size-type. Valid values are max and min, which correspond to MaxComponentSize and MinComponentSize, respectively.

Default Attributes of a Cache Region


Cache regions have the following default attributes defined in SelfServiceCacheRegion.xml: cache-loader. Specifies the CacheLoader class associated with the object. distribute. Specifies whether the cache is distributed or not.

Declarative Cache File Sample


The following code sample from SelfServiceCacheRegion.xml shows the cache configuration parameters and the cache region for the product catalog for Siebel E-Commerce. In this example, the cache region SS_ECOM_PRODUCTS is set to the maximum lifetime and minimum size: <?xml version="1.0" encoding="UTF-8" ?> <cache xmlns="http://www.javasoft.com/javax/cache" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.oracle.com/javax/cache" MaxTimeToLive="36000" MinTimeToLive="3600"

124

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Configuring the Java Object Cache

MaxComponentSize="5242880" MinComponentSize="1048576" EnablePriming="True"> <region name="SS_ECOM_PRODUCTS"> <attributes> <cache-loader> <classname>oracle.apps.ss.ecom.catalog.ProductLoader</classname> </cache-loader> <flag>distribute</flag> <user-defined> <name>ttl-type</name> <value>low</value> </user-defined> <user-defined> <name>max-size-type</name> <value>max</value> </user-defined> </attributes> </region> </cache>

Configuring the Java Object Cache


You can set the maximum and minimum lifetimes and sizes of Java Object Cache regions in the SelfServiceCacheRegion.xml file. These configuration parameters, listed in Table 12 on page 124, are defined in the cache tag in SelfServiceCacheRegion.xml. You can also set the following attributes for cache regions: Whether a region uses the maximum or minimum lifetime Whether a region uses the maximum or minimum cache size Whether a cache region is distributed Which cache loader class the region uses

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

12 5

Customizing the Model Layer for Siebel Self-Service Applications Creating Java Object Cache Loader Classes

To configure the Java Object Cache 1 2


Open SelfServiceCacheRegion.xml in a text editor. Set the following configuration parameters as necessary:

MaxTimeToLive MinTimeToLive MaxComponentSize MinComponentSize

Create and edit new cache regions, setting the following attributes:

cache-loader ttl-type max-size-type distributed flag, if needed

Save your changes.

Creating Java Object Cache Loader Classes


The Java Object Cache has two mechanisms for loading an object into itself: Putting the object into the cache directly by using the oracle.apps.ss.common.CacheManager.put() method Implementing a CacheLoader object

In most cases, implementing a CacheLoader object is the preferred method. With a cache loader, the Java Object Cache automatically determines if an object needs to be loaded into the cache when the object is requested. The Java Object Cache coordinates the load if multiple users request the object at the same time. If an object is not in the cache, then the CacheLoader.load() method is executed. When the load method returns the object, the Java Object Cache inserts that returned object into itself. To create a Java Object Cache loader class, you must extend the CacheLoader class, as in the following example, which shows the LovCacheLoader class: package oracle.apps.ss.base.model.util.cache; import java.util.HashMap; import java.util.Locale; import java.util.logging.Logger; import oracle.apps.ss.base.model.util.ServerUtil; import oracle.apps.ss.base.model.util.lov.proxy.EAILOVPortClient;

126

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Creating Java Object Cache Loader Classes

import oracle.apps.ss.base.model.util.lov.proxy.types.com.siebel .xml.listquery.ListQuery; import oracle.apps.ss.base.model.util.lov.proxy.types.com.siebel .xml.listquery.ListsQuery; import oracle.apps.ss.base.model.util.lov.proxy.types.com.siebel .xml.listresult.ListResult; import oracle.apps.ss.base.model.util.lov.proxy.types.com.siebel .xml.listresult.ListValueResult; import oracle.apps.ss.base.model.util.lov.proxy.types.com.siebel .xml.listresult.ListValuesResult; import oracle.apps.ss.base.model.util.lov.proxy.types.com.siebel .xml.listresult.ListsResult; import oracle.ias.cache.CacheLoader;

/** This is the loader implementation of the LOVCache. The load method of CacheLoader class is overridden in this class. The load method is invoked with LOV Type as key when a cache miss happens for that key.An instance of this class is registered as loader for LOV cache during creation of LOV cache region by static initialization of CacheManager. */ public class LovCacheLoader extends CacheLoader { static final java.util.logging.Logger log = Logger.getLogger("oracle.apps.ss.base.model.util.cache.LovCacheLoader"); // Default constructor public LovCacheLoader() { } /** This method overloads the load method of the CacheLoader. The EAILOVWSProxy calls to get the data from the data source are made here. * @param handle This refers to the cache region name. * @param args This is the Lov Key that contains the LovType and Language. */ public Object load(Object handle, Object args) { LovCacheKey lovKey = (LovCacheKey)getName(handle); String lovLanguage = lovKey.getLanguage(); String lovType = lovKey.getLovType(); Boolean obj = false; try { EAILOVPortClient myPort = new EAILOVPortClient();

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

12 7

Customizing the Model Layer for Siebel Self-Service Applications Creating Java Object Cache Loader Classes

myPort.setEndpoint(ServerUtil.getEndPointURL()); ListsQuery listsQuery = new ListsQuery(); ListQuery[] listQuery = new ListQuery[1]; listQuery[0] = new ListQuery();

listQuery[0].setType(lovType); listQuery[0].setLanguageCode(lovLanguage); listQuery[0].setActive("Y");

listsQuery.setListQuery(listQuery); ListsResult listsResult = myPort.EAILOVGetListOfValues(listsQuery); ListResult[] listResult = listsResult.getListResult();

if (listResult.length > 0) { HashMap<String, String> hashMap = new HashMap<String, String>(); ListValuesResult listValuesResult = listResult[0].getListValuesResult(); ListValueResult[] listValueResult = listValuesResult.getListValueResult();

for (int i = 0; i < listValueResult.length; i++) { hashMap.put(listValueResult[i].getValue(), listValueResult[i].getDisplayValue()); } log.info("Exiting with lov map in session language with size = "+hashMap.size()); return hashMap; } else { log.info("Load cache with Boolean.FALSE because the Web service call returned no records for the combination of LOV type and language"); return obj; } }

128

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Creating Java Object Cache Loader Classes

catch (Exception ex) { log.severe(ex.getMessage()); } // For all WS exceptions, load null return } } For more information on accessing Siebel data using Web services, see Modifying ADF Business Component Code to Access Web Service Data on page 136. null;

Creating a Java Object Cache Loader Class


You must create and compile a new Java file to call the Web service proxy to load the object from the Siebel back end.

To create a Java Object Cache loader class 1


Create a new file called ObjectCacheLoader.java, where ObjectCacheLoader is the classname parameter of the class-loader attribute for the cache region you added to SelfServiceCacheRegion.xml in Configuring the Java Object Cache on page 125. Edit ObjectCacheLoader.java as in the following example: package oracle.apps.ss.<module>.<submodule>.cache; public class ObjectCacheLoader extends CacheLoader { public ObjectCacheLoader() { } public Object load(Object handle, Object args) throws CacheException {

Object object = null;


try { // Call the Web service proxy to load Object from the Siebel back end. // Parameter args contain the key to the object. // assign object = <loaded Object> }

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

12 9

Customizing the Model Layer for Siebel Self-Service Applications About ADF Business Components

// Log and handle exceptions catch (Exception ex) { } // Return null for Web service exceptions return null; } }

Save and compile ObjectCacheLoader.java.

About ADF Business Components


Oracle ADF Business Components simplify the development and customization of Java EE applications by providing a set of software building blocks that save development time by making many of the most typical development task declarative. They cooperate to manage all of the common facilities required to: Author and test business logic in components that automatically integrate with databases Reuse business logic through multiple SQL-based views of data, supporting different application tasks Access and update views Customize application functionality in layers without requiring modification of the delivered application

By reducing the coding and testing work related to common application plumbing, ADF Business Components let developers focus on implementing business solutions. The key ADF Business Component components that are used in Siebel Self-Service Applications are the following: Application module An application module is the transactional component that UI clients use to work with application data. It defines an updatable data model and top-level procedures and functions (called service methods) related to a logical unit of work related to an end-user task. An application module contains one or more view objects. Application modules can be nested within other application modules to access the functionality of the top-level modules. In Siebel Self-Service Applications, all application modules are nested within the SessionAM application module. For more information on SessionAM, see SessionAM Application Module on page 25.

130

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Optimizing ADF Business Component Performance

View object A view object represents a SQL query and simplifies working with its results. You can also use programmatic view objects that are based on Web services. For more information on programmatic view objects, see Creating a Programmatic View Object on page 133. You can link a view object with others to create master-detail hierarchies.

The source code for all ADF Business Component classes in Siebel Self-Service Applications is provided with the applications. For information on working with ADF Business Components, see Oracle Application Development Framework Developers Guide For Forms/4GL Developers on Oracle Technology Network.

Optimizing ADF Business Component Performance


You can improve performance by not instantiating ADF Business Component components until they are needed. This is called lazy component load. It can be configured in either of two places: During deployment to the Oracle Application Server In Oracle JDeveloper

NOTE: Lazy component load is recommended because all ADF Business Components in Siebel SelfService Applications are nested within the SessionAM application module and would therefore all be loaded at once if lazy component load was not configured.

Configuring Lazy Component Load During Deployment


You configure lazy component load during deployment to the Oracle Application Server by using the Edit Properties dialog.

To configure lazy component load during deployment 1 2


Navigate to Deployment Settings, Edit Deployment Plan, and then the Edit Properties page. In the Name field enter: jbo.load.components.lazily

In the Value field enter: true

Click Continue.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

13 1

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

Configuring Lazy Component Load in Oracle JDeveloper


You configure lazy component load in Oracle JDeveloper by using the Run/Debug dialog under Project Properties.

To configure lazy component load using Oracle JDeveloper 1 2 3


In Oracle JDeveloper, right-click the ViewController project, and then choose Project Properties. In the Project Properties window, click Run/Debug. The Run/Debug dialog appears. Under Run Configurations, click Edit. The Launch Setting dialog appears.

In the Java Options field, add the following parameter, separating it from other parameters by a space: -Djbo.load.components.lazily=true

5 6

Click OK in the Launch Settings dialog. Click OK in the Run/Debug dialog.

Process of Creating New ADF Business Components from Siebel Web Services
You perform the following tasks to create an ADF Business Component from a Siebel Web service:

1 2 3 4

Creating a Web Service Client Proxy on page 132 Creating a Programmatic View Object on page 133 Creating an Application Module on page 134 Modifying ADF Business Component Code to Access Web Service Data on page 136

The Asset Management sample files provided with Siebel Self-Service Applications are used as examples in many of the procedures.

Creating a Web Service Client Proxy


You create a Web service client proxy in Oracle JDeveloper from a Web Services Description Language (WSDL) file that was generated in Siebel Tools or in the Siebel Business Application. The proxy includes the Web service port client and a Java class for each input and output operation in the WSDL. You must also attach the Siebel Web service handler class, SiebelWSHandler, to the new proxy. This task is a step in Process of Creating New ADF Business Components from Siebel Web Services on page 132.

132

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

For information on creating WSDL files from Siebel Web services, see Integration Platform Technologies: Siebel Enterprise Application Integration.

To create a Web service client proxy 1 2 3


Copy the WSDL file to the directory where you will create the ADF Business Component, for example, Model/src/oracle/apps/ss/base/model/sample. In the Applications Navigator in Oracle JDeveloper, right-click the WSDL file and choose Generate Web Service Proxy. On the Port Endpoints page, select Run against a service deployed to an external server, and then click OK. The new Web service client proxy is created under Model/Application Sources/model.proxy.

Right-click the new proxy, and then choose Edit Handlers and Custom Mappings. The Edit Handlers and Custom Mappings dialog appears.

5 6 7

On the Edit Handlers tab, select the proxy under Port. Click Add. The Handler Details dialog appears. Browse for the following handler class: oracle.apps.ss.base.model.security.SiebelWSHandler

8 9

Name the handler SiebelWSHandler, and then click OK. Click OK to close the Edit Handlers and Custom Mappings dialog.

NOTE: If you modify the WSDL later, you must re-create the proxy.

Creating a Programmatic View Object


In Siebel Self-Service Applications, view objects are used as wrappers around Siebel business objects. Validation of business data takes place in the Siebel back end. Create, read, update, and delete (CRUD) database operations happen through Siebel Web service API calls. The Web service calls are made by the view objects. The view objects are not based on SQL queries; instead they are populated programmatically by retrieving data using Web service API calls. This task is a step in Process of Creating New ADF Business Components from Siebel Web Services on page 132.

To create a programmatic view object 1


In Oracle JDeveloper, right-click the Model project and choose New.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

13 3

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

In the New Gallery, choose Business Tier, ADF Business Components, and then View Object. The Create View Object wizard appears.

3 4

On the Welcome page, click Next. On the Name page:

Complete the following fields: Name Package Value oracle.apps.ss.base.model.<component>.<subcomponent> For example: oracle.apps.ss.base.model.sample.model Name View object name, for example: SampleViewObj

b c 5

Select Rows Populated Programmatically, not Based on a Query. Click Next.

On the Attributes page, click New one or more times to define the view object attributes your programmatic view object requires. For example, the asset management sample view object has the following attributes:

AssetID ProductName AssetStatus

6 7

On the Attribute Settings page, make any necessary adjustments to the settings for the attributes you defined. On the Java page, enable a custom view object class to contain your code. Under View Object Class: ViewObjectImpl, select the following check boxes:

Generate Java File Bind Variable Accessors

Click Finish.

The view object is created.

Creating an Application Module


You create an application module to contain the view object. The new application module must be a child of the SessionAM application module. This task is a step in Process of Creating New ADF Business Components from Siebel Web Services on page 132.

134

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

To create an application module 1 2


In Oracle JDeveloper, right-click the Model project and choose New. In the New Gallery, choose Business Tier, ADF Business Components, and then Application Module. The Create Application Module wizard appears.

3 4

On the Welcome page, click Next. On the Name page, complete the following fields, and then click Next: Name Package Value oracle.apps.ss.base.model.<component>.<subcomponent> For example: oracle.apps.ss.base.model.sample.model Name Application module name, for example: SampleAppModule

On the Data Model page:

Select the view object that you created in Creating a Programmatic View Object on page 133, for example SampleViewObj, and then move it to the Data Model pane. A new instance of the view object is created.

b c 6 7 8

(Optional) Use the Instance Name field to rename the view object instance, for example SearchAssetForDisplay. Click Next.

On the Application Modules page, expand the oracle.apps.ss.base.model.security node, select SessionAM, and then move it to the Selected pane. Click Next. On the Java page under Application Module Class: SampleAppModuleImpl, select the Generate Java File(s) check box, and then click Next. On the Finish page, confirm that your choices are correct, and then click Finish.

The application module is created. A data control for the application module is also created and appears in the Data Controls Palette. You can drag and drop a view object from the data control onto a UI page to add the view objects functionality to that UI page (see Binding a View Object to a User Interface Page on page 171).

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

13 5

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

Modifying ADF Business Component Code to Access Web Service Data


After creating the view object and application module for your ADF Business Component, you must add code to access the methods in the Web service client proxy that will populate the view object with data. You perform the following tasks to modify ADF Business Component code:

1 2

Overriding View Object Implementation Class Methods on page 136 Creating the UserData Wrapper Object on page 138

These tasks are part of Process of Creating New ADF Business Components from Siebel Web Services on page 132. The following examples of modifying ADF Business Component code are also provided, along with a list of Java classes in Siebel Self-Service Applications that call Siebel Web Services: Example of Pagination and Sorting on page 139 Example of Query by Example on page 146 Example of Querying Using the Asset Management Sample Files on page 148 Java Classes in Siebel Self-Service Applications That Call Siebel Web Services on page 154

Overriding View Object Implementation Class Methods


Your programmatic view object typically overrides the following methods of the base ViewObjectImpl class to implement its custom strategy for retrieving data: executeQueryForCollection(). This method is called whenever the view object's query needs to be executed (or re-executed), for example: protected void executeQueryForCollection(Object rowset, Object[] params, int noUserParams) { /* Create a <UserData> object that calls the Web service API to retrieve data and maintains the retrieved data. The WHERE clause and sort parameters should be made available to <UserData>, which will be used to build the query. */ setUserDataForCollection(rowset, <UserData>); // Attach the object to the current rowset. super.executeQueryForCollection(rowset, params, noUserParams); } hasNextForCollection(). This method is called to support the hasNext() method on the row set iterator for a row set created from this view object. Your implementation returns true if you have not yet exhausted the rows to retrieve from your programmatic data source. For example: /* Retrieve the <UserData> object attached to the current rowset. Use the object to determine whether there is more data to retrieve. If there is no more data to retrieve, then call setFetchCompleteForCollection(rowset, true). */

136

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

protected boolean hasNextForCollection(Object rowset) { if (((UserData)getUserDataForCollection(rowset)).hasNext()) { return true; } else { setFetchCompleteForCollection(rowset, true); return false; } } create(). This method is called when the view object instance is created and can be used to initialize any state required by the programmatic view object. At a minimum, this overridden method will contain the following lines to make sure that the programmatic view object has no trace of a SQL query related to it: protected void create() { super.create(); getViewDef().setQuery(null); getViewDef().setSelectClause(null); setQuery(null); } getQueryHitCount(). This method is called to support the getEstimatedRowCount() method. Your implementation returns a count, or estimated count, of the number of rows that will be retrieved by the programmatic view object's query. For example: public long getQueryHitCount(ViewRowSetImpl viewRowSet) { return ((UserData)getUserDataForCollection(viewRowSet.getQueryCollection())) .getRecordCount(); } createRowFromResultSet(). This method is called to populate each row of retrieved data. Your implementation will call createNewRowForCollection() to create a new blank row and then populateAttributeForRow() to populate each attribute of data for the row. For example: public ViewRowImpl createRowFromResultSet(Object o, ResultSet rs) { ViewRowImpl tRow = createNewRowForCollection(o); ContactData cd = ((UserData)getUserDataForCollection(o)).getNextContact(); populateAttributeForRow(tRow, 0, cd.getRowId());

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

13 7

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

populateAttributeForRow(tRow, 1, cd.getLastName()); return tRow; } releaseUserDataForCollection(). Your code can store and retrieve a user data context object with each row set. This method is called to allow you to release any resources that might be associated with a row set that is being closed. For example: protected void releaseUserDataForCollection(Object qc, Object rs) { ResultSet userDataRS = getResultSet(qc); if (userDataRS != null) { try { userDataRS.close(); } catch (SQLException s) { // exception-related code } } super.releaseUserDataForCollection(qc, rs); } Because the view object component can be related to several active row sets at run time, many of these framework methods receive an Object parameter in which the framework passes the collection of rows, as well as the array of bind variable values that might affect which rows are put into the specific collection. You can store a UserData object with each collection of rows so that your custom data source implementation can associate any needed data source context information. The framework provides the setUserDataForCollection() and getUserDataForCollection() methods to get and set this context information for each collection. Each time one of the overridden framework methods is called, you can use the getUserDataForCollection() method to retrieve the correct ResultSet object associated with the collection of rows that the framework populates.

Creating the UserData Wrapper Object


You need a wrapper object, for example, the UserData class, to retrieve and manage external data. The UserData object does the following: Constructs the query for Web service API calls. The query parameter should be a QueryType object set on each field to be retrieved. The following values can be set in QueryType:

set_value. Sets query parameters with * as the wildcard, for example:

138

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

LIKE B*

setSortorder. ASC or DESC. setSortsequence. Indicates column order. Can have positive integer values (1, 2, 3, ...).

The query should contain the following pagination parameters:

pagesize. The number of records to be returned for a component. The default is 10. NOTE: The MaximumPageSize server parameter controls the maximum page size. If the pagesize attribute is greater than the maximum page size defined in the server parameter, an error occurs. The Siebel business component also contains a maxCursorFetchSize parameter. If you try to query beyond this size, the following error will be thrown: There were more rows than could be returned. Please refine your query to bring back fewer rows (SBL-DAT-00500). The workaround is to query in forwardOnly mode.

startrownum. The starting point for record retrieval. The 0-based index of the record within the record set. recordcountneeded. True or false. When set to true, indicates that a record count is needed for this component. UserData sets the value to true because recordcount is used in the view objects get QueryHitCount() method implementation. recordcount. A value set by the EAI UI Data Adapter business service, indicating the approximate record count provided by the object manager based on the search specification.

Executes the query and buffers the rows. Exposes a method to retrieve the next row from the buffer. If the buffer is completely read, refills it with fresh rows by placing another Web service call. This is used by the view objects createRowFromResultSet() method implementation. Exposes a method to determine whether there are more rows to return to the view object. This is used by the view objects hasNextForCollection() method implementation. Exposes a method to determine the estimated row count. This should return the recordcount value set by the EAI UI Data Adapter business service. The returned value is used by the view objects get QueryHitCount() method implementation.

Example of Pagination and Sorting


The process of implementing programmatic view objects can be explained using an example. Consider the case of an Oracle ADF table in the View layer that displays the first and last names of all contacts. The table is bound to the ContactVO view object.

ContactVOImpl Class In this example, the overridden methods in ContactVOImpl.java are the following: protected void executeQueryForCollection(Object rowset, Object[] params, int noUserParams) {

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

13 9

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

setUserDataForCollection(rowset, new UserData(getOrderByClause())); super.executeQueryForCollection(rowset, params, noUserParams); } protected boolean hasNextForCollection(Object rowset) { if (((UserData)getUserDataForCollection(rowset)).hasNext()) { return true; } else { setFetchCompleteForCollection(rowset, true); return false; } } protected void create() { super.create(); getViewDef().setQuery(null); getViewDef().setSelectClause(null); setQuery(null); } public long getQueryHitCount(ViewRowSetImpl viewRowSet) { return ((UserData)getUserDataForCollection(viewRowSet.getQueryCollection())) .getRecordCount(); } public ViewRowImpl createRowFromResultSet(Object o, ResultSet rs){ ViewRowImpl tRow = createNewRowForCollection(o); ContactData cd = ((UserData)getUserDataForCollection(o)).getNextContact(); populateAttributeForRow(tRow, 0, cd.getRowId()); populateAttributeForRow(tRow, 1, cd.getLastName()); return tRow; }

140

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

UserData Class In this example, the UserData object contains the following code: package model; import java.math.BigDecimal; import java.math.BigInteger; import model.types.com.siebel.xml.wc_contacts_io.data.ContactData; import model.types.com.siebel.xml.wc_contacts_io.data.ListOfWc_Contacts_IoData; import model.types.com.siebel.xml.wc_contacts_io.query.ContactQuery; import model.types.com.siebel.xml.wc_contacts_io.query.ListOfWc_Contacts_IoQuery; import model.types.com.siebel.xml.wc_contacts_io.query.QueryType;

public class UserData { private ListOfWc_Contacts_IoQuery query; private model.WC_Contacts_BSClient myPort = null; private ContactData [] cd; private int fetchedSize; private int recordCount; private int resultSize; private int resultIndex; private String orderClause;

public UserData(String orderByClause) { setOrderClause(orderByClause); createQuery(); getNextResultSet(); } public void setFetchedSize(int size) { this.fetchedSize = size; } public int getFetchedSize() {

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

14 1

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

return this.fetchedSize; } public int getRecordCount() { return this.recordCount; } public void setRecordCount(int count) { this.recordCount = count; } public void setResultSize(int resultSize) { this.resultSize = resultSize; } public int getResultSize() { return resultSize; } public void setResultIndex(int resultIndex) { this.resultIndex = resultIndex; } public int getResultIndex() { return resultIndex; } public void setOrderClause(String orderClause) { this.orderClause = orderClause; } public String getOrderClause() { return orderClause; } public void getNextResultSet() { setResultIndex(0); query.setStartrownum(new BigInteger(Integer.toString(getFetchedSize()))); setSortCriteria();

142

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

// Get the query results. try { ListOfWc_Contacts_IoData contact_result = myPort.WC_Contacts_BSQueryPage("", query, "LIC", "All");

setRecordCount(contact_result.getRecordcount().intValue()); cd = contact_result.getContact();

setFetchedSize(getFetchedSize()+cd.length); setResultSize(cd.length); } catch (Exception e) { } } public boolean hasNext() { if ((fetchedSize - resultSize + resultIndex) < recordCount) { return true; } return false; } public ContactData getNextContact() { // The result index is 0-based and the result size is 1-based. int ri = getResultIndex(); if(query==null || ri == getResultSize()) { getNextResultSet(); ri = getResultIndex(); } setResultIndex(ri+1); return cd[ri]; } // Clear any sort criteria set earlier. public void clearSortCriteria() {

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

14 3

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

query.getContact().getRowId().setSortsequence(""); query.getContact().getRowId().setSortorder(""); query.getContact().getLastName().setSortsequence(""); query.getContact().getLastName().setSortorder(""); } /* After setOrderByClause is called in ViewObjectImpl, executeQuery is called, which in turn calls executeQueryForCollection. * Sort criteria are set before viewObjectImpl.executeQueryForCollection is called. * In executeQueryForCollection, a new instance of the UserData object is attached to the rowset using setUserDataForCollection. * The sort parameters are passed to the constructor of UserData, which sets the orderByClause in UserData.orderClause. * The orderByClause has the format "column_name [ASC|DESC]" */ public void setSortCriteria() { String sortColumn = null; String sortOrder = "ASC"; if (getOrderClause() != null && !"".equals(getOrderClause())) { clearSortCriteria(); String [] s = getOrderClause().split(" "); if (s! = null) { for (int i = 0; i < s.length; i++) { if (i == 0) { sortColumn = s[0]; } else { sortOrder = "DESC"; } } } } if ("ROWID".equals(sortColumn )) {

144

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

query.getContact().getRowId().setSortorder(sortOrder); query.getContact().getRowId().setSortsequence("1"); } else if ("LASTNAME".equals(sortColumn)) { query.getContact().getLastName().setSortorder(sortOrder); query.getContact().getLastName().setSortsequence("1"); } } public void createQuery() { try { myPort = new model.WC_Contacts_BSClient(); } catch (Exception e) { } query = new ListOfWc_Contacts_IoQuery(); query.setStartrownum(new BigInteger(Integer.toString(getFetchedSize()))); query.setPagesize(new BigInteger(Integer.toString(100))); ContactQuery cq = new ContactQuery(); QueryType rowidQuery = new QueryType(); rowidQuery.set_value(""); // Empty query type cq.setRowId(rowidQuery); QueryType lastnameQuery = new QueryType(); lastnameQuery.set_value("LIKE 'B*'"); lastnameQuery.setSortorder("ASC"); lastnameQuery.setSortsequence("1"); cq.setLastName(lastnameQuery); query.setContact(cq); query.setRecordcountneeded(true); } }

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

14 5

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

When an end user clicks on table navigation links, if the view rowset already contains the requested rows, the user interface will display them. If the rows have not yet been retrieved, the createRowFromResultSet() method is called, which in turn calls the UserData.getNextContact() method. In UserData, each Web service API call retrieves 100 contact rows and buffers them. As soon as the buffer is completely read, another Web service API call is placed, which retrieves another 100 rows, and so on.

Example of Query by Example


Query by Example (QBE) is a method of providing the sample values for searching. These values are the typical WHERE clause parameters used in a SQL query. The oracle.jbo.ViewCriteria class can be used to set the WHERE clause conditions before calling an execute operation on a view object. The following example illustrates the steps to pass the WHERE clause to the view object, and in turn to the Web service. The advantage of using QBE is that the consumers of the view object can set the WHERE clause conditions and execute the view object. This also prevents code-injection attacks that can happen with search specifications. The following classes are used in the QBE implementation: Application module implementation (UserAMImpl). This class gets the instance of the view object, sets the view criteria on the view object, and executes the query. View object implementation (UserVOImpl). This class uses the executeQueryForCollection method to get the view criteria and pass them to the constructor of the custom data provider class. Custom data provider (UserData). This class gets the ViewCriteria attributes, sets them as QueryType, and builds the request for the Web service.

UserAMImpl Class The following is the sample code for UserAMImpl.java: /** This method indicates the typical setup of WHERE Clause conditions on the VO through ViewCriteria. * Attribute names are the same as VO attribute names. * Only one ViewCriteriaRow is supported. * No comparator operator is used. * The attribute values are retrieved and applied using the equal (=) operator. */ public void setCriterion() { System.out.println("View criteria have been set in UserVO...");

// Get the VO instance.

146

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

UserVOImpl userVO = getUserVO1();

// Set the criteria on ViewCriteriaRow. ViewCriteria vc = userVO.createViewCriteria(); ViewCriteriaRow vcr1 = vc.createViewCriteriaRow();

// Set up attributes. vcr1.setAttribute("Age","6"); vcr1.setAttribute("FirstName","Catherine"); vcr1.setAttribute("LastName", "R*");

// Add the criteria row at location 0 vc.insertElementAt(vcr1,0);

// Apply the criteria to the VO and execute. userVO.applyViewCriteria(vc); userVO.executeQuery();

} UserVOImpl Class The following is the sample code for UserVOImpl.java: /** Override the executeQueryForCollection() method for custom Java data source support. * Pass ViewCriteria to the UserData constructor from the VO. */ protected void executeQueryForCollection(Object rowset, Object params[], int noUserParams) { setUserDataForCollection(rowset, new UserData(getViewCriteria(),getOrderByClause())); super.executeQueryForCollection(rowset, params, noUserParams); }

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

14 7

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

UserData Class The following is the sample code for UserData.java: /* The constructor gets the handle of ViewCriteria through the vc parameter. The constructor can read the attribute values and use them in building the Web service request. */ public UserData(ViewCriteria vc, String sortClause) { ViewCriteriaRow row = (ViewCriteriaRow)vc.getRowAtRangeIndex(0); System.out.println ("Accessing the criteria in the UserData object..."); System.out.println ("VOCriteria rows are found in: " + row.getClass()); Object[] cnames = row.getAttributeNames(); Object[] cvalues = row.getAttributeValues(); for (int i = 0; i < cnames.length; i++) System.out.println("Attribute name: " + cnames[i] + " Value: " + cvalues[i]); } Sample Output The following is the sample output: 08/03/01 18:34:35 View criteria have been set in UserVO... 08/03/01 18:34:35 Accessing the criteria in the UserData object... 08/03/01 18:34:35 VOCriteria rows are found in: class oracle.jbo.ViewCriteriaRow 08/03/01 18:34:35 Attribute name: UserName Value: null 08/03/01 18:34:35 Attribute name: FirstName Value: Catherine 08/03/01 18:34:35 Attribute name: LastName Value: R* 08/03/01 18:34:35 Attribute name: Age Value: 4

Example of Querying Using the Asset Management Sample Files


In this example, assets in the Siebel Database are queried, and certain attributes are read into a view object: asset ID, product name, and asset status. The code that accesses the Siebel Web service data is in the application module implementation class, SampleAppModuleImpl. SampleAppModuleImpl references the SearchAssetForDisplay view object, which is an instance of the SampleViewObj view object. SampleAppModuleImpl also references wrapper objects that are generated by Oracle JDeveloper when the Web service proxy is created. These wrapper objects call Siebel Web service operations.

148

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

The Web services in Siebel Self-Service Applications are based on the EAI UI Data Adapter business service, which supports the pagination parameters described in Creating the UserData Wrapper Object on page 138. For more information on the EAI UI Data Adapter business service, see Integration Platform Technologies: Siebel Enterprise Application Integration.

SampleAppModuleImpl Class SampleAppModuleImpl.java contains the following code: package oracle.apps.ss.base.model.sample; import java.rmi.RemoteException; import java.util.Calendar; import javax.xml.rpc.soap.SOAPFaultException; import javax.xml.soap.SOAPException; import oracle.apps.ss.base.model.bc4j.SSApplicationModuleImpl; import oracle.apps.ss.base.model.sample.common.SampleAppModule; import oracle.apps.ss.base.model.sample.model.AssetManagementPortClient; import oracle.apps.ss.base.model.sample.model.types.com.siebel.xml .asset_management_io.data.AssetMgmtAssetData; import oracle.apps.ss.base.model.sample.model.types.com.siebel.xml .asset_management_io.data.ListOfAsset_Management_IoData; import oracle.apps.ss.base.model.sample.model.types.com.siebel.xml .asset_management_io.query.AssetMgmtAssetQuery; import oracle.apps.ss.base.model.sample.model.types.com.siebel.xml .asset_management_io.query.ListOfAsset_Management_IoQuery; import oracle.apps.ss.base.model.sample.model.types.com.siebel.xml .asset_management_io.query.QueryType; import oracle.apps.ss.base.model.util.ServerUtil; import oracle.apps.ss.base.model.util.ValidationException; // --------------------------------------------------------------------// --// --// --File generated by Oracle ADF Business Components Design Time. Custom code may be added to this class. Warning: Do not modify method signatures of generated methods.

// ---------------------------------------------------------------------

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

14 9

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

public class SampleAppModuleImpl extends SSApplicationModuleImpl implements SampleAppModule { /* Default constructor (do not remove) */ public SampleAppModuleImpl() { } /* Sample main for debugging Business Components code using the tester */ public static void main(String[] args) { launchTester("oracle.apps.ss.base.model.sample", /* package name */ "SampleAppModuleLocal" /* Configuration Name */); } /* Container's getter for SearchAssetForDisplay */ public SampleViewObjImpl getSearchAssetForDisplay() { return (SampleViewObjImpl)findViewObject("SearchAssetForDisplay"); } public void searchAssetForDisplay() { try { System.out.println("Calling searchAssetForDisplay without parameters"); AssetManagementPortClient proxy = new AssetManagementPortClient(); proxy.setEndpoint(ServerUtil.getEndPointURL());

/* Query for assets. */ ListOfAsset_Management_IoQuery listOfAssetQuery = getDefaultListOfAssetQuery(); AssetMgmtAssetQuery assetMgmtAssetHeader = new AssetMgmtAssetQuery(); QueryType loadAssetQueryType = new QueryType(); loadAssetQueryType.set_value(""); assetMgmtAssetHeader.setAssetId(loadAssetQueryType); assetMgmtAssetHeader.setProductName(loadAssetQueryType); assetMgmtAssetHeader.setStatus(loadAssetQueryType); listOfAssetQuery.setAssetMgmtAsset(assetMgmtAssetHeader);

150

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

/* Load the query results. */ ListOfAsset_Management_IoData searchAssetData = proxy.assetManagementQueryPage(null, listOfAssetQuery, "LIC", "All"); System.out.println("RecordCount: " + searchAssetData.getRecordcount()); System.out.println("searchAssetData" + searchAssetData); fillAssetVO(searchAssetData,"AssetListDisplay"); } catch(SOAPFaultException e) { throw new ValidationException(e); } catch(RemoteException e) { throw new ValidationException(e); } catch(SOAPException e) { throw new ValidationException(e); } catch(Exception e) { throw new ValidationException(e); } }

/* Clear the query. */ private ListOfAsset_Management_IoQuery getDefaultListOfAssetQuery() { ListOfAsset_Management_IoQuery listOfAssetQuery = new ListOfAsset_Management_IoQuery(); AssetMgmtAssetQuery assetMgmtAssetHeader = new AssetMgmtAssetQuery(); assetMgmtAssetHeader.setAssetId(EMPTY_QUERY_TYPE); assetMgmtAssetHeader.setIntegrationId(EMPTY_QUERY_TYPE); assetMgmtAssetHeader.setProductId(EMPTY_QUERY_TYPE); assetMgmtAssetHeader.setProductName(EMPTY_QUERY_TYPE); assetMgmtAssetHeader.setProductDescription(EMPTY_QUERY_TYPE);

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

15 1

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

assetMgmtAssetHeader.setProductPartNumber(EMPTY_QUERY_TYPE); assetMgmtAssetHeader.setBillingAccountId(EMPTY_QUERY_TYPE); assetMgmtAssetHeader.setServiceAccountId(EMPTY_QUERY_TYPE); assetMgmtAssetHeader.setStatus(EMPTY_QUERY_TYPE); assetMgmtAssetHeader.setInstallDate(EMPTY_QUERY_TYPE); assetMgmtAssetHeader.setParentAssetId(EMPTY_QUERY_TYPE); listOfAssetQuery.setAssetMgmtAsset(assetMgmtAssetHeader); return listOfAssetQuery; } private static final QueryType EMPTY_QUERY_TYPE = new QueryType();

/* Populate the view object */ public void fillAssetVO(ListOfAsset_Management_IoData assetOutputData, String populateVO) { SampleViewObjImpl assetVO = null; if(assetOutputData != null) { AssetMgmtAssetData[] assetArr = assetOutputData.getAssetMgmtAsset(); if(assetArr != null) { System.out.println("Number of assets retrieved: " + assetArr.length); assetVO = getSearchAssetForDisplay(); assetVO.clearCache(); assetVO.first();

for (int i=0;i<assetArr.length;i++) { SampleViewObjRowImpl assetVORow = (SampleViewObjRowImpl) assetVO.createRow(); assetVORow.setAssetId(assetArr[i].getAssetId()); assetVORow.setProductName(assetArr[i].getProductName()); assetVORow.setAssetStatus(assetArr[i].getStatus());

Calendar calendar = assetArr[i].getInstallDate();

152

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

String month = ""; String dayOfMonth = ""; String year = ""; if (calendar != null) { month = (calendar.get(Calendar.MONTH)>8)?"" + (calendar.get(Calendar.MONTH)+1):"0" + (calendar.get(Calendar.MONTH)+1); dayOfMonth = (calendar.get(Calendar.DAY_OF_MONTH)>9)?"" + calendar.get(Calendar.DAY_OF_MONTH):"0" + calendar.get(Calendar.DAY_OF_MONTH); year = "" + calendar.get(Calendar.YEAR); } assetVO.insertRow(assetVORow); } } } } }

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

15 3

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

Java Classes in Siebel Self-Service Applications That Call Siebel Web Services
Table 13 lists the Java classes that make Web service calls and the purposes of those calls.

Table 13.

Java Classes in Siebel Self-Service Applications That Call Siebel Web Services Comments The view object for template rules uses the TemplateRuleId and TemplateRule caches to show data on the screen. Hence there are no Web service calls from view object or user data classes. Filename (.java) TemplateAMImpl Description Application module implementation. Transactions: updating, deleting, or inserting a template. Cache loader for template ID cache. Querying and storing template rules. Cache loader for template rule cache. Used when there is a cache miss and a specific template rule is to be loaded. Application module implementation. Transactions: updating, deleting, creating, and saving sites. Data class implementation. For all CRUD operations, the Web service call is made from here. Cache loader for getting sire attributes. Querying for Site Selection and Site Administration pages. Cache loader for getting all site codes. Querying for Site Selection and Site Administration pages. Cache Loader for getting the site name for the specific language. Querying for Site Selection and Site Admin pages.

Application Module Template

TemplateRuleIdCache Loader TemplateRuleCache Loader

Site

The caches used for the Site Selection page are SiteAttribute, SiteCode, and SiteLang.

SiteAMImpl

SiteData

SiteAttributeCache Loader

SiteCodeCacheLoader

SiteLangCacheLoader

154

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

Table 13.

Java Classes in Siebel Self-Service Applications That Call Siebel Web Services Comments The cache used for the list of values (LOV) pop-up window and the Utility APIs is the LovCache. Filename (.java) UtilAMImpl Description Application module implementation. Transactions: querying for LOV values. Cache loader for getting the LOV code and its values for the specific language. Querying for the LOV popup window and for the Utility LOV APIs. Data Class implementation. The service call for querying the LOV values is made from here. Application module implementation. Transactions: querying for time zone values Data class implementation. The Web service call for querying time zone values is made from here. Cache loader for time zone values. Cache loader for currency values.

Application Module Utility - LOV

LovCacheLoader

LovData

Utility TimeZone

The cache used to get time zone values is the TimeZoneCache.

UtilAMImpl

TimeZoneData

TimeZoneCacheLoader Utility Currency The cache used to get currency values is the CurrencyCache. CurrencyCacheLoader

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

15 5

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

Table 13.

Java Classes in Siebel Self-Service Applications That Call Siebel Web Services Comments Root application module for managing users. Filename (.java) PartyManager Description This is the main class for the User Management application module. Used for Data Manipulation Language (DML) operations on all entities related to accounts, contacts, and users. Methods for executing Web service calls related to: Registration and forgotten password functionality Creating, deleting, and updating contacts Creating, deleting, and updating accounts and personal addresses Making existing contacts users Updating passwords and security questions Updating personal details

Application Module User Management

AccountManager

All Web service calls related to account management are executed here. Has two methods: executeDML and executeQuery. All Web service calls related to contact management are executed here. Has two methods: executeDML and executeQuery.

ContactManager

156

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

Table 13.

Java Classes in Siebel Self-Service Applications That Call Siebel Web Services Comments Self-Service user registration. Filename (.java) RegistrationAMImpl Description Application module implementation. Methods for registering different types of users and for forgotten password functionality. These methods prepare the data to be used for Web service calls and call PartyManager APIs. AccountDetailsVOImpl View object implementation. Web service calls for querying account details. These details are used for verification purposes in secondary user access flows. Application module implementation. Methods for querying, updating, and deleting personal data and addresses. View object implementation. Web service calls for querying personal profile details. Data class implementation for ContactAddressVO. Web service calls for querying contact addresses.

Application Module User Management Registration

User Management Personal Profile

Personal data management.

PersonAMImpl

ContactDetailsVOImpl

ContactAddressUser Data

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

15 7

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

Table 13.

Java Classes in Siebel Self-Service Applications That Call Siebel Web Services Comments Company and account data management. Filename (.java) OrganizationAMImpl Description Application module implementation. Methods for querying, updating, and deleting contact and account data, contact and account addresses. Data class implementation for ContactVO. Web service calls for querying contacts. Data class implementation for AccountVO. Web service calls for querying accounts. Data class implementation for AccountAddressVO. Web service calls for querying account addresses. Web service calls for querying user responsibilities. Data class implementation for ContactAddressVO. Web service calls for querying contact addresses. View object implementation. Web service calls for querying account details. Data class implementation for ContactAccountVO. Web service calls for querying accounts related to a contact.

Application Module User Management Organization

ContactUserData

AccountUserData

AccountAddressUser Data

UsertypesLoader

ContactAddressUser Data

AccountDetailsVOImpl

ContactAccountUser Data

158

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

Table 13.

Java Classes in Siebel Self-Service Applications That Call Siebel Web Services Comments Approvals related to registration and to existing contacts made to Self-Service users. Filename (.java) ApprovalInboxAMImpl Description Application module implementation. Methods for: Approving and rejecting approval requests for registration Querying inbox items Sending notification mails Showing contact details for which approvals are requested

Application Module User Management Approvals

ContactInboxItems UserData

Data class implementation for ContactInboxItemVO. Web service calls for querying inbox items for a contact. Static methods that abstract the Web service proxy invocations on the Siebel Inbox.

SiebelInboxManager

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

15 9

Customizing the Model Layer for Siebel Self-Service Applications Process of Creating New ADF Business Components from Siebel Web Services

Table 13.

Java Classes in Siebel Self-Service Applications That Call Siebel Web Services Comments The Web service calls to fetch order data are made through the Data classes, which in turn call the OrderManager class. Filename (.java) OrderAMImpl Description Application module implementation. Transactions: querying and updating orders. For all query and update operations, the Web service call is made from here. Data class implementation. Querying orders, the Web service call for which is routed through this class to the OrderManager class. Data class implementation. Querying details of an order details, the Web service call for which is routed through this class to the OrderManager class. Data class implementation. Querying line item details of an order, the Web service call for which is routed through this class to the OrderManager class. Data class implementation. Querying of shipment and line item details for an order, the Web service call for which is routed through this class to the OrderManager class.

Application Module Orders

OrderManager

OrderHeaderSummary Data

OrderDetailsData

OrderLinesData

OrderShipmentDetails Data

160

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Extending ADF Business Components

Table 13.

Java Classes in Siebel Self-Service Applications That Call Siebel Web Services Comments The Web service calls to fetch payment data are made through the Data classes, which in turn call the PaymentManager class. Filename (.java) PaymentAMImpl Description Application module implementation. Transactions: querying payment history, querying and updating payment wallet details. For all query and update operations, the Web service call is made from here. Data class implementation. Querying payment history, the Web service call for which is routed through this class to the PaymentManager class. Data class implementation. Querying details of the Payment wallet, the Web service call for which is routed through this class to the PaymentManager class.

Application Module Payments

PaymentManager

PaymentHisUserData

PayWalletUserData

Process of Extending ADF Business Components


If you modify (or create new) Siebel business components, you must also modify the ADF Business Components in Siebel Self-Service Applications that access the Siebel data. You use the following process:

1 2 3 4 5

Adding a Field to a Siebel Business Component on page 162 Adding the Business Component Field to an Integration Object on page 162 Exposing Siebel Data to External Applications on page 163 Re-Creating the Web Service Client Proxy on page 164 Extending ADF Business Components on page 167

In this example, the Favorite Color field is added to a contact record and accessed by Siebel SelfService Applications. For details on modifying Siebel objects, see Configuring Siebel Business Applications. For details on working with integration objects, see Integration Platform Technologies: Siebel Enterprise Application Integration.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

16 1

Customizing the Model Layer for Siebel Self-Service Applications Process of Extending ADF Business Components

Adding a Field to a Siebel Business Component


You add fields to Siebel business components using Siebel Tools. In this example, you add a Favorite Color field to the Contact business component. Data for the field comes from a custom extension column in the S_CONTACT table. For more information on extension columns and extension tables, see Configuring Siebel Business Applications. This task is a step in Process of Extending ADF Business Components on page 161.

To add a new field to a Siebel business component and integration object 1 2 3 4


In Siebel Tools, select the Business Component object. Query for Contact. In the Contact business component, create a new field called Favorite Color. To populate the field with data, add a custom extension column to the S_CONTACT table, and then reference this column in the Favorite Color field. NOTE: You can also use a join to the S_CONTACT_X table that references an ATTRIB_nn column of physical type Varchar, for example, ATTRIB_34. However, using a join to an extension table can lead to slower performance. You would use such a join when your RDBMS doesnt allow extension columns to base tables.

Compile the SRF.

Adding the Business Component Field to an Integration Object


In Siebel Tools, you update the integration object that abstracts the business object to which the business component belongs. Siebel Self-Service Applications use the SS_Account_IO and SS_Contacts_IO integration objects, both of which have a Contact integration component, to retrieve Siebel contact data. In Siebel Business Applications, accounts and contacts are intertwined because the Account and Contact business components are both based on the S_PARTY table and share many fields. This example uses SS_Account_IO. This task is a step in Process of Extending ADF Business Components on page 161.

To add a new field to a Siebel integration object 1 2 3 4 5


In Siebel Tools, select the Integration Object object. Query for SS_Account_IO. Expand the Integration Object object, and then select the Integration Component object. Select the Contact integration component. Expand the Integration Component object, and then select Integration Component Field.

162

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Extending ADF Business Components

6 7 8

Add an integration component field for Favorite Color. Validate and synchronize the SS_Account_IO integration object. Compile the SRF.

Exposing Siebel Data to External Applications


Next, you expose the Siebel data to external applications using the EAI UI Data Adapter business service. The EAI UI Data Adapter business service creates a business service from an integration object, and then creates a Web service for accessing the business service. For details on the EAI UI Data Adapter service and on using the Data Access Service wizard, see Integration Platform Technologies: Siebel Enterprise Application Integration. This task is a step in Process of Extending ADF Business Components on page 161.

To expose the modified Siebel business logic to external applications 1 2


In Siebel Tools, choose New Object from the File menu to display the New Object Wizards dialog box. Click the EAI tab, and then double-click Data Access Service. The Integration Object Page of the Data Access Service wizard appears.

On the Integration Object Page:

a b c d 4 a b c 5

Choose a locked project. Select the Reuse Integration Object radio button. Select SS_Account_IO from the drop-down menu. Click Next.

On the Business Service Page: Name the new business service, for example, SSAccount. NOTE: You cannot use the name of an already existing business service. Select the Deploy Business Service check box. Click Next.

On the UDS Methods Page, select the following check boxes, and then click Next:

QueryPage Execute

On the Web Service Page:

Enter a URL for the Web service, for example: http://myhost/custappsvcs_enu/ start.swe?SWEExtSource=WebService&SWEExtCmd=Execute

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

16 3

Customizing the Model Layer for Siebel Self-Service Applications Process of Extending ADF Business Components

b c 7 a b 8

Save the WSDL file as SSAccount.wsdl. Click Next.

On the Report Page: Under UI Business, choose SelfServiceAccount. Enter a name for the report (export file).

On the Integration Object Builder page, select the Deploy the Integration Object check box, and then click Finish.

The WSDL file is created.

Re-Creating the Web Service Client Proxy


Next, in Oracle JDeveloper you re-create the Web service client proxy that retrieves the Siebel contact data. This task is a step in Process of Extending ADF Business Components on page 161. You must perform the following procedures to re-create the Web service client proxy: Generating the New Web Service Client Proxy on page 164 Replacing the SelfServiceAccount Web Service Client Proxy Classes on page 165

Generating the New Web Service Client Proxy


You generate the new proxy in Oracle JDeveloper from the WSDL file you created in Exposing Siebel Data to External Applications on page 163. During the proxy creation, you attach the Siebel Web service handler and can choose a package name for your proxy.

To generate the new Web service client proxy 1 2 3 4


In the SelfService_ROOT/Model/src/oracle/apps/ss/base/model/um directory, replace SS_Account_BS.wsdl with the WSDL file you created, for example, SSAccount.wsdl. In Oracle JDeveloper, right-click the Model project, and then choose New. In the New Gallery, expand Business Tier, and then choose Web Services. Select Web Service Proxy, and then click OK. The Create Web Service Proxy wizard appears.

5 6

On the Web Service Description page, click Browse, and then navigate to SSAccount.wsdl. Click Next. The model for the WSDL file is built.

7 8

On the Port Endpoints page, select Run against a service deployed to an external server, and then click OK. On the Custom Mappings page, click Next.

164

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Extending ADF Business Components

On the Defined Handlers page:

a b

Click Add. Browse for the following handler class: oracle.apps.ss.base.model.security.SiebelWSHandler

c d a b c

Name the handler SiebelWSHandler, and then click OK. Click Next.

10 On the Default Mapping Options page:


Enter a package name where you want the proxy to reside, such as oracle.apps.ss.base.model.um.ABC.proxy, where ABC is the name of your company. Enter a root package for generated types, such as oracle.apps.ss.base.model.um.ABC.proxy.types. Click Next.

11 On the Support Files page, select the Generate JUnit Test Code check box, and then click Finish.
The proxy source files are generated in Model/Application Sources/oracle.apps.ss/base/ model.um.ABC/proxy.

12 Compile the proxy files.


The proxy class files appear in SelfService_ROOT/Model/classes/oracle/apps/ss/base/model/um/ ABC/proxy.

Replacing the SelfServiceAccount Web Service Client Proxy Classes


Siebel Self-Service Applications use the account Web service client proxy for contact data. The account proxy contains classes for the following Siebel Web services: SelfServiceAccount SelfServiceAccountRootPath SelfServiceAllAccountsList

You must replace the classes for SelfServiceAccount with the new proxy classes you created in Generating the New Web Service Client Proxy on page 164.

To replace the SelfServiceAccount proxy classes 1


Extract SelfService_ROOT/Model/lib/commoncomp-ws-proxies.jar to a temporary folder, for example, /temp/JARs. A directory structure is created in /temp/JARs for the proxies.

Navigate to /temp/JARs/oracle/apps/ss/base/model/um/proxies/account.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

16 5

Customizing the Model Layer for Siebel Self-Service Applications Process of Extending ADF Business Components

Replace the following class files in that directory with the analogous classes from your proxy: Old Proxy Class SelfServiceAccount_PortType SelfServiceAccount_Service SelfServiceAccountClient SelfServiceAccountExecute_Input SelfServiceAccountExecute_Output SelfServiceAccountQueryPage_Input SelfServiceAccountQueryPage_Output New Proxy Class SSAccount_PortType SSAccount_Service SSAccountClient SSAccountExecute_Input SSAccountExecute_Output SSAccountQueryPage_Input SSAccountQueryPage_Output

4 5

Navigate to /temp/JARs/oracle/apps/ss/base/model/um/proxies/account/runtime. Replace the following class files in that directory with the analogous classes from your proxys /runtime subdirectory: Old Proxy Class SelfServiceAccount_Service_Impl SelfServiceAccount_Service_SerializerRegistry12 SelfServiceAccount_Service_SerializerRegistry SelfServiceAccount_Stub SelfServiceAccountExecute_Input_Literal Serializer SelfServiceAccountExecute_Output_Literal Serializer SelfServiceAccountQueryPage_Input_Literal Serializer SelfServiceAccountQueryPage_Output_Literal Serializer New Proxy Class SSAccount_Service_Impl SSAccount_Service_SerializerRegistry12 SSAccount_Service_SerializerRegistry SSAccount_Stub SSAccountExecute_Input_Literal Serializer SSAccountExecute_Output_Literal Serializer SSAccountQueryPage_Input_Literal Serializer SSAccountQueryPage_Output_Literal Serializer

6 7 8

Navigate to /temp/JARs/oracle/apps/ss/base/model/um/proxies/account/types/com/ siebel/selfservice/common. Replace the /account directory with the /account directory from your proxys /types/com/ siebel/selfservice/common subdirectory. Create a Java Archive (JAR) file of the contents of /temp/JARs, and name it commoncomp-wsproxies.jar, using the following command in the command-line interface: jar cvf commoncomp-ws-proxies.jar META-INF/ oracle/

Navigate to SelfService_ROOT/Model/lib.

166

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Process of Extending ADF Business Components

10 Replace commoncomp-ws-proxies.jar with the new JAR file.

Extending ADF Business Components


Finally, you extend ADF Business Component code in Oracle JDeveloper or a text editor to access the new Siebel business component field. This task is a step in Process of Extending ADF Business Components on page 161. You must perform the following procedures to extend the ADF Business Component code: Editing the ContactUserData Class on page 167 Extending the ContactVO View Object on page 168

For more information on extending ADF Business Component code, see Modifying ADF Business Component Code to Access Web Service Data on page 136.

Editing the ContactUserData Class


You must edit ContactUserData.java to do the following: Use the new proxy to call the Siebel Web service. Include the Favorite Color data.

To edit the ContactUserData class 1 2


Open ContactUserData.java in Oracle JDeveloper or a text editor. Edit the import statements to call the new proxy classes. NOTE: If you do not update the import statements, you will get compiler errors when running or deploying the Java EE application.

Edit the ContactUserData class to call the Web service to get the Favorite Color data, for example: // Favorite Color if (cnames[i] != null && "FavoriteColor".equals(cnames[i].toString())) { QueryType qt1 = new QueryType(); qt1.set_value((cvalues[i] != null) ? ("LIKE'" + FormatterUtil.insertEscSequence(cvalues[i]).toString() + "'") : ""); cquery.setFavoriteColor(qt1); } NOTE: Be sure to include statements to clear any existing queries and sort criteria for FavoriteColor.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

16 7

Customizing the Model Layer for Siebel Self-Service Applications Process of Extending ADF Business Components

Extending the ContactVO View Object


You must add the FavoriteColor attribute to the ContactVO view object, and then modify the ContactVOImpl class to populate the attribute with data. CAUTION: Before you edit the ContactVO view object, back up any custom code in the ContactVOImpl class.

To extend the ContactVO view object 1 2


In Oracle JDeveloper, expand the Applications Sources node under the Model project. Navigate to oracle.apps.ss.base.model.um, and then double-click the ContactVO view object. The View Object Editor opens.

3 4 5 6 7

Click Attributes, and then click New. Add the FavoriteColor attribute. Click OK to close the editor. Restore your custom code to the ContactVOImpl class. Edit the ContactVOImpl class in Oracle JDeveloper or a text editor to populate the FavoriteColor attribute, for example: ContactData contact = ((ContactUserData)getUserDataForCollection(o)).getNextContact(); if(contact != null) { tRow = createNewRowForCollection(o); contact_row = (ContactVORowImpl)createNewRowForCollection(o); populateAttributeForRow(tRow,0,contact.getId()); populateAttributeForRow(tRow,1,contact.getFirstName()); populateAttributeForRow(tRow,2,contact.getMiddleName()); populateAttributeForRow(tRow,3,contact.getLastName()); ... populateAttributeForRow(tRow,42,contact.getFavoriteColor()); } return tRow; ...

168

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications Configuring Failover on the SessionAM Application Module

Configuring Failover on the SessionAM Application Module


In a clustered environment, if one node fails, transactions can be processed on other nodes. There is no interruption of the end-user experience. This is called failover. In failover mode, the Oracle ADF run time saves an additional browser cookie that the run time uses to track the latest passivation snapshot ID for each client running an application in failover mode. So, even though the users next request will be processed in the context of a new HttpSession (perhaps even in a different application server instance), the user is unaware that this has occurred. The additional browser cookie is used to reactivate any available application module instance with the user's last pending state snapshot before handling the request. Failover is configured on the SessionAM application module, using the jbo.dofailover configuration parameter.

To configure failover on the SessionAM application module 1 2


In Oracle JDeveloper, right-click SessionAM, and then choose Configurations. The Configuration Manager dialog appears. Click Edit. The Oracle Business Component Configuration dialog appears.

3 4

Click the Pooling and Scalability tab. Select the Failover Transaction State Upon Managed Release check box, and then click OK. The jbo.dofailover property, with a value of true, appears in the Configuration Manager dialog.

Click OK to close the Configuration Manager dialog.

About ADF Data Control


In ADF Data Control, user interface page definitions are associated with ADF Business Components view objects in page definition files in the ViewController/WEB-INF/classes/view/pageDefs directory. To customize data controls, you copy the page definition files, rename them, and then edit them in a text editor or Oracle JDeveloper. In the following example, AccountListBinPageDef.xml, the AccountVOView Object is bound to the page definition for the region that lists accounts: <?xml version="1.0" encoding="UTF-8" ?> <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="10.1.3.39.84" id="AccountListBinPageDef" Package="view.pageDefs"> <parameters> <parameter id="myVO" value="${data.SessionAMDataControl.dataProvider .Root.OrganizationAM1.AccountVO1}"/>

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

16 9

Customizing the Model Layer for Siebel Self-Service Applications About ADF Data Control

</parameters> <executables> <iterator id="AccountVO1Iterator" Binds="${myVO}" DataControl="SessionAMDataControl"/> </executables> <bindings> <table id="OrganizationAM1AccountVO1" IterBinding="AccountVO1Iterator"> <AttrNames> <Item Value="Id"/> <Item Value="AccountName"/> <Item Value="Location"/> <Item Value="ParentAccountName"/> <Item Value="PrimaryAccountFlag"/> <Item Value="IsIndividualAccount"/> </AttrNames> </table> </bindings> </pageDefinition> The page definition file has the following sections: parameters. Defines a parameter for the View Object to be passed in the page definition of the region. executables. Defines an iterator binding that tracks the current row in a data collection, in this example a list of accounts. bindings. Defines a table to access data in the View Object, for example, account names.

For more information on regions, see Regions on page 55 and Customizing Regions for Siebel SelfService Applications on page 63.

170

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Customizing the Model Layer for Siebel Self-Service Applications About ADF Binding

About ADF Binding


ADF Binding is implemented in the DataBindings.cpx file in the ViewController/WEB-INF/classes/ view directory. DataBindings.cpx maps physical JSPX pages to page definitions. For example, the region that lists accounts, AccountListBin.jspx, is mapped to AccountListBinPageDef.xml in two sections in DataBindings.cpx: <pageMap> ... <page path="/ss/base/um/region/AccountListBin.jspx" usageId="AccountListBinPageDef"/> ... </pageMap> ... <pageDefinitionUsages> ... <page id="AccountListBinPageDef" path="oracle.apps.ss.base.view.pageDefs.um.region.AccountListBinPageDef"/> ... </pageDefinitionUsages> ... For more information on page definition files, see About ADF Data Control on page 169.

Binding a View Object to a User Interface Page


Oracle JDeveloper has drag-and-drop functionality for adding the functionality of a view object to a UI page.

To add a view object to a user interface page 1 2 3 4


Double-click the page in the Applications Navigator in Oracle JDeveloper to open it. Click the Design tab. In the Data Controls Palette, expand the node for the data control that corresponds to the application module containing the view object, for example, SampleAppModuleDataControl. Click the view object you want to add to the page, and drag it onto the page where you want it to appear.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

17 1

Customizing the Model Layer for Siebel Self-Service Applications Binding a View Object to a User Interface Page

In the context menu that appears, choose Create, Tables, and then ADF Table. The Edit Table Columns dialog appears.

6 7

Choose the view object attributes to display and arrange them in the desired order. Select the following check boxes:

Enable selection Enable sorting

Click OK.

The table that displays view object data is added to the UI page. Data bindings and data controls are created automatically.

172

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Deploying and Testing Customized Siebel Self-Service Applications

This chapter describes how to test your customized Siebel Self-Service Applications, and then deploy them to the production environment. It includes the following topics: Testing a Java EE Application in Oracle JDeveloper on page 173 Process of Packaging the Java EE Application for Deployment on page 174 Deploying a Customized Java EE Application to the Oracle Application Server on page 177 Deploying a Customized Java EE Application to an Enterprise Archive File on page 177 Deploying the EAR File to the Oracle Application Server in the Development Environment on page 178 Configuring the Endpoint URL After Deployment on page 179 Testing Deployed Java EE Applications on page 180 Deploying the EAR File to the Production Environment on page 180

Testing a Java EE Application in Oracle JDeveloper


You can test Java EE applications in Oracle JDeveloper, using the embedded Oracle Application Server 10g Containers for Java EE (OC4J). NOTE: Before testing Siebel Self-Service Applications, you must start the Siebel Servers and connect to the Siebel Web Server Extension when launching the applications. For more information, see Configuring Endpoint URLs on page 42.

To test an application in Oracle JDeveloper 1 2 3


Open a customized page in Oracle JDeveloper. Right-click inside the page, and then choose Run. The embedded OC4J starts. Test the customized application.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

17 3

Deploying and Testing Customized Siebel Self-Service Applications Process of Packaging the Java EE Application for Deployment

Process of Packaging the Java EE Application for Deployment


Before you can deploy a Java EE application you must create a deployment profile in Oracle JDeveloper. The deployment profile defines how the application is packaged and deployed. When the deployment profile has been created it can be reused for all subsequent deployments. To package the Java EE application, perform the following tasks:

1 2 3 4 5

Creating a Deployment Project on page 174 Creating a Deployment Profile for the Model Project on page 174 Creating a Deployment Profile for the ViewController Project on page 175 Creating a Deployment Profile for the Java EE Application on page 175 Creating a Deployment Descriptor on page 176

Creating a Deployment Project


You create a Deployment project in Oracle JDeveloper to hold the deployment profile. Process of Packaging the Java EE Application for Deployment on page 174

To create a Deployment project 1 2 3


In the Applications Navigator in Oracle JDeveloper, right-click the SelfService application, and then choose New Project. In the New Gallery, select General, Projects, and then Empty Project. Name the project Deployment, and then click OK.

The Deployment project is created.

Creating a Deployment Profile for the Model Project


You create a deployment profile for the Model project in Oracle JDeveloper. Process of Packaging the Java EE Application for Deployment on page 174

To create a deployment profile for the Model project 1 2 3


In the Applications Navigator in Oracle JDeveloper, right-click the Model project, and then choose New. In the New Gallery, choose General, Deployment Profiles, JAR File, and then click OK. In the Create Deployment Profile -- JAR File dialog, name the profile ModelArchive, and then click OK.

174

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Deploying and Testing Customized Siebel Self-Service Applications Process of Packaging the Java EE Application for Deployment

In the JAR Deployment Profile Properties dialog, click OK.

The ModelArchive.deploy file is created under Model/Resources.

Creating a Deployment Profile for the ViewController Project


You create a deployment profile for the ViewController project in Oracle JDeveloper. Process of Packaging the Java EE Application for Deployment on page 174

To create a deployment profile for the ViewController project 1 2 3 4


In the Applications Navigator in Oracle JDeveloper, right-click the ViewController project, and then choose New. In the New Gallery, choose General, Deployment Profiles, WAR File, and then click OK. In the Create Deployment Profile -- WAR File dialog, name the profile ViewArchive, and then click OK. In the WAR Deployment Profile Properties dialog, click OK.

The ViewArchive.deploy file is created under ViewController/Resources.

Creating a Deployment Profile for the Java EE Application


After creating the profiles for the Model and ViewController projects, you assemble the application. To do this, you create a deployment profile in Oracle JDeveloper that includes the Model and ViewController profiles. Process of Packaging the Java EE Application for Deployment on page 174

To create a deployment profile for the Java EE application 1 2 3 4 5


In the Applications Navigator in Oracle JDeveloper, right-click the Deployment project, and then choose New. In the New Gallery, choose General, Deployment Profiles, EAR File, and then click OK. In the Create Deployment Profile -- EAR File dialog, name the profile SelfService, and then click OK. In the EAR Deployment Profile Properties dialog, select Application Assembly. Select the following modules to include:

ViewController.jpr, then ViewArchive.deploy ModelArchive.jpr, then ModelArchive.deploy

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

17 5

Deploying and Testing Customized Siebel Self-Service Applications Process of Packaging the Java EE Application for Deployment

Click OK.

The SelfService.deploy file is created under Deployment/Resources.

Creating a Deployment Descriptor


When you deploy an application to an Oracle Application Server, you must specify the names and locations of files that are to be deployed. To do this, you use a deployment descriptor, orionapplication.xml. The Enterprise Archive (EAR) file in which Siebel Self-Service Applications are provided, 81SelfService.ear, has a deployment descriptor with many of the necessary parameters, but it is not visible in Oracle JDeveloper. To use it, you create a deployment descriptor in Oracle JDeveloper, which also creates a directory structure under the Deployment project, then replace the new deployment descriptor with the one from the original EAR file after editing it to use a data-sources.xml file with valid database connection information. NOTE: After deployment, the data source appears in Oracle Enterprise Manager 10g Application Server Control under Cluster Topology, <Application_Server>, OC4J:home, and then the JDBC Resources page. The connection credentials can be configured here, including the password in clear text. This information is stored under ORACLE_HOME/j2ee/home/application-deployments/ <application_name>/<application_name>-data-sources.xml. Process of Packaging the Java EE Application for Deployment on page 174 For information on creating a database connection, see Connecting to an Oracle Database for Data Passivation on page 41.

To create a deployment descriptor 1 2


In the Applications Navigator in Oracle JDeveloper, right-click the Deployment project, and then choose New. In the New Gallery, choose General, Deployment Descriptors, OC4J Deployment Descriptor Wizard, and then click OK. The OC4J Deployment Descriptor Wizard appears.

3 4 5

On the Welcome page, click Next. In Step 1, select orion-application.xml, and then click Next. In Step 2, select 10.0, and then click Finish. The new orion-application.xml file appears under Deployment/Application Sources/META-INF.

In a text editor, open the original SelfService_ROOT/orion-application.xml file, and change the data-sources tag to the following: <data-sources path="SelfService_ROOT/SelfService-data-sources.xml" />

Copy SelfService_ROOT/orion-application.xml.

176

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Deploying and Testing Customized Siebel Self-Service Applications Deploying a Customized Java EE Application to the Oracle Application Server

8 9

Navigate to the directory where the new orion-application.xml file resides, for example, SelfService_ROOT/Deployment/src/META-INF. Replace the new orion-application.xml with the version from the EAR file. application.xml. The contents should be those of the version from the EAR file.

10 In Oracle JDeveloper, open Deployment/Application Sources/META-INF/orion-

Deploying a Customized Java EE Application to the Oracle Application Server


You can deploy applications directly to an Oracle Application Server from Oracle JDeveloper. NOTE: The Oracle Application Server must be running, and a connection to it in Oracle JDeveloper must already be established. For more information on connecting to Oracle JDeveloper application server, see Connecting to the Oracle Application Server on page 37. NOTE: You must also have configured the endpoint URL setting in Oracle JDeveloper. For more information on configuring the endpoint URL before deployment, see Configuring Endpoint URLs on page 42.

To deploy an application to the Oracle Application Server 1 2 3


In Oracle JDeveloper, expand the Resources node under the Deployment project. Right-click SelfService.deploy, and then choose Deploy to <application_server_name>. In the Configure Application window, click OK. The deployment progress is displayed in the Deployment - Log window. Error messages are shown in the Compiler - Log window.

Deploying a Customized Java EE Application to an Enterprise Archive File


When you have finished customizing an application you need to create an Enterprise Archive (EAR) file and then deploy that EAR file to an application server. Typically it is deployed in a test environment first, and after it passes testing it is then deployed to the production environment. You use the deployment profile, SelfService.deploy, to deploy the customized application to an Enterprise Archive (EAR) file. For information on creating the deployment profile, see Process of Packaging the Java EE Application for Deployment on page 174.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

17 7

Deploying and Testing Customized Siebel Self-Service Applications Deploying the EAR File to the Oracle Application Server in the Development Environment

To deploy an application to an EAR file 1 2


In Oracle JDeveloper, expand the Resources node under the Deployment project. Right-click SelfService.deploy, and then choose Deploy to EAR file. The EAR file is created. The deployment progress is displayed in the Deployment - Log window. Error messages are shown in the Compiler - Log window.

Deploying the EAR File to the Oracle Application Server in the Development Environment
You can deploy the EAR file from the Oracle Enterprise Manager Application Server Control console. During deployment, you can configure the endpoint URL for the Siebel Web Server Extension. NOTE: The Oracle Application Server service, for example, Oracle-OracleAS_10_1_3ProcessManager, must be started.

To deploy the EAR file to the Oracle Application Server 1


In a Web browser, navigate to the Oracle Enterprise Manager login page: http://localhost[:<port>]/em

Enter the administrator username and password, for example, oc4jadmin and welcome1. The Cluster Topology page appears.

3 4 5 6

Click the name of the OC4J instance to which you want to deploy the EAR file. The OC4J:instance page appears. Click the Applications tab. On the Applications page, select the default check box, and then click Deploy. On the Select Archive page:

a b

Under Archive, click Browse to select the EAR file to deploy. Under Deployment Plan:

If this is the first time that you are deploying an EAR file, select Automatically create a new deployment plan. If you have previously deployed an EAR file and saved the deployment plan, select Deployment plan is present on local host, and then browse for the deployment plan.

c 7 a b

Click Next.

On the Application Attributes page: Enter a name for the application, such as SelfService81. Enter a name for the Context Root or keep the default, which is read from the EAR file.

178

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Deploying and Testing Customized Siebel Self-Service Applications Configuring the Endpoint URL After Deployment

c 8 9

Click Next.

On the Deployment Settings page, click Edit Deployment Plan. (Optional) Confirm that the jaasMode parameter for authentication using the Java Authentication and Authorization Service (JAAS) is set to doAsPrivileged:

a b c a b

On the Edit Deployment Plan page, click Edit Jazn under Value. On the Edit Deployment Plan: jazn page, make sure that the value for the jaasMode parameter is set to doAsPrivileged. Click Continue.

10 Configure the endpoint URL for the Siebel Web Server Extension:
On the Edit Deployment Plan page, click Edit Properties under Value. On the Edit Deployment Plan: properties page, enter the following in the value (java.lang.String) field for the SIEBEL_WEBSERVER_URL property: http://<host>[:<port>]/custappsvcs/ start.swe?SWEExtSource=WebService&SWEExtCmd=Execute where host is a Siebel Server and port is optional NOTE: Do not include the language code in the custappsvcs virtual directory name. NOTE: If you do not enter a value, the deployment will fail. You can insert a placeholder value during the deployment, and then edit it later in the orion-application.xml file (see Configuring the Endpoint URL After Deployment on page 179).

Click Continue.

11 Click OK to return to the Deployment Settings page. 12 (Optional) Click Save Deployment Plan, and then specify a location to save the deployment plan. 13 Click Deploy.
The Progress Messages window on the Progress: Deploy page shows the deployment steps. If the deployment succeeds, the Confirmation page appears.

Configuring the Endpoint URL After Deployment


You can also configure the endpoint URL in the Web application deployment descriptor file, orion-application.xml, after deployment.

To configure the endpoint URL in orion-application.xml 1 2


Navigate to the <OracleAS_root>/j2ee/home/application-deployments/<ContextRoot> directory. Open the orion-application.xml file in a text editor.

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

17 9

Deploying and Testing Customized Siebel Self-Service Applications Testing Deployed Java EE Applications

Set the value of the SIEBEL_WEBSERVER_URL property to the following: http://<host>[:<port>]/custappsvcs/ start.swe?SWEExtSource=WebService&SWEExtCmd=Execute where host is a Siebel Server and port is optional NOTE: Do not include the language code in the custappsvcs virtual directory name. For example: <property name="SIEBEL_WEBSERVER_URL" value="http://SiebelServer/custappsvcs/ start.swe?SWEExtSource=WebService&SWEExtCmd=Execute"/>

Testing Deployed Java EE Applications


You test deployed applications in a Web browser. NOTE: Before testing applications, you must start the Siebel Servers. The Oracle Application Server must also be running, and the deployed application must be started on the application server.

To test an application 1
In a Web browser, navigate to the Sites page: http://<host>[:<port>]/<ContextRoot>/faces/ss/base/site/SiteList.jspx

2 3 4

Test the application. If necessary, make changes to it in Oracle JDeveloper. Remove the following files from ViewController/public_html that are used for testing and debugging:

test/ss/base/common/TemplateCache.jsp test/ss/base/common/TemplateRuntime.jspx ss/base/common/popup/TestLOV.jspx ss/base/common/SampleSkinPage.jspx ss/base/common/SoftwareTemplate.jspx

Redeploy the application as an EAR file.

Deploying the EAR File to the Production Environment


You copy the EAR file to the production computer, and then deploy it from the Oracle Enterprise Manager Application Server Control console according to the procedure in Deploying the EAR File to the Oracle Application Server in the Development Environment on page 178.

180

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

10 Monitoring Diagnostic Information and Error Messages


for Siebel Self-Service Applications
This chapter describes how to monitor and log events that happen when Siebel Self-Service Applications run. It includes the following topics: About the Oracle Dynamic Monitoring Service on page 181 Configuring Java EE Logging on page 181 About Oracle Application Diagnostics for Java on page 183 About Error Pages for Self-Service Applications on page 184 About Enabling Web Services Tracing on the Siebel Server on page 184 About Monitoring Siebel Application Performance on page 184 Configuring Diagnostic Logging on the Siebel Server on page 185

About the Oracle Dynamic Monitoring Service


The Oracle Dynamic Monitoring Service (DMS) provides a set of Java APIs that measure and report performance metrics, status, information, and diagnostic information for the Oracle Application Server and other Oracle products. Oracle products call DMS library routines that compute metrics and export them to Oracle Enterprise Manager. For more information about the data produced by DMS, see Oracle Application Server Performance Guide.

Configuring Java EE Logging


You can log error messages generated when running Siebel Self-Service Applications. The Oracle Application Server uses two files for logging: j2ee-logging.xml, found in the ORACLE_HOME/j2ee/home/config directory logging.properties, found in the ORACLE_HOME/jdk/jre/lib directory

After proper configuration, each statement in the log is prefixed with the user name of the loggedin user (or GUEST if none is logged in). The log files are generated in the /<username>/logs and ORACLE_HOME/opmn/logs directories on the computer running the Oracle Application Server. You can use either log file. For more information on logging, see the following:

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

18 1

Monitoring Diagnostic Information and Error Messages for Siebel Self-Service Applications Configuring Java EE Logging

Java Logging Technology at http://java.sun.com

Oracle Application Server Performance Guide on Oracle Technology Network Oracle Application Server DMS API Reference on Oracle Technology Network

Creating the j2ee-logging.xml File


The j2ee-logging.xml file is the logging configuration file for OC4J. You create it in a text editor.

To create the j2ee-logging.xml file 1


Using the example below, enter the text and configure the bold lines to match your environment needs. <?xml version="1.0" encoding="iso-8859-1"?> <!-- Logging configuration file for OC4J --> <logging_configuration> <log_handlers> <!-- existing --> <!-- newly added --> <log_handler name='file-handler' class='java.util.logging.FileHandler?' /> </log_handlers> <loggers> <!-- Set the default logger useParentHandlers? to false because the root logger (named the empty string "") will log to the console. --> <!-- Choose any of the three handlers to use. --> <logger name='oracle.apps.ss' level='INFO' useParentHandlers?='false'> <handler name='console-handler'/> <handler name='oc4j-handler'/> <handler name='file-handler'/> </logger> </loggers> </logging_configuration>

Save the file as j2ee-logging.xml.

182

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Monitoring Diagnostic Information and Error Messages for Siebel Self-Service Applications About Oracle Application Diagnostics for Java

Configuring the logging.properties File


You edit the logging.properties files in a text editor.

To configure the logging.properties file 1 2


Open the logging.properties file for editing. Add the following text, editing it to match your environment: <!-- existing properties --> oracle.apps.ss.handlers = java.util.logging.FileHandler? # default file output is in user's home directory java.util.logging.FileHandler?.pattern = %h/logs/java%u.log java.util.logging.FileHandler?.limit = 10000000 java.util.logging.FileHandler?.count = 0 java.util.logging.FileHandler?.formatter = java.util.logging.SimpleFormatter?

Save the file.

Configuring the Java Policy File


The java2.policy file in the ORACLE_HOME/j2ee/config/ directory must be modified to provide necessary permissions for the logger to write into the filesystem directory.

To configure the Java policy file 1 2


Open the java2.policy file for editing. Add the following text to the end of file, editing it to match your environment: grant { permission java.io.FilePermission? "/<userName>/logs/*", "write,read"; permission java.util.logging.LoggingPermission? "control"; };

About Oracle Application Diagnostics for Java


Oracle Application Diagnostics for Java (AD4J) is low-overhead monitoring and diagnostics software that improves the performance and availability of Java applications. Its key features are the following:

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

18 3

Monitoring Diagnostic Information and Error Messages for Siebel Self-Service Applications About Error Pages for Self-Service Applications

Hot deployment. Deployed dynamically as a WAR file into running Java applications. The applications do not have to be restarted. Real-time Java Virtual Machine (JVM) monitoring. Monitors the complete Java stack, including thread state and Java method and line visibility. Differential heap analysis. Creates complete memory snapshots for offline analysis. Simplifies memory growth and leak analysis. Cross-tier trace with an Oracle database. Analyzes transactions between the database and the Java middle tier. Identifies Java threads associated with long-running SQL code.

AD4J is available with Oracle Enterprise Manager 10g Release 4 and later. For more information on AD4J, see Oracle Technology Network.

About Error Pages for Self-Service Applications


Errors are displayed on the generic error page. For more information on error pages, see Error Messages and Generic Error Page on page 59.

About Enabling Web Services Tracing on the Siebel Server


You can enable Web services tracing on the Siebel Server to write all inbound and outbound SOAP documents to a log file. For information on enabling Web services tracing, see Integration Platform Technologies: Siebel Enterprise Application Integration.

About Monitoring Siebel Application Performance


You can use metrics such as log files, state values, and statistics to monitor the performance of the Siebel portion of Oracles Siebel Self-Service Applications. For information on monitoring Siebel application performance, see Siebel System Monitoring and Diagnostics Guide.

184

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Monitoring Diagnostic Information and Error Messages for Siebel Self-Service Applications Configuring Diagnostic Logging on the Siebel Server

Configuring Diagnostic Logging on the Siebel Server


You can set the event logging level from 0 (Fatal) to 5 (Diagnostic) for Siebel Server components by using the srvrmgr utility. For Siebel Self-Service Applications, it can be useful to generate logs for the following server components: EAIObjMgr_lang CustomAppObjMgr_lang

where lang is the language code, for example enu. For more information on configuring logging on Siebel Servers, see Siebel System Monitoring and Diagnostics Guide.

To configure diagnostic logging on the Siebel Server 1 2


Navigate to SIEBSRVR_ROOT/bin. Start the srvrmgr utility using the following command:

Windows: srvrmgr /g <GatewayServerHostname> /e <EnterpriseServerHostname> /u SADMIN /p password UNIX: srvrmgr -g <GatewayServerHostname> -e <EnterpriseServerHostname> -u SADMIN -p password

Enter the following commands at the srvrmgr prompt: change evtloglvl %=m for component [EAIObjMgr_lang] change evtloglvl %=n for component [CustomAppObjMgr_lang] where m and n are integer values from 0 to 5

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

18 5

Monitoring Diagnostic Information and Error Messages for Siebel Self-Service Applications Configuring Diagnostic Logging on the Siebel Server

186

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Index

A
AD4J, about logging Java applications 183 ADF Binding about 21 ADF binding filter 26 mapping UI pages to page definitions 171 ADF Business Components about 20, 130 about data controls 169 accessing Web service data 136 application module, defined 130 asset management example 148 binding to UI page 171 configuring failover 169 creating application module 134 creating from Siebel Web services 132 creating programmatic view object 133 extending 161, 167 optimizing performance 131 overriding view object implementation methods 136 pagination and sorting example 139 query by example (QBE) example 146 SessionAM application module 25 view object, defined 131 working with, reference 131 wrapper class for Siebel Web service data 138 ADF Data Control about 21 about associating ADF Business Components with UI pages 169 ADF Faces about 22 ADF Faces Skins 119 customizing application appearance 120 customizing menu orientation 120 adf-faces-skins.xml, determining application appearance 119 Adobe Form Server, connecting to 43 af:panelBorder tag about 54 example 60 application architecture about and diagram 13 components and application flow (diagram) 15

project structure in Oracle JDeveloper 22 application configuration file, web.xml 33 application modules about 130 creating 134 application.xml, configuring authentication in Oracle JDeveloper 44

B
bins See regions Business Components, ADF See ADF Business Components business components, Siebel about 16 adding fields 162 exposing to external applications 163 business objects, Siebel 17 business services, Siebel 18

C
cleaning up after importing Java EE application into JDeveloper 39 cleaning Model and ViewController projects 40 removing duplicate class files 40 condition property, hiding detail nodes 114 Controller layer, about 21 create() method, about and example 137 createRowFromResultSet() method, about and example 137 Custom Application Object Manager (CustomAppObjMgr), Siebel Server component 18 customizing Java EE applications customizable files 30 customization strategy 29 customization support 30 roadmap 32

D
data bindings about 20, 171 removing duplicate class files 40 data passivation connecting to Oracle database 41

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

18 7

Index E

definition 41 database Oracle 41 Siebel 16 DataBindings.cpx customizing 62 mapping UI pages to page definitions 171 deploying applications creating deployment descriptor 176 creating deployment profile for application 175 creating deployment profile for Model project 174 creating deployment profile for ViewController project 175 creating Deployment project 174 to EAR file 177 to Oracle Application Server 177 to Oracle Application Server, as EAR file 178 to production environment 180 deployment descriptor orion-application.xml 176 web.xml 33 documents, related 10 Dynamic Monitoring Service (DMS), about measuring application server performance 181

request process train example 85 faces-config-sample-train.xml, sample process train 81 facets about 54 regions 54 failover about 27 configuring 169 fragments See regions

G
getQueryHitCount() method, about and example 137

H
hasNextForCollection() method, about and example 136

I
integration components about 17 adding integration component fields 162 integration objects, about 17

E
endpoint URL configuring after deployment 179 configuring during deployment 178 configuring in Oracle JDeveloper 42 Enterprise Archive (EAR) files deploying Java EE application to 177 deploying to Oracle Application Server in development environment 178 deploying to Oracle Application Server in production environment 180 importing into Oracle JDeveloper 38 error messages, about 59 error pages, about 184 executeQueryForCollection() method, about and example 136

J
j2ee-logging.xml, creating logging configuration file 182 Java Authentication and Authorization Service (JAAS), configuring in JDeveloper 44 Java classes calling Siebel Web services (table of) 154 source code provided 33, 131 Java EE applications Controller layer 21 creating deployment descriptor 176 creating deployment profile for application 175 creating deployment profile for Model project 174 creating deployment profile for ViewController project 175 creating Deployment project 174 customizable files 30 customization strategy 29 deploying EAR file to Oracle Application Server 178 deploying EAR file to production environment 180 deploying patches to development

F
faces-config-base.xml, page flow example 77 faces-config-base-menu.xml, menu model example 101 faces-config-base-skin-properties.xml, customizing menu orientation 120 faces-config-base-sr-train.xml, service

188

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Index L

environment 46 deploying to EAR file 177 deploying to Oracle Application Server 38, 177 importing into Oracle JDeveloper 38 logging errors 181 Model layer 19 Model-View-Controller design pattern 19 packaging for deployment 174 roadmap for customizing 32 testing deployed applications 180 testing in Oracle JDeveloper 173 View layer 22 Java logging technology, reference 182 Java Object Cache 20 about 123 clearing by template indirection rules page 123 configuration parameters (table) 124 configuring 125 creating loader classes 126 example 124 flushing in system settings view 123 LovCacheLoader class example 126 region attributes 124 Java policy file, configuring logger permissions 183 java.util.logging package 182 JavaServer Faces (JSF), about 22 JDeveloper See Oracle JDeveloper JSR-127 specification 22 JSR-227 specification 20

customizing 96, 113 customizing orientation 120 hiding based on business logic 114 locale-specific 101 menu model example 101 menu node properties, table 100 showing based on business logic 114 using the condition property to hide detail nodes 114 MinComponentSize, Java Object Cache configuration parameter 124 MinTimeToLive, Java Object Cache configuration parameter 124 Model layer about 19 customizing 123 Model project, cleanup 40 Model-View-Controller (MVC) design pattern about 19 Controller layer 21 data binding 20 Model layer 19 View layer 22

O
Oracle Application Diagnostics for Java (AD4J), about 183 Oracle Application Server about Dynamic Monitoring Service (DMS) 181 connecting to 37 deploying applications to 177 installing and configuring 37 testing applications 180 Oracle database, connection for data passivation 41 Oracle Global Customer Support (GCS), support for customizations 30 Oracle JDeveloper binding view object to UI page 171 cleaning up projects 40 configuring authentication 44 configuring endpoint URL 42 configuring lazy component load 132 connecting to Oracle Application Server 37 creating ADF Business Component application module 134 creating ADF Business Component view object 133 creating deployment descriptor 176 creating deployment profile for application 175 creating deployment profile for Model

L
lazy component load configuring during deployment 131 configuring in Oracle JDeveloper 132 logging diagnostic, configuring on Siebel Server 185 Java applications using AD4J 183 Java EE, configuring 181 logging.properties, configuring 183

M
MaxComponentSize, Java Object Cache configuration parameter 124 MaxTimeToLive, Java Object Cache configuration parameter 124 menus about menu model 99 adding survey page, example 96 bookmarking pages 101

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

18 9

Index P

project 174 creating deployment profile for ViewController project 175 creating Deployment project 174 creating Web service client proxy 132 customizing page flows 80 customizing process trains 94 deploying Java EE application to EAR file 177 deploying Java EE application to Oracle Application Server 177 extending ADF Business Components 167 importing Java EE applications 38 installing 37 packaging Java EE application for deployment 174 project structure, Java EE applications 22 removing duplicate class files 40 testing Java EE applications 173 orion-application.xml configuring endpoint URL after deployment 179 creating deployment descriptor 176

about 80 customizing 94 sample file 81 service request example 85 programmatic view objects, creating projects, removing data 40

133

Q
query by example (QBE), using ADF Business Components 146

R
region-metadata.xml, about 55 regions about 54, 55 customizing 63 related documents 10 releaseUserDataForCollection() method, about and example 138 renaming files before customization, about 30 roadmap, for customizing Siebel Self-Service Applications 32

P
page flows about 76 customizing 80 example 77 page templates about 50 af:panelBorder tag 54 creating 64 customizing 62 customizing mappings 74 error page 59 facets 54 mappings 64 page footer 58 page header 55 regions 54, 55 Service Request example 60 setting mappings 75 standard template 51 template indirection 64 template mapping example 66 pagination, using ADF Business Components 139 panels See regions patches, deploying to development environment 46 permissions, about 100 process trains

S
SelfService-oc4j-app.xml, configuring authentication in Oracle JDeveloper 44 session handling access control and authorization 25 ADF binding filter 26 attributes in View layer 25 failover, about 27 failover, configuring 169 in Siebel Self-Service Applications 23 session cookie 27 SessionAM application module 25 Siebel Web service authentication 24 Siebel Web service handler class 24 SessionAM application module configuring failover 169 root application module, about 25, 130 Siebel Business Applications installing and configuring 35 monitoring performance 184 Siebel Database, about 16 Siebel E-Commerce, declarative cache file sample 124 Siebel E-Support page example 60 process train example 85 Siebel objects, about 16 Siebel Public Sector E-Support

190

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Index T

interpreting references to deploying company as deploying agency 13 Siebel Self-Service Applications access control and authorization 25 architecture 13 components and application flow (diagram) 15 customization support 30 page template 50 roadmap for customizing 32 session handling 23 Siebel Web Server Extension, connecting to 42 SiebelWSHandler.java, Web service handler class 133, 164 Simple Object Access Protocol (SOAP) passing data from Siebel Server to Java EE application 15 tracing messages on Siebel Server 184 site administration, setting page template mappings 75 skins about 119 customizing application appearance 120 customizing menu orientation 120 sorting, using ADF Business Components 139 source code, Java classes 33 srvrmgr utility, using to configure diagnostic logging 185 support for customizations 30 system-jazn-data.xml, configuring authentication in Oracle JDeveloper 44

V
View layer about 22 session attributes 25 view object implementation classes, overriding methods 136 view objects about 131 binding to UI page 171 create() method, overriding 137 createRowFromResultSet() method, overriding 137 creating programmatic 133 executeQueryForCollection() method, overriding 136 getQueryHitCount() method, overriding 137 hasNextForCollection() method, overriding 136 releaseUserDataForCollection() method, overriding 138 ViewController project, cleanup 40

W
Web services about 18 accessing data using ADF Business Components 136 accessing data using ADF Business Components, asset management example 148 activating 36 authentication 24 clearing cache 36 creating ADF Business Components from 132 creating client proxy 132, 164 enabling tracing on Siebel Server 184 Java classes calling (table of) 154 re-creating client proxy 164 replacing SelfServiceAccount client proxy classes 165 Self-Service, list of 36 Siebel Web service handler class 24, 133, 164 UserData wrapper class 138 Web Service Client Proxy 20 web.xml about application configuration file 33 configuring authentication in Oracle JDeveloper 44

T
template indirection, about 64 template mappings about 64 example 66 template-faces-config.xml, page template mapping example 66 templates, page See page templates testing applications in Oracle JDeveloper 173 on Oracle Application Server 180

U
user responsibilities, about 100 UserData wrapper class 138

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

19 1

Index W

192

Siebel Self-Service Application Developers Guide Version 8.1, Rev. A

Vous aimerez peut-être aussi