Configuring Siebel Open UI > Example of Customizing Siebel Open UI > Process of Customizing the Presentation Model >

Creating the Presentation Model


This task is a step in Process of Customizing the Presentation Model.

The presentation model uses the Init method to configure the properties, methods, and bindings of the presentation model, and the Setup method to extract the values that a property set contains. For more information about these methods, see Life Cycle of User Interface Elements.

Figure 19 illustrates the code you use to create the presentation model. Each number in this figure identifies the corresponding step number in the numbered task list that this book includes immediately after this figure.

Figure 19. Setting Up the Presentation Model

To create the presentation model

  1. Create the custom presentation model file:
    1. Download a copy of the recyclebinpmodel.js file to the following folder:

    INSTALL_DIR\eappweb\PUBLIC\language_code\build_number\scripts\siebel\custom

    This topic describes how to modify code that resides in the recyclebinpmodel.js file. It is recommended that you get a copy of this file to assist in your understanding of how to implement the example that this topic describes. This file includes all the code that this example uses. It also includes more comments that describe code functionality. To get a copy of this file, see Article ID 1494998.1 on My Oracle Support.

    For more information about the folders you can use to store your customizations, see Organizing Files That You Customize. For more information about the language_code, see Languages That Siebel Open UI Supports.

    1. Use a JavaScript editor to open the recyclebinpmodel.js file that you downloaded in Step a.
  2. Make sure the RecycleBinPModel class does not exist and that you do not configure Siebel Open UI to override this class. You add the following code:

    if(typeof(SiebelAppFacade.RecycleBinPModel) === "undefined"){

  3. Make sure a namespace exists that Siebel Open UI can use to prevent conflicts:

    SiebelJS.Namespace("SiebelAppFacade.RecycleBinPModel");

  4. Use the Define method to identify the presentation model file:

    define("siebel/custom/recyclebinpmodel", [], function(){

    You must use the Define method to make sure Siebel Open UI can identify the constructor. You must include the relative path and the name of the presentation model file without the file name extension. For more information, see Define Method.

  5. Define the class:

    SiebelAppFacade.RecycleBinPModel = (function(){

  6. Load the SiebelApp.Constants namespace that defines the constants that Siebel Open UI uses:

    var consts = SiebelJS.Dependency("SiebelApp.Constants");

  7. Define the class constructor:

    function RecycleBinPModel(){
      SiebelAppFacade.RecycleBinPModel.superclass.constructor.apply(this, arguments);
    }

  8. Set up the injected dependency:

    SiebelJS.Extend(RecycleBinPModel, SiebelAppFacade.ListPresentationModel);

    For more information about injected dependency, see About Dependency Injection.

  9. Return the constructor:

        return RecycleBinPModel;
      } ());
      return "SiebelAppFacade.RecycleBinPModel";
    });

  10. Save the recyclebinpmodel.js file.
Configuring Siebel Open UI Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Legal Notices.