Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataService

A DataService instance is used to encapsulate the details of a single 'service'; this includes a serviceName, a dataService adapterInstance, and whether the service has server side metadata.

You can construct an EntityManager with either a serviceName or a DataService instance, if you use a serviceName then a DataService is constructed for you. (It can also be set via the EntityManager.setProperties method).

The same applies to the MetadataStore.fetchMetadata method, i.e. it takes either a serviceName or a DataService instance.

Each metadataStore contains a list of DataServices, each accessible via its ‘serviceName’. ( see MetadataStore.getDataService and MetadataStore.addDataService). The ‘addDataService’ method is called internally anytime a MetadataStore.fetchMetadata call occurs with a new dataService ( or service name).

Hierarchy

  • DataService

Index

Constructors

constructor

  • DataService constructor

    var dataService = new DataService({
        serviceName: altServiceName,
        hasServerMetadata: false
    });
    var metadataStore = new MetadataStore({
        namingConvention: NamingConvention.camelCase
    });
    return new EntityManager({
        dataService: dataService,
        metadataStore: metadataStore
    });

    Parameters

    Returns DataService

Properties

Optional adapterInstance

adapterInstance: DataServiceAdapter

The [[IDataServiceAdapter]] implementation instance associated with this EntityManager. Read Only

adapterName

adapterName: string

The adapter name for the [[IDataServiceAdapter]] to be used with this service. Read Only

hasServerMetadata

hasServerMetadata: boolean

Whether the server can provide metadata for this service. Read Only

jsonResultsAdapter

jsonResultsAdapter: JsonResultsAdapter

The JsonResultsAdapter used to process the results of any query against this DataService. Read Only

serviceName

serviceName: string

The serviceName for this DataService. Read Only

Optional uriBuilder

uriBuilder: UriBuilderAdapter

The [[IUriBuilderAdapter]] implementation instance associated with this EntityManager. Read Only

uriBuilderName

uriBuilderName: string

The adapter name for the [[IUriBuilderAdapter]] to be used with this service. Read Only

useJsonp

useJsonp: boolean

Whether to use JSONP when performing a 'GET' request against this service. Read Only

Methods

qualifyUrl

  • qualifyUrl(suffix: string): string
  • Returns a url for this dataService with the specified suffix. This method handles dataService names either with or without trailing '/'s. If the suffix starts with "http" then it will be returned as-is.

    method

    qualifyUrl

    Parameters

    • suffix: string

      The resulting url.

    Returns string

toJSON

  • toJSON(): Object

using

Static fromJSON

Static resolve

Generated using TypeDoc