Interface for wrappers around javax.jcr.Item to be able to inject Jahia specific actions.

Jahia services should use this interface rather than the original to ensure that we manipulate wrapped nodes and not the ones from the underlying implementation

Author

toto

Constructors

Methods

  • 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 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.

  • 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.