Interface for wrappers around javax.jcr.Node 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 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 identifier of this node. Applies to both referenceable and non-referenceable nodes.

    A RepositoryException is thrown if an error occurs.

    Returns string

    the identifier of this node.

    Throws

    RepositoryException if an error occurs.

    Since

    JCR 2.0

  • Returns a list holding the primary node type and all mixin node types for this node

    Returns string[]

    a list holding the primary node type and all mixin node types

    Throws

    RepositoryException in case of JCR-related errors

  • Returns all child nodes of this node accessible through the current Session. Does not include properties of this Node. The same reacquisition semantics apply as with #getNode(String). If this node has no accessible child nodes, then an empty iterator is returned.

    Returns JCRNodeIteratorWrapper

    A NodeIterator over all child Nodes of this Node.

    Throws

    RepositoryException if an error occurs.

  • Gets all child nodes of this node accessible through the current Session that match namePattern. The pattern may be a full name or a partial name with one or more wildcard characters ("*"), or a disjunction (using the "|" character to represent logical OR) of these. For example,

    N.getNodes("jcr:* | myapp:report | my doc")

    would return a NodeIterator holding all accessible child nodes of N that are either called 'myapp:report', begin with the prefix 'jcr:' or are called 'my doc'.

    The substrings within the pattern that are delimited by "|" characters and which may contain wildcard characters ("*") are called globs.

    Note that leading and trailing whitespace around a glob is ignored, but whitespace within a disjunct forms part of the pattern to be matched.

    The pattern is matched against the names (not the paths) of the immediate child nodes of this node.

    If this node has no accessible matching child nodes, then an empty iterator is returned.

    The same reacquisition semantics apply as with #getNode(String).

    Parameters

    • namePattern: string

      a name pattern.

    Returns JCRNodeIteratorWrapper

    a NodeIterator.

    Throws

    RepositoryException if an unexpected error occurs.

  • Gets all child nodes of this node accessible through the current Session that match one or more of the nameGlob strings in the passed array.

    A glob may be a full name or a partial name with one or more wildcard characters ("*"). For example,

    N.getNodes(new String[] {"jcr:*", "myapp:report", "my doc"})

    would return a NodeIterator holding all accessible child nodes of N that are either called 'myapp:report', begin with the prefix 'jcr:' or are called 'my doc'.

    Note that unlike in the case of the #getNodes(String) leading and trailing whitespace around a glob is not ignored.

    The globs are matched against the names (not the paths) of the immediate child nodes of this node.

    If this node has no accessible matching child nodes, then an empty iterator is returned.

    The same reacquisition semantics apply as with #getNode(String).

    Parameters

    • nameGlobs: string[]

      an array of globbing strings.

    Returns JCRNodeIteratorWrapper

    a NodeIterator.

    Throws

    RepositoryException if an unexpected error occurs.

    Since

    JCR 2.0

  • 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 all properties of this node accessible through the current Session. Does not include child nodes of this node. The same reacquisition semantics apply as with #getNode(String). If this node has no accessible properties, then an empty iterator is returned.

    Returns PropertyIterator

    A PropertyIterator.

    Throws

    RepositoryException if an error occurs.

  • Gets all properties of this node accessible through the current Session that match namePattern. The pattern may be a full name or a partial name with one or more wildcard characters ("*"), or a disjunction (using the "|" character to represent logical OR) of these. For example,

    N.getProperties("jcr:* | myapp:name | my doc")

    would return a PropertyIterator holding all accessible properties of N that are either called 'myapp:name', begin with the prefix 'jcr:' or are called 'my doc'.

    The substrings within the pattern that are delimited by "|" characters and which may contain wildcard characters ("*") are called globs.

    Note that leading and trailing whitespace around a glob is ignored, but whitespace within a disjunct forms part of the pattern to be matched.

    The pattern is matched against the names (not the paths) of the immediate child properties of this node.

    If this node has no accessible matching properties, then an empty iterator is returned.

    The same reacquisition semantics apply as with #getNode(String).

    Parameters

    • namePattern: string

      a name pattern.

    Returns PropertyIterator

    a PropertyIterator.

    Throws

    RepositoryException if an unexpected error occurs.

  • Gets all properties of this node accessible through the current Session that match one or more of the nameGlob strings in the passed array.

    A glob may be a full name or a partial name with one or more wildcard characters ("*"). For example,

    N.getProperties(new String[] {"jcr:*", "myapp:report", "my doc"})

    would return a PropertyIterator holding all accessible properties of N that are either called 'myapp:report', begin with the prefix 'jcr:' or are called 'my doc'.

    Note that unlike in the case of the #getProperties(String) leading and trailing whitespace around a glob is not ignored.

    The globs are matched against the names (not the paths) of the properties of this node.

    If this node has no accessible matching properties, then an empty iterator is returned.

    The same reacquisition semantics apply as with #getProperty(String).

    Parameters

    • nameGlobs: string[]

      an array of globbing strings.

    Returns PropertyIterator

    a PropertyIterator.

    Throws

    RepositoryException if an unexpected error occurs.

    Since

    JCR 2.0

  • Returns a map of all property names of this node accessible through the current Session with the value as String.

    Returns Map<string, string>

    a map of all property names and its String values

    Throws

    RepositoryException in case of JCR-related errors

  • This method returns all REFERENCE properties that refer to this node and that are accessible through the current Session. Equivalent to Node.getReferences(null).

    If this node has no referring REFERENCE properties, an empty iterator is returned. This includes the case where this node is not referenceable.

    Returns PropertyIterator

    A PropertyIterator.

    Throws

    RepositoryException if an error occurs.

    See

    #getReferences(String).

  • This method returns all REFERENCE properties that refer to this node, have the specified name and that are accessible through the current Session.

    If the name parameter is null then all referring REFERENCES are returned regardless of name.

    Some implementations may only return properties that have been persisted. Some may return both properties that have been persisted and those that have been dispatched but not persisted (for example, those saved within a transaction but not yet committed) while others implementations may return these two categories of property as well as properties that are still pending and not yet dispatched.

    In implementations that support versioning, this method does not return properties that are part of the frozen state of a version in version storage.

    If this node has no referring REFERENCE properties with the specified name, an empty iterator is returned. This includes the case where this node is not referenceable.

    Parameters

    • name: string

      name of referring REFERENCE properties to be returned; if null then all referring REFERENCEs are returned.

    Returns PropertyIterator

    A PropertyIterator.

    Throws

    RepositoryException if an error occurs.

    Since

    JCR 2.0

  • Returns the UUID of this node as recorded in this node's jcr:uuid property. This method only works on nodes of mixin node type mix:referenceable.

    On nonreferenceable nodes, this method throws an UnsupportedRepositoryOperationException. To avoid throwing an exception to determine whether a node has a UUID, a call to #isNodeType(String) isNodeType("mix:referenceable") can be made.

    Returns string

    the UUID of this node.

    Throws

    UnsupportedRepositoryOperationException if this node nonreferenceable.

    Throws

    RepositoryException if another error occurs.

    Deprecated

    As of JCR 2.0, #getIdentifier() should be used instead.

  • This method returns all WEAKREFERENCE properties that refer to this node and that are accessible through the current Session. Equivalent to Node.getWeakReferences(null).

    If this node has no referring WEAKREFERENCE properties, an empty iterator is returned. This includes the case where this node is not referenceable.

    Returns PropertyIterator

    A PropertyIterator.

    Throws

    RepositoryException if an error occurs.

    See

    #getWeakReferences(String).

    Since

    JCR 2.0

  • This method returns all WEAKREFERENCE properties that refer to this node, have the specified name and that are accessible through the current Session.

    If the name parameter is null then all referring WEAKREFERENCE are returned regardless of name.

    Some implementations may only return properties that have been persisted. Some may return both properties that have been persisted and those that have been dispatched but not persisted (for example, those saved within a transaction but not yet committed) while others implementations may return these two categories of property as well as properties that are still pending and not yet dispatched.

    In implementations that support versioning, this method does not return properties that are part of the frozen state of a version in version storage.

    If this node has no referring WEAKREFERENCE properties with the specified name, an empty iterator is returned. This includes the case where this node is not referenceable.

    Parameters

    • name: string

      name of referring WEAKREFERENCE properties to be returned; if null then all referring WEAKREFERENCEs are returned.

    Returns PropertyIterator

    A PropertyIterator.

    Throws

    RepositoryException if an error occurs.

    Since

    JCR 2.0

  • Checks if the translation node exists Use only in un-localized session

    Parameters

    Returns boolean

    true if the translation node exists

    Throws

    RepositoryException in case of JCR-related errors

  • Checks if the translation node exists Use only in un-localized session

    Parameters

    • locale: Locale

      the locale for which we want to check if a translation exists

    • fallback: boolean

      whether or not we should fallback on the default locale if we didn't find an exact translation

    Returns boolean

    true if the translation node exists

    Throws

    RepositoryException in case of JCR-related errors

  • Indicates whether a node exists at relPath Returns true if a node accessible through the current Session exists at relPath and false otherwise.

    Parameters

    • relPath: string

      The path of a (possible) node.

    Returns boolean

    true if a node exists at relPath; false otherwise.

    Throws

    RepositoryException if an error occurs.

  • Indicates whether this node has child nodes. Returns true if this node has one or more child nodes accessible through the current Session; false otherwise.

    Returns boolean

    true if this node has one or more child nodes; false otherwise.

    Throws

    RepositoryException if an error occurs.

  • Indicates whether this node has properties. Returns true if this node has one or more properties accessible through the current Session; false otherwise.

    Returns boolean

    true if this node has one or more properties; false otherwise.

    Throws

    RepositoryException if an error occurs.

  • Indicates whether a property exists at relPath Returns true if a property accessible through the current Session exists at relPath and false otherwise.

    Parameters

    • relPath: string

      The path of a (possible) property.

    Returns boolean

    true if a property exists at relPath; false otherwise.

    Throws

    RepositoryException if an error occurs.

  • Returns false if this node is currently in the checked-in state (either due to its own status as a versionable node or due to the effect of a versionable node being checked in above it). Otherwise this method returns true. This includes the case where the repository does not support versioning (and therefore all nodes are always "checked-out", by default).

    Returns boolean

    a boolean

    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 node is of the specified primary node type or mixin type, or a subtype thereof. Returns false otherwise.

    This method respects the effective node type of the node.

    Parameters

    • nodeTypeName: string

      the name of a node type.

    Returns boolean

    true If this node is of the specified primary node type or mixin type, or a subtype thereof. Returns false otherwise.

    Throws

    RepositoryException if an error occurs.

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