The Item is the base interface of Node and Property.

Constructors

Methods

  • Returns the ancestor of this Item at the specified depth. An ancestor of depth x is the Item that is x levels down along the path from the root node to this Item. depth = 0 returns the root node of a workspace. depth = 1 returns the child of the root node along the path to this Item. depth = 2 returns the grandchild of the root node along the path to this Item. And so on to depth = n, where n is the depth of this Item, which returns this Item itself.

    If this node has more than one path (i.e., if it is a descendant of a shared node) then the path used to define the ancestor is implementaion-dependent.

    Parameters

    • depth: number

      An integer, 0 <= depth <= n where n is the depth of this Item.

    Returns Item

    The ancestor of this Item at the specified depth.

    Throws

    ItemNotFoundException if depth < 0 or depth > n where n is the is the depth of this item.

    Throws

    AccessDeniedException if the current session does not have sufficent access to retrieve the specified node.

    Throws

    RepositoryException if another error occurs.

  • Returns the depth of this Item in the workspace item graph. The root node returns 0. A property or child node of the root node returns 1. A property or child node of a child node of the root returns 2. And so on to this Item.

    Returns number

    The depth of this Item in the workspace item graph.

    Throws

    RepositoryException if an error occurs.

  • Returns the name of this Item in qualified form. If this Item is the root node of the workspace, an empty string is returned.

    Returns string

    the name of this Item in qualified form or an empty string if this Item is the root node of a workspace.

    Throws

    RepositoryException if an error occurs.

  • Returns the parent of this Item.

    Returns Node

    The parent of this Item.

    Throws

    ItemNotFoundException if this Item is the root node of a workspace.

    Throws

    AccessDeniedException if the current session does not have sufficent access to retrieve the parent of this item.

    Throws

    RepositoryException if another error occurs.

  • Returns the normalized absolute path to this item.

    Returns string

    the normalized absolute path of this Item.

    Throws

    RepositoryException if an error occurs.

  • Returns true if this Item has been saved but has subsequently been modified through the current session and therefore the state of this item as recorded in the session differs from the state of this item as saved. Within a transaction, isModified on an Item may return false (because the Item has been saved since the modification) even if the modification in question is not in persistent storage (because the transaction has not yet been committed).

    Note that in read-only implementations, this method will always return false.

    Returns boolean

    true if this item is modified; false otherwise.

  • Returns true if this is a new item, meaning that it exists only in transient storage on the Session and has not yet been saved. Within a transaction, isNew on an Item may return false (because the item has been saved) even if that Item is not in persistent storage (because the transaction has not yet been committed).

    Note that if an item returns true on isNew, then by definition is parent will return true on isModified.

    Note that in read-only implementations, this method will always return false.

    Returns boolean

    true if this item is new; false otherwise.

  • Indicates whether this Item is a Node or a Property. Returns true if this Item is a Node; Returns false if this Item is a Property.

    Returns boolean

    true if this Item is a Node, false if it is a Property.

  • Returns true if this Item object (the Java object instance) represents the same actual workspace item as the object otherItem.

    Two Item objects represent the same workspace item if and only if all the following are true: Both objects were acquired through Session objects that were created by the same Repository object. Both objects were acquired through Session objects bound to the same repository workspace. The objects are either both Node objects or both Property objects. If they are Node objects, they have the same identifier. If they are Property objects they have identical names and isSame is true of their parent nodes. This method does not compare the states of the two items. For example, if two Item objects representing the same actual workspace item have been retrieved through two different sessions and one has been modified, then this method will still return true when comparing these two objects. Note that if two Item objects representing the same workspace item are retrieved through the same session they will always reflect the same state.

    Parameters

    • otherItem: Item

      the Item object to be tested for identity with this Item.

    Returns boolean

    true if this Item object and otherItem represent the same actual repository item; false otherwise.

    Throws

    RepositoryException if an error occurs.