Utilities for javascript objects.
This class participates in the engine library.
Create a new JavaScript object that conforms to the Engine for Web Applications API.
// 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);This example shows the prototype of an object created with newInstance or modified with prepareObject, and identifies the properties and methods that are created.
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 an existing JavaScript object for use with Engine for Web Applications.
function MyObject(){
this.custom_property = "some value";
}
MyObject.prototype.CustomFunction = function(){
};
var oObject = new MyObject();
org.cote.js.prepareObject("DemoType","1.0",true,oObject);Merge definitions. Property is private and should not be directly referenced.
array = org.cote.js.class_imports
Version of this object.
String = org.cote.js.object_version
Creates a specific internal object. Method is private and should not be directly referenced.
o = _forName( s )
o as object: Object based on the specified name.
Returns a locally unique id. Method is private and should not be directly referenced.
i = _get_gunid( )
i as String: A locally unique id.
Implements a specified feature. Method is private and should not be directly referenced.
void _implements( o, n, v )
Returns a low impact unique id.
i = gnbid( )
i as String: A simplified unique id.
Returns a unique id.
i = guid( )
i as String: A unique id.
Returns a simple hash of the specified value
h = hashlight( s )
h as String: A hash of the specified value.
Merges an internal object into the specified. Method is private and should not be directly referenced.
h = merge( o, n, s )
h as String: A hash of the specified value.
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.
o = newObject( t, v, r )
o as object: The new framework object.
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.
void prepareObject( t, v, r, o )