Engine for Web Applications

org.cote.js

Class Index

static org.cote.js

version 2.0.0

Utilities for javascript objects.

This class participates in the engine library.

Index

Example Index

Object Index

Property Index

Method Index

Examples

New Object

Create a new JavaScript object that conforms to the Engine for Web Applications API.

Example Code

// Don't automatically add to registry
var oNewObject = org.cote.js.newObject("DemoType","1.0", false);
// Manually add new object to registry
org.cote.js.registry.ObjectRegistry.addObject(oNewObject);
// Automatically add to registry
var oNewObject2 = org.cote.js.newObject("DemoType","1.0",true);

Object Prototype

This example shows the prototype of an object created with newInstance or modified with prepareObject, and identifies the properties and methods that are created.

Example Code

var oObject = {
   object_type:"specified",
   object_id:"guid",
   ready_state:0,
   object_config:{
      pointers:{
      },
      status:{
      }
   },
   getObjectId:function(){return this.object_id;},
   getObjectType:function(){return this.object_type;},
   getObjectVersion:function(){return this.object_version;},
   getReadyState:function(){return this.ready_state;},
   getStatus:function(){return this.object_config.status;},
   getPointers:function(){return this.object_config.pointers;}
}

Prepare Existing Object

Prepare an existing JavaScript object for use with Engine for Web Applications.

Example Code

function MyObject(){
   this.custom_property = "some value";
}
MyObject.prototype.CustomFunction = function(){
};
var oObject = new MyObject();
org.cote.js.prepareObject("DemoType","1.0",true,oObject);

Objects

EngineObject

API definition for any object that may interoperate with Engine, principally the Object Registry.

Properties

Methods

Properties

class_imports

Merge definitions. Property is private and should not be directly referenced.

Syntax

array = org.cote.js.class_imports

object_version

Version of this object.

Syntax

String = org.cote.js.object_version

Methods

_forName

Creates a specific internal object. Includes the definition for base_object, and supports external definitions via class imports. Method is private and should not be directly referenced.

Syntax

o = _forName( s )

Parameters

Returns

o as object: Object based on the specified name.

_get_gunid

Returns a locally unique id. Method is private and should not be directly referenced.

Syntax

i = _get_gunid( )

Returns

i as String: A locally unique id.

_implements

Implements a specified feature. Method is private and should not be directly referenced.

Syntax

void _implements( o, n, v )

Parameters

combine

Combines the members of the source object with the target object, if the member name does not exist on the source object.

Syntax

o = combine( s, t )

Parameters

Returns

o as object: Target object containing shallow merge of source object members.

GetSpecifiedAttribute

Returns the value of an attribute if it was specified and the length is greater than zero.

Syntax

v = GetSpecifiedAttribute( o, n )

Parameters

Returns

v as String: Value of the attribute.

gnbid

Returns a low impact unique id.

Syntax

i = gnbid( )

Returns

i as String: A simplified unique id.

guid

Returns a unique id.

Syntax

i = guid( )

Returns

i as String: A unique id.

hashlight

Returns a simple hash of the specified value

Syntax

h = hashlight( s )

Parameters

Returns

h as String: A hash of the specified value.

IsAttributeSet

Tests whether an attribute has been set.

Syntax

b = IsAttributeSet( o, n, b )

Parameters

Returns

b as bit: A bit indicating whether the specified attribute was set.

merge

Merges an internal object into the specified. Method is private and should not be directly referenced.

Syntax

h = merge( o, n, s )

Parameters

Returns

h as String: A hash of the specified value.

newObject

Creates and optionally registers a new object ready for use within the Engine for Web Applications framework. The new object, like most other framework objects, implements base_object and exposes the following methods: getObjectVersion, getObjectType, getObjectId, getReadyState, getPointers, and getStatus. This method invokes prepareObject, so there is no need to invoke both newObject and then invoke prepareObject.

Syntax

o = newObject( t, v, r )

Parameters

Returns

o as object: The new framework object.

prepareObject

Prepares and optionally registers a new object ready for use within the Engine for Web Applications framework. The new object, like most other framework objects, implements base_object and exposes the following methods: getObjectVersion, getObjectType, getObjectId, getReadyState, getPointers, and getStatus.

Syntax

void prepareObject( t, v, r, o )

Parameters

static org.cote.js.error

version 2.0.0

Utilities for javascript error handling.

This class participates in the engine library.

Index

Method Index

Methods

traceRoute

Implements a specified feature.

Syntax

trace = traceRoute( o )

Parameters

Returns

trace as String: Call trace of the function.