Configuring Siebel Open UI > Siebel Open UI Application Programming Interface > Classes and Methods of the Siebel Open UI Application Programming Interface >

Application Model Class


This topic describes the Application Model class. It includes the following topics:

You can use this class to configure Siebel Open UI to call a business service that resides on the Siebel Server. Siebel Open UI defines this class in file.

CallServer Method

The CallServer method sends a request to the Siebel Server. It includes the input property set that the request requires. Siebel Open UI takes care of attaching any default parameters, such as the SWECount parameter, and so forth. It returns nothing.It uses the following syntax:

SiebelApp.S_App.CallServer (inputPS, retPropSet, needProcessResponse, lp);

where:

  • inputPS is an object that contains the input property set.
  • outputPS is an object that contains the output property set. This property set is valid only for a synchronous server request. you must use the lp parameter for an asynchronous request. For more information, see About Synchronous and Asynchronous Requests.
  • needProcessResponse is true or false. Set to true if Siebel Open UI must process the server call for the Siebel Business application.
  • lp is an object that contains information about how to run AJAX.

For example, the following code in the pmodel.js file:

SiebelApp.S_App.CallServer (inPropSet, outPropSet, true, lp);

CanInvokeMethod Method

The CanInvokeMethod method determines if Siebel Open UI can call a method. It returns a string that includes one of the following values:

  • true. Siebel Open UI can call the method.
  • false. Siebel Open UI cannot call the method.

It uses the following syntax:

CanInvokeMethod (methodName)

where:

  • methodName is a string that contains the name of the method that Siebel Open UI examines.

To avoid an error on the Siebel Server, it is recommended that you use CanInvokeMethod immediately before InvokeMethod to make sure Siebel Open UI can call the method.

ClearMainView Method

The ClearMainView method removes the values for the following items:

  • The view
  • All child objects of the view, such as applets and controls
  • The business object that the view references
  • Child objects of the business object that the view references, such as business components and business component fields

ClearMainView only removes values for internal objects that reside in the client. It does not visually destroy these objects.

If the user attempts to use an object that ClearMainView has modified, then Siebel Open UI might not function as expected.

GenerateSrvrReq Method

The GenerateSrvrReq method creates a request string that Siebel Open UI sends to the Siebel Server according to the current context of the application. It returns a string that includes a description of the full request. It uses the following syntax:

GenerateSrvrReq (command)

where:

  • command is a string that identifies the name of the command that Siebel Open UI must request.

For example:

var request = SiebelApp.S_App.GenerateSrvrReq( "LogOff" ) );

In this example, the return value includes a string that contains the following information:

http(s)://server_name/callcenter_enu/start.swe?SWECmd=LogOff&SWEKeepContext=1&SWERPC=1&SRN=L8ct6oeEsPA3Cj7pF6spebyCLm2mVGpB0D0tqGMcflcb&SWEC=18&SWEActiveApplet=Client Active Applet&SWEActiveView=Client Active View

GetAccessibilityEnhanced Method

The GetAccessibilityEnhanced method determines if accessibility is enabled. It returns a string that includes one of the following values:

  • true. Accessibility is enabled.
  • false. Accessibility is not enabled.

GetActiveBusObj Method

The GetActiveBusObj method returns the name of the business object that is currently active in the client. For example:

var busObj = SiebelApp.S_App.GetActiveBusObj();
var busComp = busObj.GetBusCompByName("MyBusComp");
var canUpdate = busComp.CanUpdate();
if (canUpdate){
...

GetActiveView Method

The GetActiveView method returns the name of the view that is currently active in the client. For example:

var view = SiebelApp.S_App.GetActiveView();
var applet = view.GetActiveApplet();
var canUpdate = applet.CanUpdate();
if (canUpdate){
...

GetAppTitle Method

The GetAppTitle method returns the title of the Siebel application in a string. For example:

var appTitle = SiebelApp.S_App.GetAppTitle();
if (appTitle === "Siebel Call Center"){
...

GetAppletControlInstance Method

The GetAppletControlInstance method creates a control. It returns the name of the control. It uses the following syntax:

GetAppletControlInstance ( name, uiType, displayName, width, height)

where:

  • name is a string that contains the name that Siebel Open UI assigns to the control.
  • uiType is a string that identifies the type of the control. For more information, see Siebel Object Types Reference.
  • displayName is a string that contains the name of the control that Siebel Open UI displays in the client.
  • width is a string that contains a number that specifies the width of the control, in pixels.
  • height is a string that contains a number that specifies the height of the control, in pixels.

    For example:

    var myControl = SiebelApp.S_App.GetAppletControlInstance (
    "MyDropDown",
    constants.get("SWE_CTRL_COMBOBOX"),
    "I want this to appear on the screen",
    "50",
    "20");

    GetConstructorFromKey Method

    The GetConstructorFromKey method returns the constructor that Siebel Open UI registers in the client against the rendering key that it passes to the method. It returns this constructor in a string that Siebel Open UI resolves according to the name space. It uses the following syntax:

    GetConstructorFromKey (key)

    where:

    For example:

    var myConstructor = SiebelApp.S_App.GetConstructorFromKey( "CarouselPModel" );
    if (myConstructor){
    // Say myConstructor is "SibelAppFacade.CarouselPM"
    var facadeObj = window[myConstructor.split(".")[0]];
    var constructorObj = facadeObj[myConstructor.split(".")[1]];
    var carouselPMObject = new constructorObj(this);
    ...

    You can use GetConstructorFromKey to create an instance of the constructor to meet your customization requirements

    RegisterConstructorAgainstKey Method

    The RegisterConstructorAgainstKey method registers a constructor string that Siebel Open UI resolves according to the name space that it uses against a rendering key. It uses the following syntax:

    RegisterConstructorAgainstKey (key, constructor)

    where:

    • key is a string that identifies the name of the rendering key. For more information, see About the Rendering Key.
    • constructor is a string that identifies the name of the constructor that Siebel Open UI uses when it encounters the key.

    For example:

    var CarouselConstructor = "SiebelAppFacade.CarouselPModel";
    SiebelApp.S_App.RegisterConstructorAgainstKey( "CarouselPM", CarouselPMConstructor );

    GetDirection Method

    The GetDirection method returns one of the following values:

    • RTL. Siebel Open UI is configured so the user reads text from right-to-left.
    • Null. Siebel Open UI is not configured so the user reads text from right-to-left.

    GetName Method

    The GetName method returns the name of Siebel business application. For example, Siebel Call Center. It returns this value as a string. It uses the following syntax:

    GetName()

    It includes no parameters.

    For example:

    activeView.ExecuteFrame (activeApplet.GetName(), [{field: this.Get( "SearchField" ), value: this.Get( "SearchValue" )}])

    GetPageURL Method

    The GetPageURL method returns the URL that the Siebel business application uses. It returns this value without a query string. For example, it can return the following value:

    http://computerName.corp.siebel.com/start.swe

    It uses the following syntax:

    GetPageURL()

    The GetPageURL method includes no parameters.

    For example:

    finalurl = SiebelApp.S_App.GetPageURL() + strURL.split("start.swe")[1];

    GetProfileAttr Method

    The GetProfileAttr method returns the value of a user profile attribute.

    GetProfileAttr (attributeName)

    where:

    • attributeName is a string that includes the name of an attribute.

    SetProfileAttr Method

    The SetProfileAttr method assigns a value to a user profile attribute.

    SetProfileAttr (attributeName, attributeValue)

    where:

    • attributeName is a string that includes the name an attribute.
    • attributeValue is a string that includes the value Siebel Open UI sets. If attributeValue is empty, then Siebel Open UI sets the attribute value to null.

    GetService Method

    The GetService method creates a business service proxy that calls a business service method. It creates an instance of a business service object that allows the interface to call a method on this business service.It returns the name of the business service object.

    It uses use the following syntax:

    SiebelApp.S_App.GetService( "name") );

    where:

    • name is a string that identifies the name of the business service that Siebel Open UI calls when it creates the proxy instance.
    Example

    Assume you must configure Siebel Open UI to call a business service from custom code that resides on the client, and that this code does not bind an applet control that resides in the repository to a business service. You can use the GetService method to instantiate the service proxy that Siebel Open UI uses to call any method on the business service.

    Assume you must call the following business service:

    Task UI Service (SWE)

    The following code instantiates the proxy instance for this business service:

    var service = SiebelApp.S_App.GetService( "Task UI Service (SWE)" ) );

    You can configure Siebel Open UI to call any method on this business service after this instance is available. For example, the following code calls the GoToInbox method on the Task UI Service (SWE) business service:

    if( service ){ outPS = service.InvokeMethod( "GoToInbox", inPS,true ); }

    For more information about InvokeMethod, see Business Service Class and InvokeMethod Method.

    RemoveService Method

    The RemoveService method removes a service from the client. It uses the following syntax:

    RemoveService (service)

    where:

    • service identifies the name of the service that Siebel Open UI removes.

    For example, the following code removes the service that the GetService method references:

    var service = SiebelApp.S_App.GetService( "Task UI Service (SWE)" ) );
    // Use service
    ...
    //Remove service
    if (service){

    If you use RemoveService to remove a service that does not exist, then Siebel Open UI might not behave as predicted.

    GotoView Method

    The GotoView method navigates the user to a view in the client. It uses the following syntax:

    SiebelApp.S_App.GotoView(view, viewId, strURL, strTarget);

    where:

    • view is an object that contains the name of the view. Other parameters are optional.
    • viewId is an object that contains the Id of the view.
    • strURL is an object that contains an optional query string that Siebel Open UI passes as part of the GotoView method. This string must use the HTTP query string format that Siebel CRM requires. For example:

      "SWEParam1=valueForParam1&SWEParam2=valueForParam2"

    • strTarget is an object that contains the string target.

    For example, assume the view object contains a value of Account List View. The following code navigates the user to this view:

    SiebelApp.S_App.GotoView(view, viewId, strURL, strTarget);

    Siebel Open UI does the following work when it runs the GotoView method:

    1. Changes the cursor state to busy.
    2. Runs any required validation steps. if a validation fails in the client, then it returns false and exits the GotoView method. Implicit Commit is an example of a validaiton.
    3. Adds additional default parameters.
    4. Sends a request to the Siebel Server.
    5. Navigates the user to the view that viewName specifies.

    IsExtendedKeyBoard Method

    The IsExtendedKeyBoard method returns one of the following values:

    • true. Siebel Open UI is configured to use extended keyboard shortcuts.
    • false. Siebel Open UI is not configured to use extended keyboard shortcuts.

    It includes no parameters.

    IsMobileApplication Method

    The IsMobileApplication method determines if Mobile is enabled for the Siebel application that is currently running in the client. It returns a string that includes one of the following values:

    • true. Mobile is enabled.
    • false. Mobile is not enabled.

    It uses the following syntax:

    IsMobileApplication()

    It includes no parameters.

    For example, the following code determines if Mobile is enabled, and then does something if IsMobileApplication does not return a value of true:

    if ( SiebelApp.S_App.IsMobileApplication() !== "true" )

    InvokeMethod Method

    The InvokeMethod method calls a method. It returns a value from the method that it calls. It uses the following syntax:

    SiebelApp.S_App.InvokeMethod( "methodName", psObject, lp );

    where:

    • methodName identifies the name of the method that Siebel Open UI calls.
    • psObject is an object that contains the property set object that Siebel Open UI passes to the method that InvokeMethod calls, if required.
    • lp is an object that contains information about how to run AJAX.

    The following example changes the next applet to become the active applet of the view:

    SiebelApp.S_App.InvokeMethod( "NextApplet", psObject, lp );

    LogOff Method

    The LogOff method calls the Siebel Server and returns the Login page to the user.

    LookupStringCache Method

    The LookupStringCache method gets a string from the client string cache. It uses the following syntax:

    LookupStringCache (index)

    where:

    • index is a number that identifies the location of a string in the client string cache.

    For example:

    // Assume appletControl to be the reference of an applet control.
    var justification = appletControl.GetJustification(); //Returns text justification in index.
    var stringJustification = SiebelApp.S_App.LookupStringCache (justification);
    alert (justification); // Will alert "Left" or "Right"

    NewProperty Set Method

    The NewPropertySet method creates a new property set object. It returns the object reference for this new property set. It uses the following syntax:

    NewPropertySet ()

    It includes no parameters.

    For example, the following code in the alarm.js file:

    var returnPropSet = App ().NewPropertySet();

    SetDiscardUserState Method

    The SetDiscardUserState method sets a property in the client that instructs Siebel Open UI to not evaluate the state before it navigates to another view. It uses the following syntax:

    SetDiscardUserState (bDiscard)

    where :

    • bDiscard contains one of the following Boolean values:
      • true. Ignore the state before doing navigation. Siebel Open UI applies this logic for all potential states, such as a commit is pending, Siebel Open UI is currently opening a dialog box, and so on. Siebel Open UI runs any GotoView call it receives. It loses the client state.
      • false. Do not ignore the state before doing navigation. Do the client validation.

    For example:

    // A business condition is met that requires Siebel Open UI to automatically navigate the user.
    SiebelApp.S_App.DiscardUserState (true);
    // Don't care about user state - we need the navigation to occur.
    SiebelApp.S_App.GotoView ("MyView".. );
    // Reset
    SiebelApp.S_App.DiscardUserState (false);

  • Configuring Siebel Open UI Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Legal Notices.