$k. SemanticCollection

A collection of topics. Note that this class represents a topic collection folder and should not be confused with $k.SemanticElementCollection, which represents the domain model of a collection view.

Constructor

new $k.SemanticCollection()

Extends

Methods

addElement(semanticElement)

Adds the element to the collection.

Parameters:
NameTypeDescription
semanticElement$k.SemanticElement

The element to add to the collection.

Since
  • 5.3.3
Throws:

deregister()

Deregisters the element. The ID will be undefined afterwards. Equivalent to setId(undefined)

See
  • setId
Throws:

jsDocNoAdminRights

Type
$k.exception.AccessDenied

elements() → {Array.<$k.SemanticElement>}

Returns the elements of the collection

Returns:
Type: 
Array.<$k.SemanticElement>

id() → {string|undefined}

Returns the registered ID, or undefined if not registered.

Inherited From
Returns:
Type: 
string | undefined

name() → {string}

Returns the name

Returns:
Type: 
string

parentFolders() → {Array.<$k.Folder>}

Returns the folders that contain this element

Returns:
Type: 
Array.<$k.Folder>

register(replaceScriptReferencesopt) → {string}

Registers the element with a private ID, if it has no registered ID yet.

Parameters:
NameTypeAttributesDefaultDescription
replaceScriptReferencesboolean<optional>
false

True if ID references in scripts should be replaced. Only done when the old and the new ID is not undefined.

Since
  • 6.1.1
Throws:

jsDocNoAdminRights

Type
$k.exception.AccessDenied
Returns:

The registered ID

Type: 
string

registryType() → {string}

Returns the name of the registry that contains elements of this type

Returns:
Type: 
string

remove()

Deletes the element and removes it from all containing registries and folders

Throws:

removeAll()

Removes all elements from the collection

Since
  • 5.3.3
Throws:

jsDocNoAdminRights

Type
$k.exception.AccessDenied

removeElement(element)

Removes the element from the collection.

Parameters:
NameTypeDescription
element$k.SemanticElement

The element to remove from the collection.

Since
  • 5.3.3
Throws:

jsDocNoAdminRights

Type
$k.exception.AccessDenied

setElements(elements)

Sets the elements of the collection. Overwrites the previous content.

Parameters:
NameTypeDescription
elementsArray.<$k.SemanticElement>

The element to add to the collection.

Since
  • 6.1.1
Throws:

setId(id, replaceScriptReferencesopt)

Registers the element with the given ID. If the element has already been registered, the current ID will be changed to the new ID.

Deprecated option: If the given ID is undefined or null, the element will be deregistered. Use deregister() instead

Parameters:
NameTypeAttributesDefaultDescription
idstring | null

The ID to set

replaceScriptReferencesboolean<optional>
false

True if ID references in scripts should be replaced. Only done when the old and the new ID is not undefined.

See
  • deregister
Throws:

jsDocNoAdminRights

Type
$k.exception.AccessDenied

setName()

Sets the name of the element

Since
  • 6.1.1
Throws:

jsDocNoAdminRights

Type
$k.exception.AccessDenied