Options
All
  • Public
  • Public/Protected
  • All
Menu

Abstract base class from which all gracl hierachy nodes inherit.

Hierarchy

Index

Constructors

constructor

Properties

doc

Static displayName

displayName: string = ""

Static id

id: string = "id"

The id property within the document contained by this node type, defaults to 'id'

Static parentId

parentId: string

String indicating the property on this nodes document that contains the id(s) of its parent.

Static permissionPropertyKey

permissionPropertyKey: string = "permissions"

Static repository

repository: Repository

The repository for this node type, provides async getter function. Must follow the Repository interface spec.

Methods

getClass

getHierarchyClassNames

  • getHierarchyClassNames(): string[]

getHierarchyIds

  • getHierarchyIds(): Promise<string[]>
  • Retrieve all ids in the hierarchy of nodes steming from this instance

    Returns Promise<string[]>

getId

  • getId(): string
  • Get the id value on the document contained in this node

    Returns string

getName

  • getName(): string

getNodeDepth

  • getNodeDepth(): number

getNodeSubclass

  • getNodeSubclass(): Node

getParentClass

  • getParentClass(): Node

getParentNode

  • Given an id of a parent of this node, create a Node instance of that object.

    Parameters

    • data: DocumentData

      Either the id of the object, or the raw document itself.

    Returns Promise<Node>

getParents

  • getParents(): Promise<Node[]>
  • Get the parent objects of an instance of this node. Must be overriden by subclass unless the static parentId is defined.

    Returns Promise<Node[]>

getRepository

hierarchyRoot

  • hierarchyRoot(): boolean
  • Check if this class direcly inherits from HierarchyNode by checking if the class two levels up is Node

    Returns boolean

isAllowed

  • Check if a node is allowed access to this node. Must be overridden by subclasses.

    Parameters

    Returns Promise<Boolean>

isNodeType

  • isNodeType(nc: Node): boolean
  • Check if this node is a particular Node subclass

    Parameters

    Returns boolean

toString

  • toString(): string

Static assertNodeClass

  • assertNodeClass(nodeClass: Node): void
  • Ensure that a given class inherits from Node

    Parameters

    Returns void

Static getHierarchyClassNames

  • getHierarchyClassNames(): string[]
  • Retrieve all class names in the hierarchy of nodes stemming from this class

    Returns string[]

Static getNodeDepth

  • getNodeDepth(): number

Generated using TypeDoc