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
- public object_config (internal): Object API structure for storing sub structures: object_config.pointers and object_config.status.
- public object_id (internal): Unique instance identifier.
- public object_type (internal): The type of this object.
- public object_version (internal): Version of the object class.
- public ready_state (internal): Object load and execution state. Follows: 0 unitialized, 1 through 3 variant, 4 ready, 5 destroyed.
Method Index
- public 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.
- public bindElement: Binds the specified node to the specified Engine object.
- public clearEngine: Clears the specified Engine object, and destroys all components of the Engine.
- public clearEngines: Clears all Engine objects, and destroys all components in each Engine.
- public destroy: Prepares this object for destruction, and destroys all Engine objects.
- public getComponentFromEngine: Returns the specified component from the specified engine.
- public getEngine: Returns the specified Engine object.
- public getEngineByName: Returns the specified Engine object.
- public getEngines: Returns an array of Engine objects.
- public getObjectId: Returns the unique id of the object.
- public getObjectType: Returns the type of the object.
- public getObjectVersion: Returns the version of the object.
- public getPointers: Returns the object_config.pointers sub structure.
- public getPrimaryEngine: Returns the Engine object that is the primary engine for the service.
- public getReadyState: Returns the state of the object.
- public getStatus: Returns the object_config.status sub structure.
- public getTaskService: Returns the TaskService used by this EngineService instance.
- public getWireService: Returns the WireService used by this EngineService instance.
- public isEngine: Returns true if the specified name exists.
- public 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.
- public 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.
- public setConfigurationTaskName: Specifies the name of the task responsible for loading any external configuration for this EngineService instance. The default value is load_engine_config.
- public setDefaultConfiguration: Sets the default configuration name. The configuration name should match an EngineService configuration file entry.
- public setPrimaryEngineAction: Sets the action to perform for the primary engine, if that engine did not define a different action. The default is no action.
- public 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.
- public 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.
- public 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.
- public sigterm: Sends a termination signal to this object.
Message Index
- public onengineconfigload: Message published to all subscribers when configuration has been loaded.
Objects
Engine
Properties
- engine_element as object: The DOM Node associated with this Engine.
- engine_id as String: The unique identifier of this Engine object.
- engine_name as String: The friendly name of this Engine object.
- engine_index as int: The ordinal index of this Engine object.
- config_name as String: The configuration name for this Engine object. This value specifically applies to an Engine Configuration file.
- task as Task: The task object associated with this Engine. All Engines are bootstrapped with a Task object.
- is_primary as boolean: Bit indicating whether this is the primary engine. There can only be one primary engine per EngineService instance.
- engine_implementations as array: Cache of implementation constructors used to build the content within the Engine.
- data_variant as array: Array of variant values.
Methods
- object = getContainer(
)
- String = getDataPath(
)
- String = getDataSource(
)
- int = getDataVariant(
)
- object = getObject(
i)
- object = getObjectByName(
n)
- array = getObjects(
)
- PrimitiveWire = getPrimitiveWire(
n)
- boolean = isObjectByName(
n)
- void Processor(
o, v)
- void setDataPath(
s)
- void setDataSource(
s)
- void setDataVariant(
i, v)
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
- o as Engine : An Engine object.
- c as String : Name of EngineService configuration.
bindElement
Binds the specified node to the specified Engine object.
Syntax
b = bindElement(
o, n
)
Parameters
- o as Engine : An Engine object.
- n as DOM Node : An XML or HTML DOM Node.
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
- i as variant : Name or object reference of the Engine object to clear.
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
- i as String : Identifier of an engine.
- c as String : Identifier of a component created for the enigne.
- b as boolean : Bit indicating whether the component container should be returned, if a container exists.
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
- i as int : Index of the Engine object.
Returns
e as Engine: XHTMLForm object.
getEngineByName
Returns the specified Engine object.
Syntax
e = getEngineByName(
n
)
Parameters
- n as String : Name of the element.
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
- i as variant : Name or index of the Engine object..
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
- b as boolean : Bit indicating that a primary engine should be defined if one is not specified. This param will always be true if any engine exists and none are marked as primary.
- o as object (optional): Object in which to search for potential engine element declarations.
- pr as function (optional): Processor to assign to the engine. Used for pre-processing XML templates and configuration.
- xr as function (optional): XML Handler to use when invoking setInnerXHTML.
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
- b as boolean : Bit indicating whether auto-loading is enabled.
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
- s as String : The name of the task that loads the configuration file for the engine service.
setDefaultConfiguration
Sets the default configuration name. The configuration name should match an EngineService configuration file entry.
Syntax
void setDefaultConfiguration(
s
)
Parameters
- s as String : The default configuration name to use when loading an engine and when the engine does not specify a configuration.
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
- s as String : The action to perform for the primary engine.
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
- s as String : The type of action to perform for the primary engine.
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
- s as String : The handler to perform for the primary engine.
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
- s as String : The type of handler to perform for the primary engine.
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
- o as EngineObject : The EngineObject for which the configuration was loaded.