Warning: Use of undefined constant Symbol - assumed 'Symbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215 Warning: Use of undefined constant JavaScriptSymbol - assumed 'JavaScriptSymbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215 Warning: count(): Parameter must be an array or an object that implements Countable in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/JavaScriptSymbol.php on line 69

dojox/data/ServiceStore.js

  • Provides:

    • dojox.data.ServiceStore
  • dojox.data.ServiceStore

    • type
      Function
    • parameters:
      • options: (typeof Keyword)
        arguments
        The *schema* parameter
        This is a schema object for this store. This should be JSON Schema format.
        
        The *service* parameter
        This is the service object that is used to retrieve lazy data and save results
        The function should be directly callable with a single parameter of an object id to be loaded
        
        The *idAttribute* parameter
        Defaults to 'id'. The name of the attribute that holds an objects id.
        This can be a preexisting id provided by the server.
        If an ID isn't already provided when an object
        is fetched or added to the store, the autoIdentity system
        will generate an id for it and add it to the index.
        
        The *estimateCountFactor* parameter
        This parameter is used by the ServiceStore to estimate the total count. When
        paging is indicated in a fetch and the response includes the full number of items
        requested by the fetch's count parameter, then the total count will be estimated
        to be estimateCountFactor multiplied by the provided count. If this is 1, then it is assumed that the server
        does not support paging, and the response is the full set of items, where the
        total count is equal to the numer of items returned. If the server does support
        paging, an estimateCountFactor of 2 is a good value for estimating the total count
        It is also possible to override _processResults if the server can provide an exact
        total count.
        
        The *syncMode* parameter
        Setting this to true will set the store to using synchronous calls by default.
        Sync calls return their data immediately from the calling function, so
        callbacks are unnecessary. This will only work with a synchronous capable service.
    • summary
      ServiceStore constructor, instantiate a new ServiceStore
      A ServiceStore can be configured from a JSON Schema. Queries are just
      passed through to the underlying services
    • description
      ServiceStore can do client side caching and result set updating if
      dojox.data.ClientFilter is loaded. Do this add:
      	dojo.require("dojox.data.ClientFilter")
      prior to loading the ServiceStore (ClientFilter must be loaded before ServiceStore).
      To utilize client side filtering with a subclass, you can break queries into
      client side and server side components by putting client side actions in
      clientFilter property in fetch calls. For example you could override fetch:
      	fetch: function(args){
      		// do the sorting and paging on the client side
      		args.clientFilter = {start:args.start, count: args.count, sort: args.sort};
      		// args.query will be passed to the service object for the server side handling
      		return this.inherited(arguments);
      	}
      When extending this class, if you would like to create lazy objects, you can follow
      the example from dojox.data.tests.stores.ServiceStore:
      	var lazyItem = {
      		_loadObject: function(callback){
      			this.name="loaded";
      			delete this._loadObject;
      			callback(this);
      		}
      	};
      setup a byId alias to the api call
  • dojox.data.ServiceStore.service

    • type
      Object
  • dojox.data.ServiceStore.constructor

    • constructor - constructor
    • type
      Function
    • parameters:
      • options: (typeof Keyword)
        arguments
        The *schema* parameter
        This is a schema object for this store. This should be JSON Schema format.
        
        The *service* parameter
        This is the service object that is used to retrieve lazy data and save results
        The function should be directly callable with a single parameter of an object id to be loaded
        
        The *idAttribute* parameter
        Defaults to 'id'. The name of the attribute that holds an objects id.
        This can be a preexisting id provided by the server.
        If an ID isn't already provided when an object
        is fetched or added to the store, the autoIdentity system
        will generate an id for it and add it to the index.
        
        The *estimateCountFactor* parameter
        This parameter is used by the ServiceStore to estimate the total count. When
        paging is indicated in a fetch and the response includes the full number of items
        requested by the fetch's count parameter, then the total count will be estimated
        to be estimateCountFactor multiplied by the provided count. If this is 1, then it is assumed that the server
        does not support paging, and the response is the full set of items, where the
        total count is equal to the numer of items returned. If the server does support
        paging, an estimateCountFactor of 2 is a good value for estimating the total count
        It is also possible to override _processResults if the server can provide an exact
        total count.
        
        The *syncMode* parameter
        Setting this to true will set the store to using synchronous calls by default.
        Sync calls return their data immediately from the calling function, so
        callbacks are unnecessary. This will only work with a synchronous capable service.
    • summary
      ServiceStore constructor, instantiate a new ServiceStore
      A ServiceStore can be configured from a JSON Schema. Queries are just
      passed through to the underlying services
    • description
      ServiceStore can do client side caching and result set updating if
      dojox.data.ClientFilter is loaded. Do this add:
      	dojo.require("dojox.data.ClientFilter")
      prior to loading the ServiceStore (ClientFilter must be loaded before ServiceStore).
      To utilize client side filtering with a subclass, you can break queries into
      client side and server side components by putting client side actions in
      clientFilter property in fetch calls. For example you could override fetch:
      	fetch: function(args){
      		// do the sorting and paging on the client side
      		args.clientFilter = {start:args.start, count: args.count, sort: args.sort};
      		// args.query will be passed to the service object for the server side handling
      		return this.inherited(arguments);
      	}
      When extending this class, if you would like to create lazy objects, you can follow
      the example from dojox.data.tests.stores.ServiceStore:
      	var lazyItem = {
      		_loadObject: function(callback){
      			this.name="loaded";
      			delete this._loadObject;
      			callback(this);
      		}
      	};
      setup a byId alias to the api call
  • dojox.data.ServiceStore.schema

    • type
      Object
  • dojox.data.ServiceStore.idAttribute

    • type
      Object
  • dojox.data.ServiceStore.labelAttribute

    • type
      String
  • dojox.data.ServiceStore.syncMode

    • type
      bool
  • dojox.data.ServiceStore.estimateCountFactor

    • type
      Number
  • dojox.data.ServiceStore.getSchema

    • type
      Function
  • dojox.data.ServiceStore.loadLazyValues

    • type
      Object
  • dojox.data.ServiceStore.getValue

    • parameters:
      • item: (typeof Object)
        The item to get the value from
      • property: (typeof String)
        property to look up value for
      • defaultValue: (typeof value)
        the default value
    • returns
      return the plain value since it was found;
    • summary
      Gets the value of an item's 'property'
    • type
      Function
  • dojox.data.ServiceStore.getValues

    • parameters:
      • item: (typeof object)
      • property: (typeof string)
        property to look up value for
    • summary
      Gets the value of an item's 'property' and returns
      it.	If this value is an array it is just returned,
      if not, the value is added to an array and that is returned.
    • type
      Function
  • dojox.data.ServiceStore.getAttributes

    • parameters:
      • item: (typeof object)
    • summary
      Gets the available attributes of an item's 'property' and returns
      it as an array.
    • type
      Function
  • dojox.data.ServiceStore.hasAttribute

    • parameters:
      • item: (typeof object)
      • attribute: (typeof string)
    • summary
      Checks to see if item has attribute
    • type
      Function
  • dojox.data.ServiceStore.containsValue

    • parameters:
      • item: (typeof object)
      • attribute: (typeof string)
      • value: (typeof anything)
    • summary
      Checks to see if 'item' has 'value' at 'attribute'
    • type
      Function
  • dojox.data.ServiceStore.isItem

    • parameters:
      • item: (typeof object)
        attribute: /* string
    • summary
      Checks to see if the argument is an item
    • type
      Function
  • dojox.data.ServiceStore.isItemLoaded

    • parameters:
      • item: (typeof object)
    • summary
      Checks to see if the item is loaded.
    • type
      Function
  • dojox.data.ServiceStore.loadItem

    • parameters:
      • args
    • summary
      Loads an item and calls the callback handler. Note, that this will call the callback
      handler even if the item is loaded. Consequently, you can use loadItem to ensure
      that an item is loaded is situations when the item may or may not be loaded yet.
      If you access a value directly through property access, you can use this to load
      a lazy value as well (doesn't need to be an item).
    • example
      store.loadItem({
      item: item, // this item may or may not be loaded
      onItem: function(item){
      // do something with the item
      }
      });
    • type
      Function
  • dojox.data.ServiceStore._currentId

    • type
      Number
  • dojox.data.ServiceStore._processResults

    • parameters:
      • results
      • deferred
    • type
      Function
  • dojox.data.ServiceStore.close

    • parameters:
      • request
    • type
      Function
  • dojox.data.ServiceStore.fetch

    • parameters:
      • args
    • summary
      See dojo.data.api.Read.fetch
      
      The *queryOptions.cache* parameter
      If true, indicates that the query result should be cached for future use. This is only available
      if dojox.data.ClientFilter has been loaded before the ServiceStore
      
      The *syncMode* parameter
      Indicates that the call should be fetch synchronously if possible (this is not always possible)
      
      The *clientFetch* parameter
      This is a fetch keyword argument for explicitly doing client side filtering, querying, and paging
    • type
      Function
  • dojox.data.ServiceStore._doQuery

    • parameters:
      • args
    • type
      Function
  • dojox.data.ServiceStore.getFeatures

    • summary
      return the store feature set
    • type
      Function
  • dojox.data.ServiceStore.getLabel

    • parameters:
      • item
    • type
      Function
  • dojox.data.ServiceStore.getLabelAttributes

    • parameters:
      • item
    • summary
      returns an array of attributes that are used to create the label of an item
    • type
      Function
  • dojox.data.ServiceStore.getIdentity

    • parameters:
      • item
    • type
      Function
  • dojox.data.ServiceStore.getIdentityAttributes

    • parameters:
      • item
    • summary
      returns the attributes which are used to make up the
      identity of an item.	Basically returns this.idAttribute
    • type
      Function
  • dojox.data.ServiceStore.fetchItemByIdentity

    • parameters:
      • args
    • summary
      fetch an item by its identity, by looking in our index of what we have loaded
    • type
      Function
  • dojox.data.ServiceStore.byId

  • dojox.data.ServiceStore._index

    • type
      Object
  • dojox.data

    • type
      Object
  • dojox

    • type
      Object