Classes
Methods
# async createObject(object_data, parent_sid, cb) → {Promise.<ApiResponse>}
Create new object on infohub.
Create a new object if object_id (in 'info') does not exist, create a new version if object_id exist.
Function uses endpoint POST .../{scope}/nodes/{node} on service 'hub'.
Parameters:
| Name | Type | Description |
|---|---|---|
object_data |
object
|
Object in GOM format. |
parent_sid |
string
|
|
cb |
function
|
Returns AüiResponse object with an cnObject as data if REST call has been sucessful |
- Since:
- 1.0, 09.2025, jh
Since this uses a callback, the function itself resolves with no value
Promise.<ApiResponse>
# async deleteObject(object_id, parent_sid, cb) → {Promise.<ApiResponse>}
Delete Object including all its versions in parent object 'parent_sid'.
Parameters:
| Name | Type | Description |
|---|---|---|
object_id |
string
|
|
parent_sid |
string
|
|
cb |
function
|
- Since:
- 1.0, 09.2025, jh
Since this uses a callback, the function itself resolves with no value
Promise.<ApiResponse>
# async getObject(object_id, cb, context_sid, members, properties, context_sid, object_data) → {Promise.<ApiResponse>}
Fetch an object by ID and (optional) context from infohub.
If context node is null the current project is used as context (root node for search).
If object does not exist and context_sid and object_data is given, a new object is created
by using 'object_data'.
- Example:
let container_data = {
"info": {
"object_id": "FTW",
"object_name": "11-FERTIGTEILWERKE",
"object_type": "res_container##FTW"
}
}
Infohub.ObjectServices.getObject("FTW", async (ret_obj) => {
...
}, null, null, null, container_data)
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
object_id |
string
|
The ID of the object to retrieve |
|
cb |
function
|
Callback function that receives the result object, { data: cnObject } |
|
context_sid |
string
|
null | Optional session or context identifier |
members |
Array.<String>
|
null
|
Optional members to retrieve (info, properties, properties_comments, geometry, etc.), if null info only is retrieved |
|
properties |
Array.<String>
|
null
|
Optional properties to retrieve, if null all properties are retrieved |
|
context_sid |
String
|
null
|
Search in this context (root) object. If null use current project. Create a new object with this parent if object could not be found. |
|
object_data |
Object
|
null
|
If object could not be found use this object data to create new object |
- Since:
- 1.0, 09.2025, jh. update 07.12.2025, ar
Since this uses a callback, the function itself resolves with no value
Promise.<ApiResponse>
# async getObjects(query, cb, context_sidopt) → {Promise.<ApiResponse>}
Fetch objects by query and (optional) context.
If context node is null use project as a context (root node for search).
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
query |
object
|
Query for search |
||
cb |
function
|
Callback function that receives the result object |
||
context_sid |
string
|
<optional> |
null | Optional context node for search, if null the context for search is set to ptoject shortid. |
- Since:
- 1.0, 09.2025, jh
Since this uses a callback, the function itself resolves with no value.
Array
Promise.<ApiResponse>
Example
{
"object_list" : [ 'objid1' , 'objid2' , ... ] // optional
// parameters of webservice
"filter" :
"members" :
"properties" :
"geometry" :
"nodes" :
"relations" :
"relations_right" :
}
# newObjectFromJson(node_json) → {cnObject}
Factory method to instantiate a new object of class cnObject.
The object is not created or written to infohub. To save the object on infohub
use method saveObject().
Parameters:
| Name | Type | Description |
|---|---|---|
node_json |
object
|
Object as json in GOM format |
New Object
# async saveObject(cnObj, members, cb) → {Promise.<ApiResponse>}
Save object on infohub.
Take 'info' block of object (GOM) into account.
Use object_id to create a new or update an existing object,
Use parent_shortid as parent to create a new object or identify an existing object.
If also parent_shortid is missing, use project_shortid or catalogue_shortid as parent.
In any other cases the object is created in the current project stored in the Context object of this object service.
PUT - /{scope}/objects/{parent}/object
Parameters:
| Name | Type | Description |
|---|---|---|
cnObj |
cnObject
|
|
members |
Array
|
null
|
Save/Write these members which is one of [ 'info' , 'properties' , etc. ] |
cb |
function
|
- Since:
- 1.0, 09.2025, jh
Since this uses a callback, the function itself resolves with no value
Promise.<ApiResponse>
# async setPropertyValues(node_sid, propertylist, cb, cmt) → {Promise.<ApiResponse>}
Set property values in propertylist for node (shortid) on infohub.
Parameters:
| Name | Type | Description |
|---|---|---|
node_sid |
*
|
Node ShortID |
propertylist |
*
|
= [ { 'typeid' : "abc##xs:string", 'value' : "123 abc", 'comment' : "Gesetzt durch xyz" } ] |
cb |
*
|
Call Back { ApiResponse<> } |
cmt |
*
|
Comment (optional) |
- Since:
- 1.0, 09.2025, jh
Since this uses a callback, the function itself resolves with no value.
Promise.<ApiResponse>