Object Definition File |
Open Client Administration |
The Object Definition File is a JavaScript JSON object (with a file type of json) that defines the plugin constructor function and the resources that must be loaded by the browser.
The definition object defined in the file has the following properties:
Item |
Description |
constructorFunction |
Name of the Embedded object constructor function that will be in the proiv.plugins.eo.constructors object. |
Resources |
An array of objects where each object defines a file that the browser must load before the Embedded object is created. Each resource consists of two properties: file is the path to the file starting from the folder that holds the Object Definition File, type is the type of resource file and can be script (JavaScript) or css (cascading style sheet). |
synchronousMethods
|
An array of numbers that refer to all the synchronous functions that can be called on the Embedded object. Synchronous functions are functions that must return a result to PROIV after they are called. The Embedded object may have other functions that are not synchronous, but they do not need to be referenced here. |
OC |
This is a reserved object and is set by Open Client (see the Creating a Plugin section) when the plugin is instantiated. This object should not be used in the Object Definition File as any data put in it will be thrown away. This object does not need to be present in the Object Definition File. |
The definition object may contain any other initialisation properties that can be used by the interface object.
Below is an example of an Embedded object interface file that is located at …/appObjects/myApp/TreeView.UserControl.json
/*
* An OpenClient Embedded object definition.
* name: TreeViewUserControl
* description: A tree control.
*/
proiv.plugins.eo.definitions["TreeView.UserControl"] = {
constructorFunction: "TreeControl",
resources: [
{file:"treeControl.js",type:"script"},
{file:"dhtml/dhtmlxcommon.js",type:"script"},
{file:"dhtml/dhtmlxtree.js",type:"script"},
{file:"dhtml/ext/dhtmlxtree_json.js",type:"script"},
{file:"dhtml/dhtmlxtree.css",type:"css"}
],
synchronousMethods: [8,9,13,24,30],
}
In this example the constructor function is proiv.plugins.eo.constructors.TreeControl and this is defined in the treeControl.js file which is one of the resources that must be loaded. Other resources are the third party library files that implement the tree control and a css file to define the look.
As the name of the plugin contains a full stop, it is defined in the JSON as a string reference. The name is also used as the file name and the name of the definition object.
Topic ID: 800069