Using the Siebel Web Engine (SWE) to View Data in a WebCenter Application

Purpose

This tutorial shows you how a WebCenter application can dynamically query Siebel data and parse the XML output coming from the Siebel Web Engine (SWE).

Time to Complete

Approximately 20 minutes

Topics

This tutorial covers the following topics:

 Overview
 Scenario
 Prerequisites
 Exploring Siebel Call Center Views and XML
 Configuring the Application
 Running the Application
 Exploring the Application
 Summary
 Related information

Viewing Screenshots

 Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all screenshots simultaneously, so response time may be slow depending on your Internet connection.)

Note: Alternatively, you can place the cursor over each individual icon in the following steps to load and view only the screenshot associated with that step.

Overview

This tutorial provides a prebuilt WebCenter application that you upload into JDeveloper Studio, run against your own Siebel data, and then explore. Later, you can use the application as the basis for your own Siebel-WebCenter integration needs. Note that this tutorial does not show you how to build a WebCenter application. See the Related Information section for more information.

Oracle WebCenter is an integrated suite of technology designed to deliver a unified, context-aware user experience that integrates structured and unstructured content, business intelligence, business processes, communication, and collaboration services. Oracle WebCenter is part of the Oracle Fusion Middleware product family and is based on an open, standards-based architecture. A key feature of WebCenter is that it removes the boundaries between Web-based portals and enterprise applications, and enables the rapid creation of a new generation of context-centric, composite applications that will change the way people work. The WebCenter Framework is integrated into JDeveloper and allows you to embed portlets, content, and customizable components in your application.

Siebel Web Engine (SWE) is responsible for rendering the Siebel User Interface. Siebel Web Templates provide this HTML layout information (markup information) to the Siebel Web Engine when rendering Siebel objects in the repository definition of the application. The markup that SWE returns can also be XML for rendering within XML-aware applications or WML (wireless markup language) for rendering on wireless devices. In this example, we request the SWE to return a Siebel View as XML, parse the data elements, and display the result in a WebCenter application.

Refer to Siebel Bookshelf Guides: Siebel Portal Framework Guide (specifically, the section on delivering content to external Web applications) and the Configuring Siebel Business Applications Guide for details on SWE and Web Templates.

Back to Topic List

Scenario

You first log in to Siebel Call Center, visit various views, and look at the structure of the XML dataset generated by SWE. Then you configure a prebuilt WebCenter application for your own installation of Siebel and run the application. The running application is shown below.

finished application

When the user clicks Execute, the application dynamically queries the Siebel data and parses the XML output returned from the Siebel Web Engine (SWE). The returned dataset is displayed in the Order Detail table.

 

Back to Topic List

Prerequisites

Before starting this tutorial, you should:

1.

Have access to or have installed Oracle JDeveloper Studio Edition (10.1.3.3).

This release includes all the functionality you need to build WebCenter applications. You can download JDeveloper Studio Edition from the Oracle Technology Network at http://www.oracle.com/technology/software/products/jdev/htdocs/soft10133.html.

2.

Have access to or have installed Oracle's Siebel eBusiness Applications. In this OBE, we use Siebel eBusiness Applications 7.8 with Call Center.

 

3.

Have downloaded sweOBE.zip and unzipped the contents into the c:\mywork directory, which you need to create on your local machine, as shown below.

Note: If you use a different top-level directory, you will need to make a simple modification to the application code.

 

4.

Have access to Windows Internet Explorer (IE) 7.0 or higher. It is essential that your browser is compatible with Siebel Call Center.

 

Back to Topic List

Exploring Siebel Call Center Views and XML

In this topic, you log in to Siebel Call Center, visit various views, and then examine the XML generated by SWE.

1.

Open Internet Explorer and enter the URL for Siebel Call Center.

The format of the URL is http:// < hostname>/callcenter_<language>/start.swe. For example, http://myhost.oracle.com/callcenter_enu/start.swe.

Be sure you are using a browser that is certified for use with Siebel, such as IE 7.

 

2.

Enter a valid user ID and password. We used SADMIN for both the user ID and password. Click the arrow to log in.

 

3.

On the home page, click the Accounts tab.

 

4.

To find the view that we want to use for the application, follow these steps:

a.

Click My Accounts to navigate to Accounts List.

 

b.

Click any account.

 

c.

Click the arrow next to Contacts to open the poplist.

 

d.

Locate Orders in the poplist.

This is the view that we want to base our page on.

 

5 .

Look at the XML for this view. To access the XML, append the following to the URL in your browser: &SWECmd=GotoView&SWEView=Account+Detail+Orders+View&SWESetMarkup=XML&SWEDataOnly=TRUE&SWERowId0=6SIA-2ZIAL&SWEApplet0=SIS+Account+Entry+Applet

Notice that we have set the SWESetMarkup=XML. We are also setting SWEDataOnly=True to indicate that SWE should return data only and no user interface information such as non-data controls (such as anchors and navigation controls).

Note: In the screenshot, we've selectively collapsed some nodes for readability.

 

6.

Scroll down to the <RS_DATA> element of the second <APPLET> element to look at the fields that are exposed in the data. Notice the field names (Priority Status, Order Number, and so on) that will be used from the returned XML.

Also notice that some fields (Order Type, for example) have a set of pick list values. These pick lists make the XML more challenging to parse.

 

7.

Now return to the Siebel Call Center (you can click the Back button in your browser). Select Help > About View from the main menu.

 

8.

The About View window shows the details of this screen. Notice the name of the view (Account Detail - Orders View) and the applet names.

The applet designated [1] (in this example, SIS Account Entry Applet) always controls the master section of the view. You are going to use the view name and the applet name in the next section.

 

10.

Click OK to close the About View window.

Back to Topic List

Configuring the Application

In this topic, you upload a predefined WebCenter application into JDeveloper Studio and then look at two properties files that are used by the application. You configure one of the files to match your Siebel environment.

1. Start JDeveloper: Double-click the JDeveloper executable ( jdeveloper.exe) found in the root directory ( <jdev_home>) where you unzipped it.

If the Migrate User Settings dialog box opens, click NO.

Close the Tip of the Day window.

 

2.

In the Applications Navigator, right-click Applications (top left) and select Add to Applications.


3.

In the �Select application(s) to add� dialog box, change the location to c:\mywork\sweOBE.

 

4.

Select sweOBE.jws and click Open. The jws extension indicates that the file is a JDeveloper workspace (application) file.

 

5.

Expand the sweOBE application in the navigator.Then expand ViewController > Web Content.

 

6.

Double-click ViewPage1.jsp to open it in the Visual Editor.

This page shows a master detail form. The user enters a customer record in the top field and clicks Execute. The bottom block is populated with data coming from Siebel.

Before you can run the page successfully, you need to modify a configuration file.

 

7.

Open Windows Explorer and find SWEgeneral.properties.

 

8.

Open SWEgeneral.properties in WordPad.

 

9.

Enter the host name of the Web server on which Siebel resides. If necessary, also modify the SiebelAccount property.

Note: The code in our sample application uses the SiebelAccount value for both the user name and password when logging in.

Save the file.

 

10.

Open orders.properties in Wordpad. Notice that the View and AppletName properties have been preset. Also, a default record is defined so a customer order is automatically queried when the user has not specified a record ID.

Look at the field names. Notice that the file also indicates the fields that are pick lists. This is important for parsing the XML.

Close this file without making any changes.

 

 

Back to Topic List

Running the Application

1.

In JDeveloper, run the ViewPage1.jspx page. To do this, right-click ViewPage1.jspx in the navigator and select Run from the context menu.

 

2.

Notice that a query has automatically been performed, using the default record that was specified in orders.properties.


3.

Let's return to Siebel Call Center to find another customer record number. Scroll down to find a record of interest. Find the record ID ("row#") by selecting Help > About Record from the main menu.

 

4.

Copy the record ID to the clipboard.

 

5.

Paste the ID in the Record ID field on the running page, and then click Execute. The orders for that customer should be listed in the Order Detail block.

 

Back to Topic List

Exploring the Application

Now let's look behind the scenes in JDeveloper to learn about the application structure and code.

1.

In the navigator, expand Application Sources and then expand model.swetoadf.

Note: The application uses two projects: The Model project is used to construct the data control on which the Order Detail table is based, whereas the ViewController project defines the user interface. It is always good practice to separate data controls from the user interface. The Portlets project is unused.

 

2.

Double-click sweData.java to open it in the Visual Editor and see what the code does.

The method public static List<viewRecord> getView(String pZoneName,String pRecordID)
will be called to collect rows from the given record. pZoneName is hard-coded to "orders" to select the
orders.properties file, where the record's attributes are defined.


3.

From the SWEgeneral.properties file, we get the Siebel Call Center's access parameters: host name and account name (which is also used for the password in our example).

From the orders.properties file, we get the record's attributes. These include the names of the module and applet, the default record, the field names of interest, and the field type (pick list or scalar value).


4.

The request URL object is constructed from these parameters. If no record is specified in the method call, the default record is used.

The URL first executes a login ( SWECmd=ExecuteLogin ...) and then requests the data from the appropriate view, applet, and record in XML forma ( SWECmd=GotoView ... ).


5.

Next, a DOM (Document Object Model) parser is created; it parses the newly constructed URL (that is, the reply coming from Siebel when the constructed URL is requested).

Because the code uses Oracle's DOM Parser, the resulting document can be typecast to oracle.xml.parser.v2.XMLDocument. The advantage of this document class is that it implements the non-standard method selectNodes(<XPATH String>), which will return a list of all the records matching the XPATH expression.


6.

The XPATH expression that is constructed selects all the rows from the RSS_DATA element from the specified APPLET tag (in this case, APPLET[2]): APPLICATION/SCREEN/VIEW/APPLET[2]/LIST/RS_DATA/ROW. The matching nodes ("ROWs") are fetched.

Than all of the rows are processed by getting the values of the fields that were specified in the orders.properties file (col1 .. col5).

Finally, all the values are packed into a new viewRecord object and added to the resulting list.

 

7.

The valueOfField method fetches the requested field's value from the current row.

Some fields get their value from a pick list. Pick lists are given only on the first row.

The method constructs an XPATH expression, starting from the current ROW node. If the first row is being processed and the field is a pick list, then the VALUE attribute of the PICK_LIST of the named field is used:

. ./FIELD[@NAME='" + fieldName + "']/PICK_LIST / @VALUE)

If the field is not a pick list, then the value is simply the value of the field:

./FIELD[@NAME='" + fieldName + "']

The method returns the value of the node selected by the XPATH expression.


8.

Double-click viewRecord.java in the navigator to open the file.

This is a simple Java class, which holds a record of five strings as the values of five fields.


9.

Expand model.siebel and double-click orders.java to open it in the Visual Editor.

orders.java calls the getView method of the sweData class.

When we were building the application, we used this Java class to create a data control by right-clicking the file and selecting Create Data Control from the context menu, as shown below.

The resulting XML files describe the data control:

 DataControls.dcx describes the generated data control.
 orders.xml describes the data control's method and parameter.
 viewrecord.xml describes the method's return type.

 

10.

Now that we've looked at the application model, click ViewPage1.jspx to revisit the user interface. Notice ordersDataControl in the Data Control Palette.

We used this data control twice when building ViewPage1.jspx.

 The findAllOrders(String) node was dropped on to the page as a parameter form, creating the input field and the button.
 The findAllOrders(String) > viewRecord node was dropped on to the page as an ADF read-only table.

The completed ViewPage1.jspx is shown below.


Back to Topic List

 

Summary

In this lesson, you learned how a WebCenter application can dynamically query Siebel data and parse the XML output coming from the Siebel Web Engine (SWE).

Back to Topic List

Related Information

To learn more about Oracle WebCenter, you can refer to:

 WebCenter demonstrations ( viewlets)
 WebCenter Quick Start page on the OTN Web site
 Oracle WebCenter Framework: Building a WebCenter Application Step by Step ( tutorial )

Back to Topic List

 Place the cursor over this icon to hide all screenshots.

 

 

 

Left Curve
Popular Downloads
Right Curve
Untitled Document