Class TreeFolder

A TreeFolder represents a folder in the Matrix application. It can answer queries about folder and item children. A Folder is also an Item.

Constructors

Properties

folderChildren: TreeFolder[]
id: string
itemChildren: ITitleAndId[]
needs: ITreeFolderNeeds
parent?: TreeFolder
title: string
type: string

Methods

  • Delete a child of this folder.

    Parameters

    • id: string

      A valid child id of this folder

    • Optional force: boolean

      If the id points to a non-empty folder, then this must be true to carry out the deletion

    Returns Promise<string>

    The string "Ok" if successful.

    Throws

    Error if the child wasn't found, or if it points to a non-empty folder and {force} is not true

  • Find a TreeFolder with the given name in this folder.

    Parameters

    • folderTitle: string

    Returns null | TreeFolder

    A valid TreeFolder object or null if not found.

  • Returns information on the folders in the folder. May make a request to the server if children haven't been loaded yet, otherwise, acts on cached information (which may be out of date. Call refresh() to update the folder in that case).

    Returns TreeFolder[]

    an array of TreeFolder objects.

  • TreeFolder is nice/simple to work with, but sometimes you need the underlying Item. For example, you might want to set a label on the folder. Item is the necessary type to do that.

    Returns Promise<Item>

    An Item which matches this folder

  • Returns information on the items in the folder. May make a request to the server if children haven't been loaded yet, otherwise, acts on cached information (which may be out of date. Call refresh() to update the folder in that case).

    Returns ITitleAndId[]

    an array of ITitleAndId objects

  • Creates a path string including all ancestor folder titles, separated by "/".

    Returns string

    the folder path

  • Move the given items into this folder. This method does NOT update the list of folder children, since server-side information is necessary.

    Parameters

    • itemIds: string[]

      an array of itemIds

    Returns Promise<string>

    the string "Ok" on success

  • Save an item with this folder as the parent folder. If the item already exists it will be moved there.

    Parameters

    Returns Promise<Item>

    An Item object which corresponds to the newly created or moved Item on the server.

Generated using TypeDoc