Configuring Siebel Open UI > Reference Information for Siebel Open UI >

Browser Script Compatibility


Siebel Open UI supports your existing browser script. However, it is recommended that you customize a presentation model instead of using browser script. It is recommended that you gradually move any logic that you implement through your existing browser script to the presentation model.

You can write a browser script in JavaScript. This script can interact with the Document Object Model (DOM) and with the Siebel Object Model that is available in the Web browser through a shadow object. You can script the behavior of Siebel events and the browser events that the DOM exposes.

Siebel Open UI uses a JavaScript environment that allows you to implement browser scripting. This JavaScript API can dynamically refresh page content and instantly commit customization modifications. If your implementation currently uses browser scripting, then you can refactor JavaScript to move from your existing employee application to Siebel Open UI. Refactoring is the process of modifying the internal structure of existing code without modifying the external behavior of this code. For more information about this JavaScript API, see Siebel Open UI Application Programming Interface.

Sequence That Siebel Open UI with Custom Browser Script

The following pseudocode describes the sequence that Siebel Open UI uses if your deployment includes custom browser script:

PR calls a PM method or event
  PM method or event calls an applet proxy method
    applet proxy method calls Applet_PreInvokeMethod on browser script
    applet proxy uses Call-Server to run applet method on Siebel Server
    PM runs Attach Pre Proxy binding for this applet method
    applet proxy calls Applet_InvokeMethod that resides in browser script
    PM runs Attach Post Proxy binding for this applet method
    applet proxy method ends
  PM method or event ends
PR call ends

where:

  • PR is the physical renderer
  • PM is the presentation model

For example, the following pseudocode describes the sequence that Siebel Open UI uses if the user clicks New in an applet, and if your deployment includes custom browser script that uses a method named NewRecord:

PR calss PM.OnControlEvent
  PM.OnControlEvent calls Applet.InvokeMethod
    Applet.InvokeMethod calls BrowserScript.Applet_PreInvokeMethod
    Applet.InvokeMethod calls Siebel Server to run NewRecord method on applet
    PM calls PM.AttachPreProxyExecuteBinding for the NewRecord method
    Applet.InvokeMethod calls BrowserScript.Applet_InvokeMethod
    PM calls PM.AttachPostProxyExecuteBinding for the NewRecord method
    Applet.InvokeMethod ends
  PM.OnControlEvent ends
PR call ends

How Siebel Open UI Handles Custom Client Scripts

Siebel Open UI uses browser script through a JavaScript shadow object, which is a type of object that Siebel Open UI uses for client scripting. All other client objects include a corresponding shadow object, except for the PropertySet. For example, the JSSApplet object includes the JSSAppletShadow shadow object. Siebel Open UI exposes this shadow object to scripting. When Siebel Open UI prepares to display the applet, SWE determines whether or not a browser script is defined for this applet. If this script exists, then Siebel Open UI downloads the browser script file that contains the definition of the shadow object from the Siebel Server to the client.

For example, assume you write a browser script for an applet to handle the PreInvokeMethod event. At run-time, Siebel Open UI creates a JavaScript object that it derives from the JSSAppletShadow object. It runs the PreInvokeMethod event and the event handler of the shadow object before it calls the DoInvokeMethod event. Each shadow object includes a reference to the underlying object. The shadow object sends the call to this underlying object, if necessary. For more information about deriving values, see About Using This Book.

How Siebel Open UI Creates Shadow Objects for Applications

Siebel Open UI creates an application shadow object with the following application object during application startup:

Application InvokeMethod
......................
bRet = this.*FirePreInvokeMethod*(methodName, inputPS);
;return from here if the return value of the PreInvokeMethod is CancelOperation
; continue to invokemethod if the return value is ContinueOperation
......................
this.DoInvokeMethod (methodName, args);
this.*FireInvokeMethod*(methodName, inputPS);

How Siebel Open UI Creates Shadow Objects for Business Objects

Siebel Open UI uses a business object shadow object only in other shadow objects, such as an application shadow object, applet shadow object, or business component shadow object.

How Siebel Open UI Creates Shadow Objects for Applets, Business Components, or Business Services

Siebel Open UI does the following to create a shadow object for an applet, business component, or business service:

  • Siebel Server. Siebel Open UI creates the ObjInfo (SWE_PROP_SHADOW) shadow when it encounters an object that includes a custom script that you write. The server gets the class name and the file name of the shadow from the SRF. It packages the class name and file name into the SWE_PROP_SHADOW, and then sends it to client.
  • Client. Siebel Open UI gets the class name and the file name from SWE_PROP_SHADOW, loads the script file, creates the shadow object with the retrieved class name, and then stores the shadow pointer in the applet object or the business component object.

The process is the same for a business service except Siebel Open UI uses the SWE_PST_SERVICE_SHADOWS shadow.

How Siebel Open UI Creates Shadow Objects for Controls

Siebel Open UI does the following to create a shadow object for a control:

  • Siebel Server. Siebel Open UI creates the ObjInfo (SWE_PROP_SHADOW) shadow object if it encounters a control that includes a script that you write. It gets the event name of the control from the SRF. It packages event names into the SWE_PST_SCRIPTS shadow, and then sends it to client.
  • Client. Siebel Open UI gets the list of control events from the SWE_PST_SCRIPTS shadow, and then calls these methods from the corresponding predefined methods.

Browser Script Object Types

You can use the following object types in browser script:

  • Application
  • Applet
  • Control
  • Business object
  • Business component
  • Business service property

Event Handlers You Can Use to Handle Predefined Events

Table 53 describes the event handlers that you can use in browser script to handle a predefined event for a Siebel object type.

Table 53. Event Handlers You Can Use in Browser Script for a Siebel Object Type
Object Type
Event Handler

Application

You can use the following event handlers:

  • Application_InvokeMethod
  • Application_PreInvokeMethod

Applet

You can use the following event handlers:

  • Applet_ChangeFieldValue
  • Applet_ChangeRecord
  • Applet_InvokeMetohd
  • Applet_PreInvokeMethod
  • Applet_Load

Business component

You can use the following event handler:

  • BusComp_PreSetFieldValue

Business service

You can use the following event handlers:

  • Service_InvokeMethod
  • Service_PreCanInvokeMethod
  • Service_PreInvokeMethod

Event Handlers You Can Use to Handle Predefined DOM Events

Table 54 describes the event handlers that you can use in browser script to handle a predefined DOM event for a Siebel control object type.

Table 54. DOM Event Handlers You Can Use in Browser Script for a Siebel Object Type
Object Type
Event Handler

Control in a high-interactivity client.

You can use the following event handlers:

  • OnBlur
  • OnFocus

Control in a standard interactivity client.

You can use the following event handlers:

  • onfocus
  • onblur
  • onmouseover
  • onmouseout
  • onclick
  • onchange

Methods You Can Use in Browser Script

Table 55 describes the methods that you can use in a browser script for each Siebel object type that Oracle's Siebel Open UI can use.

Table 55. Methods You Can Use in Browser Script for Each Siebel Object Type
Object Type
Method

Applet

You can use the following methods:

  • ActiveMode
  • BusComp
  • BusObject
  • FindActiveXControl
  • FindControl
  • InvokeMethod
  • Name
  • ReInit

Application

You can use the following methods:

  • FindApplet
  • ActiveApplet
  • ActiveViewName
  • ActiveBusObject
  • ActiveBusComp
  • FindBusObject
  • GetProfileAttr
  • GetService
  • InvokeMethod
  • IsReady
  • Name
  • NewPropertySet
  • SWEAlert
  • ShowModalDialog
  • SeblTrace

Business Component

You can use the following methods:

  • BusObject
  • GetFieldValue
  • GetFormattedFieldValue
  • GetSearchExpr
  • GetSearchSpec
  • InvokeMethod
  • Name
  • SetFieldValue
  • SetFormattedFieldValue
  • WriteRecord

Business Object

You can use the following methods:

  • FirstBusComp
  • GetBusComp
  • Name
  • NextBusComp

Business Service

You can use the following methods:

  • InvokeMethod
  • Name
  • SetProperty
  • PropertyExists
  • RemoveProperty
  • GetProperty
  • GetFirstProperty
  • GetNextProperty

Control

You can use the following methods:

  • Applet
  • BusComp
  • GetValue
  • Name
  • SetValue
  • SetReadOnly
  • SetEnabled
  • SetVisible
  • SetProperty
  • GetLabelProperty
  • GetProperty
  • SetLabelProperty

Property Set

You can use the following methods:

  • AddChild
  • Copy
  • GetChild
  • GetChildCount
  • GetFirstProperty
  • GetNextProperty
  • GetProperty
  • GetPropertyCount
  • GetType
  • GetValue
  • InsertChildAt
  • PropertyExists
  • RemoveChild
  • RemoveProperty
  • Reset
  • SetProperty
  • SetType
  • SetValue
Configuring Siebel Open UI Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.