abstract class sap.ui.vk.NodeHierarchy

Control sample: sap.ui.vk.NodeHierarchy
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/vk/NodeHierarchy
Application Component: CA-UI5-VTK

Provides the ability to explore a Scene object's node structure.

The objects of this class should not be created directly, and should only be created via a call to sap.ui.vk.Scene.getDefaultNodeHierarchy.


Constructor

Constructor for a new NodeHierarchy.

The objects of this class should not be created directly, and should only be created via a call to sap.ui.vk.Scene.getDefaultNodeHierarchy.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.ui.vk.NodeHierarchy()

Events Overview

Event Description
changed

This event will be fired when the node hierarchy changes, e.g. a node is added or removed.

nodeCreated

This event will be fired when a new node is created.

nodeRemoving

This event will be fired when a node is about to be removed.

nodeReplaced
nodeUpdated

changed

This event will be fired when the node hierarchy changes, e.g. a node is added or removed.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

nodeCreated

This event will be fired when a new node is created.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
nodeRef any
nodeId string

nodeRemoving

This event will be fired when a node is about to be removed.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
nodeRef any
nodeId string

nodeReplaced

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
ReplacedNodeRef any
ReplacementNodeRef any
ReplacedNodeId string
ReplacementNodeId string

nodeUpdated

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
nodeRef any
nodeId string

Methods Overview

Method Description
attachChanged

Attaches event handler fnFunction to the changed event of this sap.ui.vk.NodeHierarchy.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.NodeHierarchy itself.

This event will be fired when the node hierarchy changes, e.g. a node is added or removed.

attachNodeCreated

Attaches event handler fnFunction to the nodeCreated event of this sap.ui.vk.NodeHierarchy.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.NodeHierarchy itself.

This event will be fired when a new node is created.

attachNodeRemoving

Attaches event handler fnFunction to the nodeRemoving event of this sap.ui.vk.NodeHierarchy.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.NodeHierarchy itself.

This event will be fired when a node is about to be removed.

attachNodeReplaced

Attaches event handler fnFunction to the nodeReplaced event of this sap.ui.vk.NodeHierarchy.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.NodeHierarchy itself.

attachNodeUpdated

Attaches event handler fnFunction to the nodeUpdated event of this sap.ui.vk.NodeHierarchy.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.NodeHierarchy itself.

createLayerProxy

Creates a layer proxy object.

The layer proxy object must be destroyed with the destroyLayerProxy method.

createNode

Creates a new node.

createNodeCopy

Creates a copy of an existing node.

createNodeProxy

Creates a node proxy object.

The node proxy object must be destroyed with the destroyNodeProxy method.

destroyLayerProxy

Destroys the layer proxy object.

destroyNodeProxy

Destroys the node proxy object.

detachChanged

Detaches event handler fnFunction from the changed event of this sap.ui.vk.NodeHierarchy.

The passed function and listener object must match the ones used for event registration.

detachNodeCreated

Detaches event handler fnFunction from the nodeCreated event of this sap.ui.vk.NodeHierarchy.

The passed function and listener object must match the ones used for event registration.

detachNodeRemoving

Detaches event handler fnFunction from the nodeRemoving event of this sap.ui.vk.NodeHierarchy.

The passed function and listener object must match the ones used for event registration.

detachNodeReplaced

Detaches event handler fnFunction from the nodeReplaced event of this sap.ui.vk.NodeHierarchy.

The passed function and listener object must match the ones used for event registration.

detachNodeUpdated

Detaches event handler fnFunction from the nodeUpdated event of this sap.ui.vk.NodeHierarchy.

The passed function and listener object must match the ones used for event registration.

enumerateAncestors

Enumerates the ancestor nodes of a particular node in the Scene object.

This method enumerates the ancestor nodes of a particular node, and then calls the callback function, to which it passes the ancestor nodes to one by one.
The BaseNodeProxy objects passed to callback are temporary objects, they are reset after each call to the callback function.
The ancestor nodes are enumerated starting from the top level node, and progresses down the node hierarchy.

enumerateChildren

Enumerates the child nodes of a particular node in the Scene object.

This method gets the child nodes of a particular node, and then calls the callback function to which it passes the child nodes to one by one.
The BaseNodeProxy objects passed to the callback function are temporary objects, which are reset after each call to the callback function.

sap.ui.vk.NodeHierarchy.extend

Creates a new subclass of class sap.ui.vk.NodeHierarchy with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.ManagedObject.extend.

findNodesById

Searches for VE IDs, and returns a list of reference objects of nodes with VE IDs matching the search. The query is run specifically against VE ID structures, which are strictly related to VDS4 models.

findNodesByMetadata

Finds nodes in a scene via metadata information.

findNodesByName

Finds nodes in a scene via node name.

fireChanged

Fires event changed to attached listeners.

fireNodeCreated

Fires event nodeCreated to attached listeners.

fireNodeRemoving

Fires event nodeRemoving to attached listeners.

fireNodeReplaced

Fires event nodeReplaced to attached listeners.

fireNodeUpdated

Fires event nodeUpdated to attached listeners.

getAncestors

Returns a list of reference objects belonging to the ancestors of a particular node.

getChildren

Returns a list of reference objects belonging to the children of a particular node.

getHotspotNodeIds

Returns a list of hotspot IDs.

getLayers

Returns a list of layer IDs.

sap.ui.vk.NodeHierarchy.getMetadata

Returns a metadata object for class sap.ui.vk.NodeHierarchy.

getNodeContentType

Get node content type

getScene

Gets the Scene object the node hierarchy belongs to.

getSceneRef

Gets the scene reference that this NodeHierarchy object wraps.

removeNode

Deletes a node and destroys it.

attachChanged

Attaches event handler fnFunction to the changed event of this sap.ui.vk.NodeHierarchy.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.NodeHierarchy itself.

This event will be fired when the node hierarchy changes, e.g. a node is added or removed.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.NodeHierarchy itself

attachNodeCreated

Attaches event handler fnFunction to the nodeCreated event of this sap.ui.vk.NodeHierarchy.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.NodeHierarchy itself.

This event will be fired when a new node is created.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.NodeHierarchy itself

attachNodeRemoving

Attaches event handler fnFunction to the nodeRemoving event of this sap.ui.vk.NodeHierarchy.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.NodeHierarchy itself.

This event will be fired when a node is about to be removed.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.NodeHierarchy itself

attachNodeReplaced

Attaches event handler fnFunction to the nodeReplaced event of this sap.ui.vk.NodeHierarchy.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.NodeHierarchy itself.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.NodeHierarchy itself

attachNodeUpdated

Attaches event handler fnFunction to the nodeUpdated event of this sap.ui.vk.NodeHierarchy.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.NodeHierarchy itself.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.NodeHierarchy itself

createLayerProxy

Creates a layer proxy object.

The layer proxy object must be destroyed with the destroyLayerProxy method.

Param Type DefaultValue Description
layerId string

The layer ID for which to create a proxy object.

createNode

Creates a new node.

Param Type DefaultValue Description
parentNode any

The reference object of the parent node where the created node is added to. If equals null the newly created node is a top level node.

name string

The name of the new node.

insertBeforeNode any

The created node is added before this specified node. If equals null the newly created node is added at the end of the parent's list of nodes.

nodeContentType sap.ui.vk.NodeContentType sap.ui.vk.NodeContentType.Regular

The created node content type.

content object

Optional Json structure used to define node properties.

createNodeCopy

Creates a copy of an existing node.

Param Type DefaultValue Description
nodeToCopy any

The reference object of the node to copy.

parentNode any

The reference object of the parent node where the created node is added to. If equals null the newly created node is a top level node.

name string

The name of the new node.

insertBeforeNode any

The created node is added before this specified node. If equals null the newly created node is added at the end of the parent's list of nodes.

createNodeProxy

Creates a node proxy object.

The node proxy object must be destroyed with the destroyNodeProxy method.

Param Type DefaultValue Description
nodeRef any

The reference object for which to create a proxy object.

destroyLayerProxy

Destroys the layer proxy object.

Param Type DefaultValue Description
layerProxy sap.ui.vk.LayerProxy

The layer proxy object.

destroyNodeProxy

Destroys the node proxy object.

Param Type DefaultValue Description
nodeProxy sap.ui.vk.NodeProxy

The node proxy object.

detachChanged

Detaches event handler fnFunction from the changed event of this sap.ui.vk.NodeHierarchy.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachNodeCreated

Detaches event handler fnFunction from the nodeCreated event of this sap.ui.vk.NodeHierarchy.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachNodeRemoving

Detaches event handler fnFunction from the nodeRemoving event of this sap.ui.vk.NodeHierarchy.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachNodeReplaced

Detaches event handler fnFunction from the nodeReplaced event of this sap.ui.vk.NodeHierarchy.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachNodeUpdated

Detaches event handler fnFunction from the nodeUpdated event of this sap.ui.vk.NodeHierarchy.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

enumerateAncestors

Enumerates the ancestor nodes of a particular node in the Scene object.

This method enumerates the ancestor nodes of a particular node, and then calls the callback function, to which it passes the ancestor nodes to one by one.
The BaseNodeProxy objects passed to callback are temporary objects, they are reset after each call to the callback function.
The ancestor nodes are enumerated starting from the top level node, and progresses down the node hierarchy.

Param Type DefaultValue Description
nodeRef any

The reference object of a node whose ancestor nodes we want enumerated.

callback function

A function to call when the ancestor nodes are enumerated. The function takes one parameter of type sap.ui.vk.BaseNodeProxy, or string if parameter passNodeRef parameter is true.

passNodeRef boolean false

Indicates whether to pass the reference objects of the ancestor nodes, or the whole node proxy to the callback function.
If true, then only the reference objects of the ancestor nodes are passed to the callback function.
If false, then the node proxies of the ancestor nodes are passed to the callback function.

enumerateChildren

Enumerates the child nodes of a particular node in the Scene object.

This method gets the child nodes of a particular node, and then calls the callback function to which it passes the child nodes to one by one.
The BaseNodeProxy objects passed to the callback function are temporary objects, which are reset after each call to the callback function.

Param Type DefaultValue Description
nodeRef any

The reference object of a node whose child nodes we want enumerated.
When nodeRef is specified, the child nodes of this node are enumerated.
When no nodeRef is specified, only the top level nodes are enumerated.

callback function

A function to call when the child nodes are enumerated. The function takes one parameter of type sap.ui.vk.BaseNodeProxy, or string if parameter passNodeRef parameter is true.

stepIntoClosedNodes boolean false

Indicates whether to enumerate the child nodes if the node is closed.
If true, the children of that closed node will be enumerated
If false, the children of that node will not be enumerated

passNodeRef boolean false

Indicates whether to pass the reference objects of the child nodes, or the whole node proxy to the callback function.
If true, then only the reference objects of the child nodes are passed to the callback function.
If false, then the node proxies created from the child reference objects are passed to the callback function.

sap.ui.vk.NodeHierarchy.extend

Creates a new subclass of class sap.ui.vk.NodeHierarchy with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.ManagedObject.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

findNodesById

Searches for VE IDs, and returns a list of reference objects of nodes with VE IDs matching the search. The query is run specifically against VE ID structures, which are strictly related to VDS4 models.

Param Type DefaultValue Description
query object

JSON object containing the search parameters.
The following example shows what the structure of the query object should look like:

query = {
	source: string (if not specified, the query returns an empty array), 
type: string (if not specified, the query returns an empty array),
fields: field[] }

  • field.name
    A string containing the name of the VE ID. If no value is specified, then the query will return an empty array.
  • field.value
    A string representing the search keyword. If no value is specified, it defaults to empty string.
    The following example shows a string being passed in:
    value: "Box #14"
  • field.predicate
    Represents a search mode. The available search modes are "equals", "contains", and "startsWith".
    Using "equals" will search for IDs with names that exactly match the provided string.
    Using "contains" will search for IDs with names containing the provided string.
    Using "startsWith" will search for IDs with names starting with the provided string.
    If no value is specified, the search mode will default to "equals".

  • field.caseSensitive
    Indicates whether the search should be case sensitive or not.
    If true, the search will be case sensitive, and false indicates otherwise.
    If no value is specified, caseSensitive will default to false (that is, the search will be a case-insensitive search).

findNodesByMetadata

Finds nodes in a scene via metadata information.

Param Type DefaultValue Description
query object

JSON object containing the search parameters.
The following example shows what the structure of the query object should look like:

query = {
  category: string,
  key: string,
  value: string | string[],
  predicate: "equals" | "contains" | "startsWith",
  caseSensitive: true | false
}

NOTE: query.predicate and query.caseSensitive refer to query.value.
  • query.category
    A string indicating the name of the metadata category.
    If no value is specified for query.category, all nodes in the scene will be returned in the search.

  • query.key
    A string indicating the key which belongs to the metadata category specified in query.category. You can only use query.key if query.category has been specified.
    If no value is specified for query.key, then all nodes grouped under the specified category will be returned in the search.

  • query.value
    A string or an array of strings containing the value or values associated with query.key. You can only use query.value in the search if query.key has been specified.
    If no value is specified for query.value, then all nodes containing the specified key will be returned, regardless of what the value of the key is.
    The following example shows a single string being passed in:
    value: "Box #14"
    The following example shows an array of strings being passed in:
    value: ["Box #3", "box #4", "BOX #5"]
  • query.predicate
    Represents a search mode. The available search modes are "equals", "contains", and "startsWith".
    Using "equals" will search for key values that exactly match the provided string or array of strings.
    Using "contains" will search for key values containing all or part of the provided string or array of strings.
    Using "startsWith" will search key values starting with the provided string or array of strings.
    If no value is specified, the search mode will default to "equals".

  • query.caseSensitive
    Indicates whether the search should be case sensitive or not.
    If true, the search will be case sensitive, and false indicates otherwise.
    If no value is specified, caseSensitive will default to false (that is, the search will be a case-insensitive search).

findNodesByName

Finds nodes in a scene via node name.

Param Type DefaultValue Description
query object

JSON object containing the search parameters.
The following example shows what the structure of the query object should look like:

query = {
	value: string | string[],
	predicate: "equals" | "contains" | "startsWith",
	caseSensitive: true | false
}

  • query.value
    A string or an array of strings containing the name of a node or names of nodes. If no value is specified, then all nodes in the scene will be returned.
    The following example shows a single string being passed in:
    value: "Box #14"
    The following example shows an array of strings being passed in:
    value: ["Box #3", "box #4", "BOX #5"]
  • query.predicate
    Represents a search mode. The available search modes are "equals", "contains", and "startsWith".
    Using "equals" will search for nodes with names that exactly match the provided string or array of strings.
    Using "contains" will search for nodes with names containing all or part of the provided string or array of strings.
    Using "startsWith" will search for nodes with names starting with the provided string or array of strings.
    If no value is specified, the search mode will default to "equals".

  • query.caseSensitive
    Indicates whether the search should be case sensitive or not.
    If true, the search will be case sensitive, and false indicates otherwise.
    If no value is specified, caseSensitive will default to false (that is, the search will be a case-insensitive search).

fireChanged

Fires event changed to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fireNodeCreated

Fires event nodeCreated to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

nodeRef any
nodeId string

fireNodeRemoving

Fires event nodeRemoving to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

nodeRef any
nodeId string

fireNodeReplaced

Fires event nodeReplaced to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

ReplacedNodeRef any
ReplacementNodeRef any
ReplacedNodeId string
ReplacementNodeId string

fireNodeUpdated

Fires event nodeUpdated to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

nodeRef any
nodeId string

getAncestors

Returns a list of reference objects belonging to the ancestors of a particular node.

Param Type DefaultValue Description
nodeRef any

The reference object of the node whose ancestors will be returned.

getChildren

Returns a list of reference objects belonging to the children of a particular node.

Param Type DefaultValue Description
nodeRef any

The reference object of the node whose children will be returned. If nodeRef is not passed to the getChildren function, the reference objects of the root nodes will be returned.

stepIntoClosedNodes boolean false

Indicates whether to return only the child nodes of a closed node or not. If true, then the children of that closed node will be returned. If false, then the children of that closed node will not be returned.

getHotspotNodeIds

Returns a list of hotspot IDs.

getLayers

Returns a list of layer IDs.

sap.ui.vk.NodeHierarchy.getMetadata

Returns a metadata object for class sap.ui.vk.NodeHierarchy.

getNodeContentType

Get node content type

Param Type DefaultValue Description
nodeRef any

The node reference

getScene

Gets the Scene object the node hierarchy belongs to.

getSceneRef

Gets the scene reference that this NodeHierarchy object wraps.

removeNode

Deletes a node and destroys it.

Param Type DefaultValue Description
nodeRef any

The reference object of the node to destroy.