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

Application Model Class


This topic describes the methods that Siebel Open UI uses with the Application Model class. It includes the following information:

CanInvokeMethod Method for Application Models

The CanInvokeMethod method that Siebel Open UI uses for application models determines whether or not Siebel Open UI can invoke a method. It uses the same syntax as the CanInvokeMethod method that Siebel Open UI uses for presentation models. For more information, see CanInvokeMethod Method for Presentation Models.

ClearMainView Method

The ClearMainView method removes 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 uses the following syntax:

ClearMainView()

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

If the user attempts to use an object that ClearMainView has cleared, then Siebel Open UI might not work 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 whether or not accessibility is enabled. It returns a string that includes one of the following values:

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

It uses the following syntax:

GetAccessibilityEnhanced()

It includes no arguments.

GetActiveBusObj Method

The GetActiveBusObj method returns the name of the business object that is currently active in the client. It uses the following syntax:

GetActiveBusObj()

It includes no arguments.

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. It uses the following syntax:

GetActiveView()

It includes no arguments.

For example:

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

For more examples that use the GetActiveView method, see the following topics:

GetAppletControlInstance Method

The GetAppletControlInstance method creates a control. It returns the name of the control that it creates. 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");

    For another example that uses the GetAppletControlInstance method, see Customizing the Setup Logic of the Presentation Model.

    GetAppTitle Method

    The GetAppTitle method returns the title of the current Siebel application. It returns this title in a string. It uses the following syntax:

    GetAppTitle()

    It includes no arguments.

    For example:

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

    GetDirection Method

    The GetDirection method determines the direction that Siebel Open UI uses to display text. It 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.

    It uses the following syntax:

    GetDirection()

    It includes no arguments.

    GetName Method for Application Models

    The GetName method that Siebel Open UI uses for application models returns the name of the current Siebel application. For example, Siebel Call Center. It returns this name in a string. It uses the following syntax:

    GetName()

    It includes no arguments.

    For example:

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

    For information about the GetName method that Siebel Open UI uses for other classes, see GetName Method for Applets see GetName Method for Applet Controls.

    GetPageURL Method

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

    http://computer_name.example.com/start.swe

    It uses the following syntax:

    GetPageURL()

    It includes no arguments.

    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. It uses the following syntax:

    GetProfileAttr (attribute_name)

    where:

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

    For examples that use the GetProfileAttr method, see Adding Custom Manifest Expressions and Configuring Siebel Open UI to Use Different Web Templates According to the Applet Mode.

    GetService Method

    The GetService method creates a business service instance that allows Siebel Open UI to call a business service method that this business service instance contains. It returns the business service name. It uses the following syntax:

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

    where:

    • name is a string that identifies the name of the business service that GetService calls when it creates the business service instance.

    For 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 create a business service instance that Siebel Open UI can use to call a business service method that this business service contains.

    Assume you must configure Siebel Open UI to call the following business service:

    Task UI Service (SWE)

    The following code creates an instance of this business service:

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

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

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

    For more examples that use GetService, see the following topics:

    For information about Siebel Open UI uses GetService with InvokeMethod, see InvokeMethod Method for Business Services.

    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. It is required. Other arguments are optional.
    • viewId is an object that contains the Id of the view.
    • strURL is an object that contains a string that Siebel Open UI sends 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 view contains a value of Account List View. The following code navigates the user to this view:

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

    For more examples that use the GotoView method, see the following topics:

    For more information about using this method, see Life Cycle Flows of User Interface Elements.

    Work That Siebel Open UI Does When it Runs the GotoView Method

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

    1. Sets the cursor state to busy.
    2. Runs any required validation steps. If a validation fails in the client, then Siebel Open UI returns a value of false and exits the GotoView method. Implicit Commit is an example of a validation.
    3. Adds default arguments.
    4. Sends a request to the Siebel Server.
    5. Navigates the user to the view that view specifies.

    InvokeMethod Method for Application Models

    The InvokeMethod method that Siebel Open UI uses for application models calls a method. It returns a value from the method that it calls. It uses the following syntax:

    SiebelApp.S_App.InvokeMethod("method_name", psObject, ai);

    where:

    • method_name identifies the name of the method that InvokeMethod calls.
    • psObject is an object that contains a property set that InvokeMethod sends as input to the method that it calls, if required.
    • ai is an object that contains information about how to run AJAX. For more information, see Values That You Can Set for the AI Argument.

    For example, the following code calls the NextApplet method. This method sets the next applet as the active applet of a view:

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

    For more examples that use the InvokeMethod method, including for Disconnected clients, see the following topics:

    For more information about using InvokeMethod, see Calling Methods for Applets and Business Services.

    For more information about the InvokeMethod method that Siebel Open UI uses for other classes, see InvokeMethod Method for Presentation Models and InvokeMethod Method for Business Services.

    Values That You Can Set for the AI Argument

    You can use the ai (additional input) argument to specify how Siebel Open UI runs an AJAX (Asynchronous JavaScript And XML) request. For more information about AJAX, see the Web site that describes Including Ajax Functionality in a Custom JavaServer Faces Component at http://www.oracle.com/technetwork/java/javaee/tutorial-jsp-140089.html.

    Table 31 lists the values that you can use with the ai argument. For example, to use the async value, you use ai.async.

    Table 31. Values That You Can Set for the AI Argument
    Value
    Description

    async

    Asynchronous. Set to one of the following values:

    • true. Siebel Open UI makes an asynchronous AJAX call.
    • false. Siebel Open UI makes a synchronous AJAX call.

    cb

    Callback. Identifies the method that Siebel Open UI calls after it receives a reply from the AJAX call. For more information, see Coding Callback Methods.

    scope

    Set to the following value:

    this

    errcb

    Error callback. Identifies the method that Siebel Open UI calls after it receives a reply from the AJAX call if this AJAX call fails. For more information, see Coding Callback Methods.

    opdecode

    Decode operation. Set to one of the following values:

    • true. Decode the AJAX reply.
    • false. Do not decode the AJAX reply.

    mask

    Set to one of the following values:

    • true. Mask the screen.
    • false. Do not mask the screen.

    If selfbusy is true, then mask does nothing.

    selfbusy

    Determines whether or not Siebel Open UI displays a busy cursor while it processes the AJAX request. Set to one of the following values:

    • true. Do not display a busy cursor.
    • false. Display a busy cursor.

    IsExtendedKeyBoard Method

    The IsExtendedKeyBoard method determines whether or not Siebel Open UI is configured to use extended keyboard shortcuts. It 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 uses the following syntax:

    IsExtendedKeyBoard()

    It includes no arguments.

    IsMobileApplication Method

    The IsMobileApplication method determines whether or not 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 arguments.

    For an example that uses the IsMobileApplication method, see Determining Whether or Not Siebel Open UI Is Enabled for Siebel Mobile.

    LogOff Method

    The LogOff method calls the Siebel Server, and then returns the Login page to the client. It uses the following syntax:

    LogOff()

    It includes no arguments.

    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 that resides 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"

    For another example that uses the LookupStringCache method, see GetPrompt Method.

    NewProperty Set Method

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

    NewPropertySet ()

    It includes no arguments.

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

    var returnPropSet = App ().NewPropertySet();

    For more examples that use the NewPropertySet method, see Customizing the Presentation Model to Delete Records and Allowing Users to Interact with Clients During Business Service Calls.

    RemoveService Method

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

    RemoveService (business_service_name)

    where:

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

    For example, the following code removes the Task UI Service (SWE) business service:

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

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

    SetDiscardUserState Method

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

    SetDiscardUserState (binary)

    where:

    • binary is one of the following 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 © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.