Datasource service for category tree.

Class members

Methods

  • appendNodes(nodeToAppend: CategoryNode, subNodes: CategoryNode[])
    Append more child nodes to already expanded parent node

    • nodeToAppend: CategoryNode - Expanded parent node
    • subNodes: CategoryNode[] - List of nodes that will be added as children of expanded node
  • collapseNode(nodeToCollapse: CategoryNode)
    Collapses a node removing all children from it.

  • connect(): Observable<CategoryNode[]>

  • disconnect()

  • expandNode(nodeToExpand: CategoryNode, subNodes: CategoryNode[])
    Expands node applying subnodes to it.

    • nodeToExpand: CategoryNode - Node to be expanded
    • subNodes: CategoryNode[] - List of nodes that will be added as children of expanded node
  • getChildren(parentNode: CategoryNode): CategoryNode[]
    Gets children of the node

  • getParentNode(parentNodeId: string): CategoryNode|undefined
    Gets parent node of given node. If node with parentNodeId is not found it returns undefined.

    • parentNodeId: string - Id of a parent node to be found
    • Returns CategoryNode|undefined - parent node or undefined when not found
  • getSubNodes(parentNodeId: string, skipCount?: number, maxItems?: number, name?: string): Observable<TreeResponse<CategoryNode>>
    Gets categories as nodes for category tree.

    • parentNodeId: string - Identifier of a parent category
    • skipCount: number - (Optional) Number of top categories to skip
    • maxItems: number - (Optional) Maximum number of subcategories returned from
    • name: string - (Optional) Optional parameter which specifies if categories should be filtered out by name or not. If not specified then returns categories without filtering.
    • Returns Observable<TreeResponse<CategoryNode>> -
  • isEmpty(): boolean
    Checks if tree is empty

    • Returns boolean - boolean
  • removeNode(node: CategoryNode)
    Removes provided node from the tree

Details

Category tree datasource service acts as datasource for tree component utilizing category service. See the Tree component and Tree service to get more details on how datasource is used.

© 2023 Alfresco Software, Inc. All Rights Reserved.