Show:

config Class

Module: breeze

A singleton object that is the repository of all configuration options.

config.initializeAdapterInstance( {
    modelLibrary: "ko",
    dataService: "webApi"
});

Methods

getAdapter

(
  • interfaceName
  • [adapterName]
)
Function | Null

Returns the ctor function used to implement a specific interface with a specific adapter name.

Parameters:

  • interfaceName String

    One of the following interface names "ajax", "dataService" or "modelLibrary"

  • [adapterName] String optional

    The name of any previously registered adapter. If this parameter is omitted then this method returns the "default" adapter for this interface. If there is no default adapter, then a null is returned.

Returns:

Function | Null:

Returns either a ctor function or null.

getAdapterInstance

(
  • interfaceName
  • [adapterName]
)
An instance of the specified adapter

Returns the adapter instance corresponding to the specified interface and adapter names.

Parameters:

  • interfaceName String

    The name of the interface.

  • [adapterName] String optional
    • The name of a previously registered adapter. If this parameter is omitted then the default implementation of the specified interface is returned. If there is no defaultInstance of this interface, then the first registered instance of this interface is returned.

Returns:

An instance of the specified adapter:

initializeAdapterInstance

(
  • interfaceName
  • adapterName
  • [isDefault=true]
)
An instance of the specified adapter

Initializes a single adapter implementation. Initialization means either newing a instance of the specified interface and then calling "initialize" on it or simply calling "initialize" on the instance if it already exists.

Parameters:

  • interfaceName String

    The name of the interface to which the adapter to initialize belongs.

  • adapterName String
    • The name of a previously registered adapter to initialize.
  • [isDefault=true] Boolean optional
    • Whether to make this the default "adapter" for this interface.

Returns:

An instance of the specified adapter:

initializeAdapterInstances

(
  • config
)

Initializes a collection of adapter implementations and makes each one the default for its corresponding interface.

Parameters:

  • config Object
    • [ajax] String optional
      • the name of a previously registered "ajax" adapter
    • [dataService] String optional
      • the name of a previously registered "dataService" adapter
    • [modelLibrary] String optional
      • the name of a previously registered "modelLibrary" adapter

Returns:

[array of instances]

registerAdapter

(
  • interfaceName
  • adapterCtor
)

Method use to register implementations of standard breeze interfaces. Calls to this method are usually made as the last step within an adapter implementation.

Parameters:

  • interfaceName String
    • one of the following interface names "ajax", "dataService" or "modelLibrary"
  • adapterCtor Function
    • an ctor function that returns an instance of the specified interface.

setProperties

(
  • config
)
deprecated

This method is now OBSOLETE. Use the "initializeAdapterInstances" to accomplish the same result.

Parameters:

  • config Object
    • [remoteAccessImplementation] Implementation of remoteAccess-interface optional
    • [trackingImplementation] Implementation of entityTracking-interface optional
    • [ajaxImplementation] Implementation of ajax-interface optional