gobj_topic_jtree()

gobj_topic_jtree()#

gobj_topic_jtree() returns a hierarchical tree representation of a topic’s self-linked structure, optionally filtering and renaming hooks.

Prototype

json_t *gobj_topic_jtree(
    hgobj gobj,
    const char *topic_name,
    const char *hook,
    const char *rename_hook,
    json_t *kw,
    json_t *jn_filter,
    json_t *jn_options,
    hgobj src
);

Parameters

Key

Type

Description

gobj

hgobj

The GObj instance managing the topic tree.

topic_name

const char *

The name of the topic whose tree structure is to be retrieved.

hook

const char *

The hook defining the hierarchical relationship between nodes.

rename_hook

const char *

An optional new name for the hook in the returned tree.

kw

json_t *

A JSON object containing the ‘id’ and pkey2s fields used to find the root node.

jn_filter

json_t *

A JSON object specifying filters to match records in the tree.

jn_options

json_t *

A JSON object containing options such as fkey and hook configurations.

src

hgobj

The source GObj requesting the topic tree.


Return Value

Returns a JSON object representing the hierarchical tree of the specified topic. The caller must free the returned JSON object.

Notes

[“If ‘webix’ is set in jn_options, the function returns the tree in Webix format (dict-list).”, “The __path__ field in all records follows the ‘idid…’ format.”, ‘If no root node is specified, the first node with no parent is used.’, ‘If gobj is NULL or destroyed, an error is logged and NULL is returned.’, ‘If mt_topic_jtree is not defined in the GClass, an error is logged and NULL is returned.’]

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples