Engine for Web Applications

org.cote.js.engine

Class Index

static org.cote.js.engine.EngineService

version

A static instance of EngineServiceImpl.

This class participates in the engine library.

org.cote.js.engine.EngineServiceImple

version

A service for creating containers in which code and content relationships can be managed.

This class participates in the engine library.

Index

Object Index

Property Index

Method Index

Message Index

Objects

Engine

Properties

Methods

Properties

object_config

Object API structure for storing sub structures: object_config.pointers and object_config.status.

Syntax

object = object.object_config

object_id

Unique instance identifier.

Syntax

String = object.object_id

object_type

The type of this object.

Syntax

String = object.object_type

object_version

Version of the object class.

Syntax

String = object.object_version

ready_state

Object load and execution state. Follows: 0 unitialized, 1 through 3 variant, 4 ready, 5 destroyed.

Syntax

int = object.ready_state

Methods

applyConfiguration

Applies the speciifed configuration to the specified engine. This can be used to repurpose Engine objects, or to load alternate content into the Engine.

Syntax

void applyConfiguration( o, c )

Parameters

bindElement

Binds the specified node to the specified Engine object.

Syntax

b = bindElement( o, n )

Parameters

Returns

b as boolean: True if the node was bound to the engine, false otherwise.

clearEngine

Clears the specified Engine object, and destroys all components of the Engine.

Syntax

void clearEngine( i )

Parameters

clearEngines

Clears all Engine objects, and destroys all components in each Engine.

Syntax

void clearEngines( )

destroy

Prepares this object for destruction, and destroys all Engine objects.

Syntax

void destroy( )

getComponentFromEngine

Returns the specified component from the specified engine.

Syntax

o = getComponentFromEngine( i, c, b )

Parameters

Returns

o as object: Returns an XHTMLComponent, ApplicationComponent, or DOM Node, depending on the specified parameters. If not returning the container, then the return object will be an object registered with the ObjectRegistry.

getEngine

Returns the specified Engine object.

Syntax

e = getEngine( i )

Parameters

Returns

e as Engine: XHTMLForm object.

getEngineByName

Returns the specified Engine object.

Syntax

e = getEngineByName( n )

Parameters

Returns

e as Engine: Engine object.

getEngines

Returns an array of Engine objects.

Syntax

a = getEngines( )

Returns

a as array: Array of Engine objects.

getObjectId

Returns the unique id of the object.

Syntax

i = getObjectId( )

Returns

i as String: The unique object instance id.

getObjectType

Returns the type of the object.

Syntax

t = getObjectType( )

Returns

t as String: The type of the object instance.

getObjectVersion

Returns the version of the object.

Syntax

v = getObjectVersion( )

Returns

v as String: The version of the object instance.

getPointers

Returns the object_config.pointers sub structure.

Syntax

o = getPointers( )

Returns

o as object: The object_config.pointers substructure.

getPrimaryEngine

Returns the Engine object that is the primary engine for the service.

Syntax

e = getPrimaryEngine( )

Returns

e as Engine: The primary Engine object.

getReadyState

Returns the state of the object.

Syntax

s = getReadyState( )

Returns

s as int: The object ready state.

getStatus

Returns the object_config.status sub structure.

Syntax

o = getStatus( )

Returns

o as object: The object_config.status substructure.

getTaskService

Returns the TaskService used by this EngineService instance.

Syntax

t = getTaskService( )

Returns

t as TaskService: Instance of a TaskService.

getWireService

Returns the WireService used by this EngineService instance.

Syntax

w = getWireService( )

Returns

w as WireService: Instance of a WireService.

isEngine

Returns true if the specified name exists.

Syntax

b = isEngine( i )

Parameters

Returns

b as boolean: Bit indicating whether the specified object name exists.

loadEngines

Finds all engine nodes on the current Web page and loads them. An engine node is either an engine element, or a div element with an is-engine attribute.

Syntax

void loadEngines( b, o, pr, xr )

Parameters

newEngineObject

Creates a new Engine object.

Syntax

o = newEngineObject( e, i, n, k, x )

Parameters

Returns

o as EngineObject: New engine object.

setAutoLoad

Specifies whether all engines should start loading automatically after the window onload event fires. Auto loading is only effective when set prior to the window loading.

Syntax

void setAutoLoad( b )

Parameters

setConfigurationTaskName

Specifies the name of the task responsible for loading any external configuration for this EngineService instance. The default value is load_engine_config.

Syntax

void setConfigurationTaskName( s )

Parameters

setDefaultConfiguration

Sets the default configuration name. The configuration name should match an EngineService configuration file entry.

Syntax

void setDefaultConfiguration( s )

Parameters

setPrimaryEngineAction

Sets the action to perform for the primary engine, if that engine did not define a different action. The default is no action.

Syntax

void setPrimaryEngineAction( s )

Parameters

setPrimaryEngineActionType

Sets the type of action to perform for the primary engine, if that engine did not define a different action type. The default is nothing.

Syntax

void setPrimaryEngineActionType( s )

Parameters

setPrimaryEngineHandler

Sets the handler to perform for the primary engine, if that engine did not define a different handler. The default is engine_service_initialized.

Syntax

void setPrimaryEngineHandler( s )

Parameters

setPrimaryEngineHandlerType

Sets the type of handler to perform for the primary engine, if that engine did not define a different handler type. The default is event.

Syntax

void setPrimaryEngineHandlerType( s )

Parameters

sigterm

Sends a termination signal to this object.

Syntax

void sigterm( )

Messages

onengineconfigload

Message published to all subscribers when configuration has been loaded.

Syntax

// User-specified script to subscribe to message
org.cote.js.message.MessageService.subscribe("onengineconfigload",_handle_message);
// Internal: how the message is published to subscribers
org.cote.js.message.MessageService.publish("onengineconfigload" , o );
// User-specified script to handle the message subscription
function _handle_message("onengineconfigload" , o ){
// message handler code
}

Parameters