Packageorg.granite.tide
Classpublic dynamic class BaseContext
InheritanceBaseContext Inheritance mx.utils.ObjectProxy
ImplementsIEntityManager
SubclassesContext, Context, Context, Context, Context

BaseContext is the base implementation of the component/entity container context It is mostly an abstract class that is not exposed directly. Instead the user will get one of its subclasses.



Public Properties
 PropertyDefined by
  meta_contextManager : IContextManager
[read-only]
BaseContext
  meta_destination : String
[read-only] Returns the RemoteObject destination for this context
BaseContext
  meta_dirty : Boolean
[read-only] Entity manager is dirty when any entity/collection/map has been modified
BaseContext
  meta_dirtyCheckEnabled : Boolean
[write-only] Enables or disabled dirty checking in this context
BaseContext
  meta_finished : Boolean
[read-only] Indicates if the current conversation has been marked as finished by the server
BaseContext
  meta_lazyInitializationDisabled : Boolean = false
Allows to disable automatic loading of lazy collections
BaseContext
  meta_parentContext : BaseContext
[read-only]
BaseContext
  meta_tide : Tide
[read-only] Returns the Tide singleton for this context
BaseContext
Protected Properties
 PropertyDefined by
  _tide : Tide
BaseContext
Public Methods
 MethodDefined by
  
BaseContext(tide:Tide = null, parentContext:BaseContext = null)
BaseContext
  
addContextEventListener(type:String, handler:Function, remote:Boolean = false):void
Registers a tide context event listener (should be done with [Observer])
BaseContext
  
allByType(serviceClass:Class, create:Boolean = false):Array
Returns all component instances in this context implementing the specified class/interface
BaseContext
  
bindIn(componentName:String, component:Object, propName:Object, create:Boolean = true, contextPropName:Object = null):void
Binds a component property from a context variable (should be done with [In])
BaseContext
  
bindOut(componentName:String, component:Object, propName:Object, contextPropName:Object = null):void
Binds a component property to a context variable (should be done with [Out])
BaseContext
  
bindProperty(site:Object, prop:Object, host:Object, chain:Object, commitOnly:Boolean = false):ChangeWatcher
[static]
BaseContext
  
byType(serviceClass:Class, create:Boolean = false):Object
Returns the current component instance implementation in this context for the specified class/interface
BaseContext
  
dispatchEvent(event:Event):Boolean
Dispatches a context event
BaseContext
  
injectByType(type:Class, component:Object, componentName:String, propName:Object, create:Boolean = true):void
Binds a component property from a context variable (should be done with [In])
BaseContext
  
meta_clearDirtyState(dispatch:Boolean = true):void
Clear the current dirty state context
BaseContext
  
meta_continue(merge:Boolean = true):void
Continues the current context: restart a new conversation with the same context content when the server has ended the current conversation Only applicable to conversation contexts
BaseContext
  
meta_deepDirty(entity:IEntity):Boolean
BaseContext
  
meta_destroy(name:String, force:Boolean = false):void
Destroys/reset a component
BaseContext
  
meta_end(merge:Boolean = true):void
Ends the current context Only applicable to conversation contexts
BaseContext
  
meta_getContext(name:*, component:Object):BaseContext
Returns the context where the component instance is stored
BaseContext
  
meta_getInstance(name:*, create:Boolean = false, forceNoCreate:Boolean = false, noProxy:Boolean = false):*
Returns the component instance in this context
BaseContext
  
Returns the component instance in this context but never creates proxies
BaseContext
  
meta_getOwnerEntities(object:Object):Array
BaseContext
  
meta_getRefs(object:Object):Array
BaseContext
  
Return the current set of dirty properties
BaseContext
  
meta_isEntityChanged(entity:IEntity, propName:String = null, value:* = null):Boolean
Check if entity has changed since last save point
BaseContext
  
meta_isEntityPropertyChanged(entity:IEntity, propertyName:String, value:Object):Boolean
Check if entity property has been changed since last remote call
BaseContext
  
meta_isGlobal():Boolean
BaseContext
  
meta_isObjectInitialized(object:Object):Boolean
Indicates if an object is initialized For non managed objects, always return true
BaseContext
  
meta_mergeExternalData(obj:Object, prev:Object = null, sourceSessionId:String = null, removals:Array = null, persists:Array = null):Object
Merge an object coming from the server in the context
BaseContext
  
Merge conversation context variables in global context Only applicable to conversation contexts
BaseContext
  
Merge conversation context variables in parent context Only applicable to conversation contexts
BaseContext
  
meta_objectEquals(obj1:Object, obj2:Object):Boolean
Equality for objects, using uid property when possible
BaseContext
  
Discard changes of all cached entities from last version received from the server
BaseContext
  
Discard changes of entity from last version received from the server
BaseContext
  
meta_resync(resultHandler:Function = null, faultHandler:Function = null):AsyncToken
Resync current context with server (similar to invoke with no operation)
BaseContext
  
BaseContext
  
raiseEvent(type:String, ... params):void
Dispatches a context event (possibly in a subcontext)
BaseContext
  
raiseGlobalEvent(type:String, ... params):void
Dispatches a context event (always in the global context)
BaseContext
  
toString(object:Object):String
[static] Convenient toString implementation which avoids triggering collection initialization
BaseContext
  
unbindIns(componentName:String):void
Unbinds all [In] component properties
BaseContext
  
unbindOuts(componentName:String):void
Unbinds all [Out] component properties
BaseContext
Protected Methods
 MethodDefined by
  
meta_internalRaiseEvent(type:String, params:Array):void
BaseContext
Property detail
meta_contextManagerproperty
meta_contextManager:IContextManager  [read-only]

This property can be used as the source for data binding.

Implementation
    public function get meta_contextManager():IContextManager
meta_destinationproperty 
meta_destination:String  [read-only]

Returns the RemoteObject destination for this context

This property can be used as the source for data binding.

Implementation
    public function get meta_destination():String
meta_dirtyproperty 
meta_dirty:Boolean  [read-only]

Entity manager is dirty when any entity/collection/map has been modified

This property can be used as the source for data binding.

Implementation
    public function get meta_dirty():Boolean
meta_dirtyCheckEnabledproperty 
meta_dirtyCheckEnabled:Boolean  [write-only]

Enables or disabled dirty checking in this context

This property can be used as the source for data binding.

Implementation
    public function set meta_dirtyCheckEnabled(value:Boolean):void
meta_finishedproperty 
meta_finished:Boolean  [read-only]

Indicates if the current conversation has been marked as finished by the server

This property can be used as the source for data binding.

Implementation
    public function get meta_finished():Boolean
meta_lazyInitializationDisabledproperty 
public var meta_lazyInitializationDisabled:Boolean = false

Allows to disable automatic loading of lazy collections

meta_parentContextproperty 
meta_parentContext:BaseContext  [read-only]

This property can be used as the source for data binding.

Implementation
    public function get meta_parentContext():BaseContext
meta_tideproperty 
meta_tide:Tide  [read-only]

Returns the Tide singleton for this context

This property can be used as the source for data binding.

Implementation
    public function get meta_tide():Tide
_tideproperty 
protected var _tide:Tide
Constructor detail
BaseContext()constructor
public function BaseContext(tide:Tide = null, parentContext:BaseContext = null)Parameters
tide:Tide (default = null)
 
parentContext:BaseContext (default = null)
Method detail
addContextEventListener()method
public function addContextEventListener(type:String, handler:Function, remote:Boolean = false):void

Registers a tide context event listener (should be done with [Observer])

Parameters
type:String — event type
 
handler:Function — function callback
 
remote:Boolean (default = false) — listener for remote events
allByType()method 
public function allByType(serviceClass:Class, create:Boolean = false):Array

Returns all component instances in this context implementing the specified class/interface

Parameters
serviceClass:Class — class/interface to implement
 
create:Boolean (default = false) — create instance of component if not instantiated

Returns
Array — the current implementation in the context
bindIn()method 
public function bindIn(componentName:String, component:Object, propName:Object, create:Boolean = true, contextPropName:Object = null):void

Binds a component property from a context variable (should be done with [In])

Parameters
componentName:String — component name
 
component:Object — component instance
 
propName:Object — property name
 
create:Boolean (default = true) — no instance created when create = false
 
contextPropName:Object (default = null) — context variable name
bindOut()method 
public function bindOut(componentName:String, component:Object, propName:Object, contextPropName:Object = null):void

Binds a component property to a context variable (should be done with [Out])

Parameters
componentName:String — component name
 
component:Object — component instance
 
propName:Object — property name
 
contextPropName:Object (default = null) — context variable name
bindProperty()method 
public static function bindProperty(site:Object, prop:Object, host:Object, chain:Object, commitOnly:Boolean = false):ChangeWatcherParameters
site:Object
 
prop:Object
 
host:Object
 
chain:Object
 
commitOnly:Boolean (default = false)

Returns
ChangeWatcher
byType()method 
public function byType(serviceClass:Class, create:Boolean = false):Object

Returns the current component instance implementation in this context for the specified class/interface

Parameters
serviceClass:Class — class/interface to implement
 
create:Boolean (default = false) — create instance of component if not instantiated

Returns
Object — the current implementation in the context
dispatchEvent()method 
public override function dispatchEvent(event:Event):Boolean

Dispatches a context event

Parameters
event:Event — event type

Returns
Boolean
injectByType()method 
public function injectByType(type:Class, component:Object, componentName:String, propName:Object, create:Boolean = true):void

Binds a component property from a context variable (should be done with [In])

Parameters
type:Class — injection point class
 
component:Object — target component instance
 
componentName:String — target component name
 
propName:Object — property name
 
create:Boolean (default = true) — no instance created when create = false
meta_clearDirtyState()method 
public function meta_clearDirtyState(dispatch:Boolean = true):void

Clear the current dirty state context

Parameters
dispatch:Boolean (default = true) — dispatch a PropertyChangeEvent on meta_dirty if the context was dirty before clearing
meta_continue()method 
public function meta_continue(merge:Boolean = true):void

Continues the current context: restart a new conversation with the same context content when the server has ended the current conversation Only applicable to conversation contexts

Parameters
merge:Boolean (default = true) — merge conversation context in global context
meta_deepDirty()method 
public function meta_deepDirty(entity:IEntity):BooleanParameters
entity:IEntity

Returns
Boolean
meta_destroy()method 
public function meta_destroy(name:String, force:Boolean = false):void

Destroys/reset a component

Parameters
name:String — component name
 
force:Boolean (default = false) — true for forcing complete removal of instance
meta_end()method 
public function meta_end(merge:Boolean = true):void

Ends the current context Only applicable to conversation contexts

Parameters
merge:Boolean (default = true) — merge conversation context in global context
meta_getContext()method 
public function meta_getContext(name:*, component:Object):BaseContext

Returns the context where the component instance is stored

Parameters
name:* — component name
 
component:Object — component instance

Returns
BaseContext — context
meta_getInstance()method 
public function meta_getInstance(name:*, create:Boolean = false, forceNoCreate:Boolean = false, noProxy:Boolean = false):*

Returns the component instance in this context

Parameters
name:* — name of the component/context variable
 
create:Boolean (default = false) — instantiate if not present
 
forceNoCreate:Boolean (default = false) — never instantiate a new component in any case
 
noProxy:Boolean (default = false) — don't create remote proxy if not found

Returns
*
meta_getInstanceNoProxy()method 
public function meta_getInstanceNoProxy(name:*):*

Returns the component instance in this context but never creates proxies

Parameters
name:* — name of the component/context variable

Returns
*
meta_getOwnerEntities()method 
public function meta_getOwnerEntities(object:Object):ArrayParameters
object:Object

Returns
Array
meta_getRefs()method 
public function meta_getRefs(object:Object):ArrayParameters
object:Object

Returns
Array
meta_getSavedProperties()method 
public function meta_getSavedProperties():Dictionary

Return the current set of dirty properties

Returns
Dictionary — map of saved properties
meta_internalRaiseEvent()method 
protected function meta_internalRaiseEvent(type:String, params:Array):voidParameters
type:String
 
params:Array
meta_isEntityChanged()method 
public function meta_isEntityChanged(entity:IEntity, propName:String = null, value:* = null):Boolean

Check if entity has changed since last save point

Parameters
entity:IEntity — entity to restore
 
propName:String (default = null) — property name
 
value:* (default = null)

Returns
Boolean — entity is dirty
meta_isEntityPropertyChanged()method 
public function meta_isEntityPropertyChanged(entity:IEntity, propertyName:String, value:Object):Boolean

Check if entity property has been changed since last remote call

Parameters
entity:IEntity — entity to check
 
propertyName:String — property to check
 
value:Object — current value to compare with saved value

Returns
Boolean — true is value has been changed
meta_isGlobal()method 
public function meta_isGlobal():Boolean

Returns
Boolean — true if this is the global context
meta_isObjectInitialized()method 
public function meta_isObjectInitialized(object:Object):Boolean

Indicates if an object is initialized For non managed objects, always return true

Parameters
object:Object

Returns
Boolean — true when initialized
meta_mergeExternalData()method 
public function meta_mergeExternalData(obj:Object, prev:Object = null, sourceSessionId:String = null, removals:Array = null, persists:Array = null):Object

Merge an object coming from the server in the context

Parameters
obj:Object — external object
 
prev:Object (default = null) — existing object on which incoming data has to be merged
 
sourceSessionId:String (default = null) — sessionId of the incoming data (null when from current session)
 
removals:Array (default = null)
 
persists:Array (default = null)

Returns
Object — merged object (should === prev when prev not null)
meta_mergeInGlobalContext()method 
public function meta_mergeInGlobalContext():void

Merge conversation context variables in global context Only applicable to conversation contexts

meta_mergeInParentContext()method 
public function meta_mergeInParentContext():void

Merge conversation context variables in parent context Only applicable to conversation contexts

meta_objectEquals()method 
public function meta_objectEquals(obj1:Object, obj2:Object):Boolean

Equality for objects, using uid property when possible

Parameters
obj1:Object — object
 
obj2:Object — object

Returns
Boolean — true when objects are instances of the same entity
meta_resetAllEntities()method 
public function meta_resetAllEntities():void

Discard changes of all cached entities from last version received from the server

meta_resetEntity()method 
public function meta_resetEntity(entity:IEntity):void

Discard changes of entity from last version received from the server

Parameters
entity:IEntity — entity to restore
meta_resync()method 
public function meta_resync(resultHandler:Function = null, faultHandler:Function = null):AsyncToken

Resync current context with server (similar to invoke with no operation)

Parameters
resultHandler:Function (default = null) — result handler
 
faultHandler:Function (default = null) — fault handler

Returns
AsyncToken — the operation token
newTemporaryContext()method 
public function newTemporaryContext():BaseContext

Returns
BaseContext
raiseEvent()method 
public function raiseEvent(type:String, ... params):void

Dispatches a context event (possibly in a subcontext)

Parameters
type:String — event type
 
... params — optional event parameters
raiseGlobalEvent()method 
public function raiseGlobalEvent(type:String, ... params):void

Dispatches a context event (always in the global context)

Parameters
type:String — event type
 
... params — optional event parameters
toString()method 
public static function toString(object:Object):String

Convenient toString implementation which avoids triggering collection initialization

Parameters
object:Object — object to describe

Returns
String — toString
unbindIns()method 
public function unbindIns(componentName:String):void

Unbinds all [In] component properties

Parameters
componentName:String — component name
unbindOuts()method 
public function unbindOuts(componentName:String):void

Unbinds all [Out] component properties

Parameters
componentName:String — component name