![]() |
Infohub JS API
|
Base Class for nodes/objects on COLNEO infohub.
Uses the infohub GOM (Generic Object Model) JSON notation.
Public Member Functions | |
Construction | |
| constructor () | |
Convenience properties | |
| get | className () |
| get | id () |
| get | shortid () |
| get | name () |
| set | name (value) |
Serialization and diagnostics | |
| setFromJson (obj_as_json, members=null) | |
| getAsJson (members=null) | |
| dump (prefix='') | |
| toJSON () | |
Identity and naming | |
| getId () | |
| getShortId () | |
| getName () | |
| setName (n) | |
Data and property access | |
| get (key, defaultValue={}) | |
| get | info () |
| get | properties () |
| getPropertyValue (typeid, defaultValue=null) | |
| setPropertyValue (typeid, value) | |
| get className | ( | ) |
| constructor | ( | ) |
| dump | ( | prefix = '' | ) |
Print current object to console.
| get | ( | key, | |
| defaultValue = {} ) |
Retrieves a top-level member of the internal #_data object by key.
Common keys include: "info", "properties", "geometry", etc.
| {string} | key - The name of the member to retrieve. |
| {*} | [defaultValue={}] - Value returned if the key does not exist. |
| getAsJson | ( | members = null | ) |
Get object as JSON in COLNEO Generic Object Model format (cnGOM).
| {Array|null} | members Take only members into account, if null use all members. |
Example:
| getId | ( | ) |
Get ID.
| getName | ( | ) |
Get 'info.object_name'.
| getPropertyValue | ( | typeid, | |
| defaultValue = null ) |
Retrieves the value of a property from the internal json object.
| {string} | typeid - The property key to retrieve. |
| {*} | [defaultValue=null] - A fallback value returned if the property does not exist. |
| getShortId | ( | ) |
Retrieves the short object ID from the internal json object.
| get id | ( | ) |
Global unique ID.
| get info | ( | ) |
| get name | ( | ) |
| set name | ( | value | ) |
| get properties | ( | ) |
| setFromJson | ( | obj_as_json, | |
| members = null ) |
Set object from JSON in COLNEO Generic Object Model (GOM) format.
| {object} | obj_as_data |
| {Array|null} | members Take only members into account, if null use all members. |
| setName | ( | n | ) |
Set info.object_name.
| {string} | n Set object_name to n |
| setPropertyValue | ( | typeid, | |
| value ) |
Set the property value to this object.
Value is not syncronised with infohub.
| {string} | typeid |
| {any} | value |
| toJSON | ( | ) |
standard function used by JSON.stringify().
This way JSON.stringify gives us all the info and properties of the object.