v7.3.0
SupportExamplesFree Trial

AbstractCrudManager
Abstract

This is an abstract class serving as the base for the CrudManager class. It implements basic mechanisms to organize batch communication with a server. Yet it does not contain methods related to data transfer nor encoding. These methods are to be provided in sub-classes by consuming the appropriate mixins.

For example, this is how the class can be used to implement an JSON encoding system:

// let's make new CrudManager using AJAX as a transport system and JSON for encoding
class MyCrudManager extends JsonEncode(AjaxTransport(AbstractCrudManager)) {

}

Data transfer and encoding methods

These are methods that must be provided by subclasses of this class:

See also

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • true to automatically persist store changes after edits are made in any of the stores monitored. Please note that sync request will not be invoked immediately but only after autoSyncTimeout interval.

  • The timeout in milliseconds to wait before persisting changes to the server. Used when autoSync is set to true.

  • Specify as true to force sync requests to be sent when calling sync(), even if there are no local changes. Useful in a polling scenario, to keep client up to date with the backend.

    Has a corresponding runtime forceSync property.

  • Set to true to make STM ignore changes coming from the backend. This will allow user to only undo redo local changes.

    Has a corresponding runtime ignoreRemoteChangesInSTM property.

  • Field name to be used to transfer a phantom record identifier.

  • Field name to be used to transfer a phantom parent record identifier.

  • True to reset identifiers (defined by idField config) of phantom records before submitting them to the server.

  • When true treats parsed responses without success property as successful. In this mode a parsed response is treated as invalid if it has explicitly set success : false.

  • When true forces the CRUD manager to process responses depending on their type attribute. So load request may be responded with sync response for example. Can be used for smart server logic allowing the server to decide when it's better to respond with a complete data set (load response) or it's enough to return just a delta (sync response).

  • true to write all fields from the record to the server. If set to false it will only send the fields that were modified. Note that any fields that have persist set to false will still be ignored and fields having alwaysWrite set to true will always be included.

  • Internal listeners, that cannot be removed by the user.

Properties

Properties are getters/setters or publicly accessible variables on this class
  • isAbstractCrudManager : Booleantrue
    READONLY
    static
    ADVANCED
    Identifies an object as an instance of AbstractCrudManager class, or subclass thereof.
  • Identifies an object as an instance of AbstractCrudManagerMixin class, or subclass thereof.
  • Identifies an object as an instance of AbstractCrudManagerValidation class, or subclass thereof.
  • isDelayable : Booleantrue
    READONLY
    static
    ADVANCED
    Delayable
    Identifies an object as an instance of Delayable class, or subclass thereof.
  • isEvents : Booleantrue
    READONLY
    static
    ADVANCED
    Events
    Identifies an object as an instance of Events class, or subclass thereof.
  • properties : Object
    internal
    static
    Base

    A class property getter for the default values of internal properties for this class.

  • revision : Number
    READONLY

    The server revision stamp. The revision stamp is a number which should be incremented after each server-side change. This property reflects the current version of the data retrieved from the server and gets updated after each load and sync call.

  • A list of registered stores whose server communication will be collected into a single batch. Each store is represented by a store descriptor.

    Has a corresponding stores config.

  • Returns the data from all CrudManager crudStores in a format that can be consumed by inlineData.

  • emptyArray : Array
    internal
    READONLY
    Base

    An empty array that can be used as a default value.

  • emptyObject : Object
    internal
    READONLY
    Base

    An empty object that can be used as a default value.

  • The server revision stamp. The revision stamp is a number which should be incremented after each server-side change. This property reflects the current version of the data retrieved from the server and gets updated after each load and sync call.

  • A list of registered stores whose server communication will be collected into a single batch. Each store is represented by a store descriptor.

    Has a corresponding crudStores config.

  • Specify as true to force sync requests to be sent when calling sync(), even if there are no local changes. Useful in a polling scenario, to keep client up to date with the backend.

    Has a corresponding forceSync config.

  • Set to true to make STM ignore changes coming from the backend. This will allow user to only undo redo local changes.

    Has a corresponding ignoreRemoteChangesInSTM config.

  • Returns true if changes tracking is suspended

  • Returns true if the crud manager is currently loading data

  • Returns true if the crud manager is currently syncing data

  • isLoading : Boolean
    READONLY

    Returns true if the crud manager is currently loading data

  • Generates unique request identifier.

  • An array of stores presenting an alternative sync responses apply order. Each store is represented by a store descriptor.

    Has a corresponding syncApplySequence config.

  • isAbstractCrudManager : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of AbstractCrudManager class, or subclass thereof.
  • config : Object
    READONLY
    ADVANCED
    Base

    Returns a copy of the full configuration which was used to configure this object.

  • isConstructing : Boolean
    READONLY
    ADVANCED
    Base

    This property is set to true before the constructor returns.

  • isDestroying : Boolean
    READONLY
    ADVANCED
    Base

    This property is set to true on entry to the destroy method. It remains on the objects after returning from destroy(). If isDestroyed is true, this property will also be true, so there is no need to test for both (for example, comp.isDestroying || comp.isDestroyed).

Functions

Functions are methods available for calling on the class
  • onClassMixedIn( )
    internal
    static
    Base

    This optional class method is called when a class is mixed in using the mixin() method.

  • initClass( )
    static
    ADVANCED
    Base

    Registers this class type with its Factory

  • Accepts all changes in all stores, resets the modification tracking:

    • Clears change tracking for all records
    • Clears added
    • Clears modified
    • Clears removed Leaves the store in an "unmodified" state.
  • Reverts all changes in all stores and re-inserts any records that were removed locally. Any new uncommitted records will be removed.

  • Suspends automatic sync upon store changes. Can be called multiple times (it uses an internal counter).

  • Suspends hasChanges and noChanges events.

  • Internal function used to hook destroy() calls when using thisObj

  • Internal function used restore hooked destroy() calls when using thisObj

  • doDestroy( )
    internal
    Events

    Auto detaches listeners registered from start, if set as detachable

  • once( )
    private
    Events

    Internal function used to run a callback function after an event is triggered

  • Removes all listeners registered to this object by the application.

Events

Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

Event handlers

Event handlers are callbacks called as a result of certain actions in this class

Type definitions

Source path

Scheduler/crud/AbstractCrudManager.js

Contents