Node interface represents a node in the hierarchy that * makes up the repository. * * @author Markus Nix * @package phpcr */ interface Node extends Item { /** * Creates a new node at relPath. The new node will only be * persisted in the workspace when save() and if the structure * of the new node (its child nodes and properties) meets the constraint * criteria of the parent node's node type. *

* If relPath implies intermediary nodes that do not * exist then a PathNotFoundException is thrown. *

* If an item already exists at relPath then an * ItemExistsException is thrown. *

* If an attempt is made to add a node as a child of a * property then a ConstraintViolationException is * thrown immediately (not on save). *

* Since this signature does not allow explicit node type assignment, the * new node's node types (primary and mixin, if applicable) will be * determined immediately (not on save) by the NodeDefinitions * in the node types of its parent. If there is no NodeDefinition * corresponding to the name specified for this new node, then a * ConstraintViolationException is thrown immediately (not on * save). * * @param relPath The path of the new node to be created. * @return The node that was added. * @param primaryNodeTypeName The name of the primary node type of the new node. * @throws ItemExistsException If an item at the specified path already exists. * @throws PathNotFoundException If the specified path implies intermediary * nodes that do not exist. * @throws ConstraintViolationException if If there is no NodeDefinition * corresponding to the name specified for this new node in the parent * node's node type, or if an attempt is made to add a node as a child of a * property. * @throws RepositoryException If another error occurs. */ public function addNode( $relPath, $primaryNodeTypeName = null ); /** * If this node supports child node ordering, this method inserts the child node at * srcChildRelPath before its sibling, the child node at destChildRelPath, * in the child node list. *

* To place the node srcChildRelPath at the end of the list, a destChildRelPath * of null is used. *

* Note that (apart from the case where destChildRelPath is null) both of these * arguments must be relative paths of depth one, in other words they are the names of the child nodes, * possibly suffixed with an index. *

* Changes to ordering of child nodes are persisted on save of the parent node. But, if this node * does not support child node ordering, then a UnsupportedRepositoryOperationException * thrown immediately (i.e., not on save). *

* If srcChildRelPath and destChildRelPath are the same, * then a ConstraintViolationException is thrown. *

* A ConstraintViolationException is also thrown if a node-type or implementation-specific * constraint violation is detected immediately. Otherwise, if the violation can only be detected later, * on save, then that method throws a ConstraintViolationException. Implementations * may differ as to which constraints are enforced immediately, and which on save. *

* If either parameter is not the relative path to a child node of this node, then an * ItemNotFoundException is thrown. *

* A VersionException is thrown if this node is versionable and checked-in or is non-versionable * but its nearest versionable ancestor is checked-in. *

* A LockException is thrown if a lock prevents the re-ordering. * * @param srcChildRelPath the relative path to the child node (i.e., name plus possible index) * to be moved in the ordering * @param destChildRelPath the the relative path to the child node (i.e., name plus possible index) * before which the node srcChildRelPath will be placed. * @throws UnsupportedRepositoryOperationException * if ordering is not supported. * @throws ConstraintViolationException if srcChildRelPath and * destChildRelPath are the same or some implementation-specific ordering restriction is violated. * @throws ItemNotFoundException if either parameter is not the relative path of a child node of this node. * @throws VersionException if this node is versionable and checked-in or is non-versionable but its * nearest versionable ancestor is checked-in. * @throws LockException if a lock prevents the re-ordering. * @throws RepositoryException if another error occurs. */ public function orderBefore( $srcChildRelPath, $destChildRelPath ); /** * This method returns the index of this node within the ordered set of its same-name * sibling nodes. This index is the one used to address same-name siblings using the * square-bracket notation, e.g., /a[3]/b[4]. Note that the index always starts * at 1 (not 0), for compatibility with XPath. As a result, for nodes that do not have * same-name-siblings, this method will always return 1. * * @return The index of this node within the ordered set of its same-name sibling nodes. * @throws RepositoryException if an error occurs. */ public function getIndex(); /** * Adds the existing node at absPath as child of this node, thus adding * this node as an addional parent of the node at absPath. *

* This change will be persisted (if valid) on save. *

* If the node at absPath is not of mixin type * mix:referenceable, a ConstraintViolationException * will be thrown on save. *

* The name of the new child node as accessed from this node * will be the same as its current name in absPath (that is, the last path * segment in that absPath). * * @param absPath The absolute path of the new child node. * @return The new child node. * @param newName The new name for this node when referenced as a child of this node. * @throws PathNotFoundException If no node exists at absPath. * @throws RepositoryException In level 2: If another error occurs. */ public function addExistingNode( $absPath, $newName = null ); /** * Sets the specified property to the specified value. If the property does * not yet exist, it is created. The property type of the property will be * that specified by the node type of this node (the one on * which this method is being called). If the PropertyType * of the supplied Value object (recall that a * Value object records the property type of its * contained value) is different from that required, a best-effort * conversion is attempted. *

* If the node type of the parent node does not specify a * specific property type for the property being set, then * the property type of the supplied Value object * is used. *

* If the property already exists (has previously been set) it assumes * the new value. If the node type of the parent node does not specify a * specific property type for the property being set, then the property * will also assume the new type (if different). *

* To erase a property, use #remove(String relPath). *

* To persist the addition or change of a property to the workspace * #save must be called on * this node (the parent of the property being set) or a higher-order * ancestor of the property. * * @param name The name of a property of this node * @param value The Value to be assigned, an array of Value objects, * an string representing path to a resource * @param type The type of the property * @return The updated Property object * @throws ValueFormatException if value is incompatible with * (i.e. can not be converted to) the type of the specified property. * @throws ConstraintViolationException if the change would violate * a node-type or other constraint and this implementation performs * this validation immediately instead of waiting until save. * @throws RepositoryException If another error occurs. */ public function setProperty( $name, $val, $type = null ); /** * Returns the node at relPath relative to this node. * The properties and child nodes of the returned node can then be read * (and if permissions allow) changed and written. However, any changes * made to this node, its properties or its child nodes * (and their properties and child nodes, etc.) will only be persisted to * the repository upon calling save. * * @param relPath The relative path of the node to retrieve. * @return The node at relPath. * @throws PathNotFoundException If no node exists at the * specified path. * @throws RepositoryException If another error occurs. */ public function getNode( $relPath ); /** * Returns a NodeIterator over all child Nodes of * this Node. Does not include properties of this * Node. The same save and re-acquisition * semantics apply as with #getNode(String). * * @param namePattern a name pattern * @return A NodeIterator over all child Nodes of * this Node. * @throws RepositoryException If an unexpected error occurs. */ public function getNodes( $namePattern = null ); /** * Returns the property at relPath relative to this * node. The same save and re-acquisition * semantics apply as with #getNode(String). * * @param relPath The relative path of the property to retrieve. * @return The property at relPath. * @throws PathNotFoundException If no property exists at the * specified path. * @throws RepositoryException If another error occurs. */ public function getProperty( $relPath ); /** * Returns all properties of this node. * Returns a PropertyIterator over all properties * of this node. Does not include child nodes of this * node. The same save and re-acquisition * semantics apply as with #getNode(String). * * @param namePattern a name pattern * @return A PropertyIterator. * @throws RepositoryException If an error occurs. */ public function getProperties( $namePattern = null ); /** * Returns all REFERENCE properties that refer to this node. *

* Note that in level 2 implementations, this method returns only saved properties (in a transactional setting * this includes both those properties that have been saved but not yet committed, * as well as properties that have been committed). This method does not return REFERENCE * properties that have been added but not yet saved. *

* In implementaions that support versioing, this method does not return REFERENCE properties * that are part of the frozen state of a version in version storage. *

* If this node has no references, an empty iterator is returned. * * @return A PropertyIterator. * @throws RepositoryException if an error occurs */ public function getReferences(); /** * Returns the first property of this node found with the specified value. * What makes a particular property "first" (that is, the search order) is * implementaion dependent. If the specified value and the value of a * property are of different types then a conversion is attempted before the * equality test is made. Returns null if no such property is * found. In the case of multivalue properties, a property qualifies as * having the specified value if and only if at least one of its values matches. * The same save and re-acquisition * semantics apply as with #getNode(String). * * @param value A Value object. * @return The first property of this node found with the specified value. * @throws RepositoryException If an unexpected error occurs. */ public function findProperty( Value $value ); /** * Returns all properties of this node with the specified value. * If the spedified value and the value of a property are of different types * then a conversion is attempted before the equality test is made. Returns * an empty iterator if no such property could be found. In the case of * multivalue properties, a property qualifies as having the specified value * if and only if at least one of its values matches. * The same save and re-acquisition * semantics apply as with #getNode(String). * * @param value A Value object. * @return A PropertyIterator holding all properties of this node with the * specified value. Returns an empty iterator if no such property could be found. * @throws RepositoryException If an unexpected error occurs. */ public function findProperties( Value $value ); /** * Returns the deepest primary child item accessible via a chain of * primary child items from this node. * A node's type can specifiy a maximum of one of * its child items (child node or property) as its primary child item. * This method traverses the chain of primary child items of this node * until it either encounters a property or encounters a node that does not * have a primary child item. It then returns that property or node. If * this node itself (the one that this method is being called on) has no * primary child item then this method throws a * ItemNotFoundException. The same save and re-acquisition * semantics apply as with #getNode(String). * * @return the deepest primary child item accessible from this node via * a chain of primary child items. * @throws ItemNotFoundException if this node does not have a primary * child item. * @throws RepositoryException If another error occurs. */ public function getPrimaryItem(); /** * Returns the UUID of this node as recorded in the 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. * * @return the UUID of this node * @throws UnsupportedRepositoryOperationException If this node nonreferenceable. * @throws RepositoryException If another error occurs. */ public function getUUID(); /** * Indicates whether a node exists at relPath * Returns true if a node exists at relPath and * false otherwise. * * @param relPath The path of a (possible) node. * @return true if a node exists at relPath; * false otherwise. * @throws RepositoryException If an unspecified error occurs. */ public function hasNode( $relPath ); /** * Indicates whether a property exists at relPath * Returns true if a property exists at relPath and * false otherwise. * * @param relPath The path of a (possible) property. * @return true if a property exists at relPath; * false otherwise. * @throws RepositoryException If an unspecified error occurs. */ public function hasProperty( $relPath ); /** * Indicates whether this node has child nodes. * Returns true if this node has one or more child nodes; * false otherwise. * * @return true if this node has one or more child nodes; * false otherwise. * @throws RepositoryException If an unspecified error occurs. */ public function hasNodes(); /** * Indicates whether this node has properties. * Returns true if this node has one or more properties; * false otherwise. * * @return true if this node has one or more properties; * false otherwise. * @throws RepositoryException If an unspecified error occurs. */ public function hasProperties(); /** * Returns the primary node type of this node. * * @return a NodeType object. */ public function getPrimaryNodeType(); /** * Returns an array of NodeType objects representing the mixin node types * assigned to this node. * * @return a NodeType object. */ public function getMixinNodeTypes(); /** * Indicates whether this node is of the specified node type. * Returns true if this node is of the specified node type * or a subtype of the specified node type. Returns false otherwise. * This method provides a quick method for determining whether * a particular node is of a particular type without having to * manually search the inheritance hierarchy (which, in some implementations * may be a multiple-inhertiance hierarchy, making a manual search even * more complex). This method works for both perimary node types and mixin * node types. * * @param nodeTypeName the name of a node type. * @return true if this node is of the specified node type * or a subtype of the specified node type; returns false otherwise. * @throws RepositoryException If an unspecified error occurs. */ public function isNodeType( $nodeTypeName ); /** * Adds the specified mixin node type to this node. If a conflict with * another assigned mixin or the main node type results, then an exception * is thrown on save. Adding a mixin node type to a node immediately adds * the name of that type to the list held in that node�s * jcr:mixinTypes property. * * @param mixinName */ public function addMixin( $mixinName ); /** * Removes the specified mixin node type from this node. Also removes mixinName * from this node's jcr:mixinTypes property. The mixin node type removal * takes effect on save. *

* If this node does not have the specified mixin, a NoSuchNodeTypeException is thrown. *

* A ConstraintViolationException will be thrown if the removal of a mixin is not allowed * (implementations are free to enforce any policy they like with regard to mixin removal). *

* A VersionException is thrown if this node is versionable and checked-in or is * non-versionable but its nearest versionable ancestor is checked-in. *

* A LockException is thrown if a lock prevents the removal of the mixin. * * @param mixinName the name of the mixin node type to be removed. * @throws NoSuchNodeTypeException If the specified mixinName * is not currently assigned to this node. * @throws ConstraintViolationException If the specified mixin node type * is prevented from being removed. * @throws VersionException if this node is versionable and checked-in or is non-versionable but its * nearest versionable ancestor is checked-in. * @throws LockException if a lock prevents the removal of the mixin. * @throws RepositoryException If another error occurs. */ public function removeMixin( $mixinName ); /** * Returns true if the specified mixin node type, * mixinName, can be added to this node. Returns * false otherwise. Addition of a mixin can be * prevented for any of the following reasons: *

* * @param mixinName * @return true if the specified mixin node type, * mixinName, can be added to this node; false otherwise. * @throws RepositoryException if an error occurs. */ public function canAddMixin( $mixinName ); /** * Returns the definition of this Node. This method is * actually a shortcut to searching through this node's parent's node type * (and its supertypes) for the child node definition applicable to this * node. * * @return a NodeDefinition object. * @see NodeType#getChildNodeDefinitions */ public function getDefinition(); /** * Creates a new version with a system generated version name and returns that version. * * @return a Version object * @throws UnsupportedRepositoryOperationException if versioning is not supported. * @throws RepositoryException If another error occurs. */ public function checkin(); /** * Sets this versionable node to checked-out status by setting its * jcr:isCheckedOut property to true. * * @throws UnsupportedRepositoryOperationException if versioning is not supported. * @throws RepositoryException If another error occurs. */ public function checkout(); /** * Updates this node to reflect the state (i.e., have the same properties * and child nodes) of this node's corresponding node in srcWorkspace (that * is, the node in srcWorkspace with the same UUID as this node). If * shallow is set to false, then only this node is updated. If shallow is * set to true then every node with a UUID in the subtree rooted at this * node is updated. If the current ticket does not have sufficient rights * to perform the update or the specified workspace does not exist, a * NoSuchWorkspaceException is thrown. If another error occurs * then a RepositoryException is thrown. If the update succeeds the changes * made to this node are persisted immediately, there is no need to call * save. * * @param srcWorkspaceName the name of the source workspace. * @param shallow a boolean * @throws RepositoryException If another error occurs. */ public function update( $srcWorkspaceName, $shallow ); /** * This method can be thought of as a version-sensitive update * (see 7.1.7 Updating and Cloning Nodes across Workspaces in the * specification). * * It recursively tests each versionable node in the subtree of this * node against its corresponding node in srcWorkspace with respect to * the relation between their respective base versions and either updates * the node in question or not, depending on the outcome of the test. * For details see 8.2.10 Merge in the specification. A MergeException * is thrown if bestEffort is false and a versionable node is encountered * whose corresponding node's base version is on a divergent branch from * this node's base version. * * If successful, the changes are persisted immediately, there is no need * to call save. * * This method returns a NodeIterator over all versionable nodes in the * subtree that received a merge result of fail. * * If bestEffort is false, this iterator will be empty (since if it merge * returns successfully, instead of throwing an exception, it will be * because no failures were encountered). * * If bestEffort is true, this iterator will contain all nodes that * received a fail during the course of this merge operation. * * If the specified srcWorkspace does not exist, a NoSuchWorkspaceException * is thrown. * * If the current session does not have sufficient permissions to perform * the operation, then an AccessDeniedException is thrown. * * An InvalidItemStateException is thrown if this session (not necessarily * this node) has pending unsaved changes. * * A LockException is thrown if a lock prevents the merge. * * @param srcWorkspace the name of the source workspace. * @param shallow a boolean * @return iterator over all nodes that received a merge result of "fail" * in the course of this operation. * @throws UnsupportedRepositoryOperationException if versioning is not supported. * @throws MergeException succeeds if the base version of the corresponding * node in srcWorkspace is not a successor of the base version of this node. * @throws NoSuchWorkspaceException If the current * ticket does not have sufficient rights to perform the merge or the * specified workspace does not exist. * @throws RepositoryException If another error occurs. */ public function merge( $srcWorkspace, $shallow ); /** * Returns true if this node is currently checked-out and false otherwise. * * @return a boolean * @throws UnsupportedRepositoryOperationException if versioning is not supported. * @throws RepositoryException If another error occurs. */ public function isCheckedOut(); /** * Restores this node to the state recorded in the specified version. * * @param versionName, or Version Object * @throws UnsupportedRepositoryOperationException if versioning is not supported. * @throws RepositoryException If another error occurs. */ public function restore( $in ); /** * Restores this node to the state recorded in the version specified by * versionLabel. * * @param versionLabel a String * @throws UnsupportedRepositoryOperationException if versioning is not supported. * @throws RepositoryException If another error occurs. */ public function restoreByLabel( $versionLabel ); /** * Returns the VersionHistory object of this node. This object * is simply a wrapper for the nt:versionHistory node holding * this node's versions. * * @return a VersionHistory object * @throws UnsupportedRepositoryOperationException if versioning is not supported. * @throws RepositoryException If another error occurs. */ public function getVersionHistory(); /** * Returns the current base version of this versionable node. * * @return a Version object. * @throws UnsupportedRepositoryOperationException if versioning is not supported. * @throws RepositoryException If another error occurs. */ public function getBaseVersion(); /** * Completes the merge process with respect to this node and the specified version. *

* When the {@link #merge} method is called on a node, every versionable node in that * subtree is compared with its corresponding node in the indicated other workspace and * a "merge test result" is determined indicating one of the following: *

    *
  1. * This node will be updated to the state of its correspondee (if the base version * of the correspondee is more recent in terms of version history) *
  2. *
  3. * This node will be left alone (if this node's base version is more recent in terms of * version history). *
  4. *
  5. * This node will be marked as having failed the merge test (if this node's base version * is on a different branch of the version history from the base version of its * corresponding node in the other workspace, thus preventing an automatic determination * of which is more recent). *
  6. *
* (See {@link #merge} for more details) *

* In the last case the merge of the non-versionable subtree * (the "content") of this node must be done by the application (for example, by * providing a merge tool for the user). *

* Additionally, once the content of the nodes has been merged, their version graph * branches must also be merged. The JCR versioning system provides for this by * keeping a record, for each versionable node that fails the merge test, of the * base verison of the corresponding node that caused the merge failure. This record * is kept in the jcr:mergeFailed property of this node. After a * merge, this property will contain one or more (if * multiple merges have been performed) REFERENCEs that point * to the "offending versions". *

* To complete the merge process, the client calls doneMerge(Version v) * passing the version object referred to be the jcr:mergeFailed property * that the client wishes to connect to this node in the version graph. * This has the effect of moving the reference to the indicated version from the * jcr:mergeFailed property of this node to the * jcr:predecessors. *

* If the client chooses not to connect this node to a particular version referenced in * the jcr:mergeFailed property, he calls {@link #cancelMerge(Version version)}. * This has the effect of removing the reference to the specified version from * jcr:mergeFailed without adding it to jcr:predecessors. *

* Once the last reference in jcr:mergeFailed has been either moved to * jcr:predecessors (with doneMerge) or just removed * from jcr:mergeFailed (with cancelMerge) the jcr:mergeFailed * property is automatically removed, thus enabling this * node to be checked-in, creating a new version (note that before the jcr:mergeFailed * is removed, its OnParentVersion setting of ABORT prevents checkin). * This new version will have a predecessor connection to each version for which doneMerge * was called, thus joining those branches of the version graph. *

* If successful, these changes are persisted immediately, * there is no need to call save. *

* A VersionException is thrown if the version specified is * not among those referecned in this node's jcr:mergeFailed property. *

* If there are unsaved changes pending on this node, an InvalidItemStateException is thrown. *

* An UnsupportedRepositoryOperationException is thrown if this repsoitory does not * support versioning. *

* A RepositoryException is thrown if another error occurs. * * @param version a version referred to by this node's jcr:mergeFailed * property. * @throws VersionException if the version specifed is * not among those referenced in this node's jcr:mergeFailed * or if this node is currently checked-in. * @throws InvalidItemStateException if there are unsaved changes pending on this node. * @throws UnsupportedRepositoryOperationException * if versioning is not supported in * this repository. * @throws RepositoryException if another error occurs. */ public function doneMerge( /* Version */ $version ); /** * Cancels the merge process with respect to this node and specified version. *

* See {@link #doneMerge} for a full explanation. Also see {@link #merge} for * more details. *

* If successful, these changes are persisted immediately, * there is no need to call save. *

* A VersionException is thrown if the version specified is * not among those referecned in this node's jcr:mergeFailed. *

* An UnsupportedRepositoryOperationException is thrown if this repsoitory does not * support versioning. *

* If there are unsaved changes pending on this node, an InvalidItemStateException is thrown. *

* A RepositoryException is thrown if another error occurs. * * @param version a version referred to by this node's jcr:mergeFailed * property. * @throws VersionException if the version specifed is * not among those referenced in this node's jcr:mergeFailed or if this node is currently checked-in. * @throws InvalidItemStateException if there are unsaved changes pending on this node. * @throws UnsupportedRepositoryOperationException * if versioning is not supported in * this repository. * @throws RepositoryException if another error occurs. */ public function cancelMerge( /* Version */ $version ); /** * Returns the absolute path of the node in the specified workspace that * corresponds to this node. *

* The corresponding node is defined as the node in srcWorkspace * with the same UUID as this node or, if this node has no UUID, the same * path relative to the nearest ancestor that does have a UUID, * or the root node, whichever comes first. This is qualified by the requirment that * referencable nodes only correspond with other referencables and non-referenceables * with other non-referenceables. *

* If no corresponding node exists then an ItemNotFoundException is thrown. *

* If the specified workspace does not exist then a NoSuchWorkspaceException is thrown. *

* If the current Session does not have sufficent rights to perform this operation, * an AccessDeniedException is thrown. * * @param workspaceName * @return the absolute path to the corresponding node. * @throws ItemNotFoundException if no corresponding node is found. * @throws NoSuchWorkspaceException if the worksapce is unknown. * @throws AccessDeniedException if the current session has insufficent rights to perform this operation. * @throws RepositoryException if another error occurs. */ public function getCorrespondingNodePath( $workspaceName ); /** * Places a lock on this node. If successful, this node is said to hold the lock. *

* If isDeep is true then the lock applies to this node and all its descendant nodes; * if false, the lock applies only to this, the holding node. *

* If isSessionScoped is true then this lock will expire upon the expiration of the current * session (either through an automatic or explicit Session.logout); if false, this lock * does not expire until explicitly unlocked or automatically unlocked due to a implementation-specific limitation, * such as a timeout. *

* Returns a Lock object reflecting the state of the new lock and including a lock token. See, in * contrast, {@link Node#getLock}, which returns the Lock without the lock token. *

* The lock token is also automatically added to the set of lock tokens held by the current Session. *

* If successful, then the property jcr:lockOwner is created and set to the value of * Session.getUserId for the current session and the property jcr:lockIsDeep is set to the * value passed in as isDeep. These changes are persisted automatically; there is no need to call * save. *

* Note that it is possible to lock a node even if it is checked-in (the lock-related properties will be changed * despite the checked-in status). *

* If this node is not of mixin node type mix:lockable then an * UnsupportedRepositoryOperationException is thrown. *

* If this node is already locked (either because it holds a lock or a lock above it applies to it), * a LockException is thrown. *

* If isDeep is true and a descendant node of this node already holds a lock, then a * LockException is thrown. *

* If the current session does not have sufficient privileges to place the lock, an * AccessDeniedException is thrown. *

* An InvalidItemStateException is thrown if this node has pending unsaved changes. *

* A RepositoryException is thrown if another error occurs. * * @param isDeep if true this lock will apply to this node and all its descendants; if * false, it applies only to this node. * @param isSessionScoped if true, this lock expires with the current session; if false it * expires when explicitly or automatically unlocked for some other reason. * @return A Lock object containing a lock token. * @throws UnsupportedRepositoryOperationException * if this node is not mix:lockable. * @throws LockException if this node is already locked. * @throws AccessDeniedException if this session does not have permission to lock this node. * @throws InvalidItemStateException if this node has pending unsaved changes. * @throws RepositoryException is another error occurs. */ public function lock( $isDeep, $isSessionScoped ); /** * Returns the Lock object that applies to this node. This may be either a lock on this node itself * or a deep lock on a node above this node. *

* If this Session (the one through which this Node was acquired) * holds the lock token for this lock, then the returned Lock object contains * that lock token (accessible through Lock.getLockToken). If this Session * does not hold the applicable lock token, then the returned Lock object will not * contain the lock token (its Lock.getLockToken method will return null). *

* If this node is not of mixin node type mix:lockable then * an UnsupportedRepositoryOperationException is thrown. *

* If no lock applies to this node, a LockException is thrown. *

* If the current session does not have sufficient privileges to get the lock, an AccessDeniedException * is thrown. *

* A RepositoryException is thrown if another error occurs. * * @return The applicable Lock object, without a contained lock token. * @throws UnsupportedRepositoryOperationException * If this node is not of mixin node type mix:lockable. * @throws LockException if no lock applies to this node. * @throws AccessDeniedException if the curent session does not have pernmission to get the lock. * @throws RepositoryException is another error occurs. */ public function getLock(); /** * Removes the lock on this node. Also removes the properties jcr:lockOwner and * jcr:lockIsDeep from this node. These changes are persisted automatically; there is no need to call * save. *

* Note that it is possible to unlock a node even if it is checked-in (the lock-related properties will be changed * despite the checked-in status). *

* If this node is mix:lockable but either does not currently hold a lock or * holds a lock for which this Session does not have the correct lock token, * then a LockException is thrown. *

* If this node is not mix:lockable then an UnsupportedRepositoryOperationException is * thrown. *

* Note that either of these exceptions may be thrown when an attempt is made to unlock a node that is locked due * to a deep lock above it. *

* In such cases the unlock method fails because the lock is not held by this node. If the current session does not * have sufficient privileges to remove the lock, an AccessDeniedException is thrown. *

* An InvalidItemStateException is thrown if this node has pending unsaved changes. *

* A RepositoryException is thrown if another error occurs. * * @throws UnsupportedRepositoryOperationException * if this node is not mix:lockable. * @throws LockException i If this node is mix:lockable but either does not currently hold a lock or * holds a lock for which this Session does not have the correct lock token * @throws AccessDeniedException if the current session does not have permission to unlock this node. * @throws InvalidItemStateException if this node has pending unsaved changes. * @throws RepositoryException if another error occurs. */ public function unlock(); /** * Returns true if this node holds a lock; otherwise returns false. To hold a * lock means that this node has actually had a lock placed on it specifically, as opposed to just having a lock * apply to it due to a deep lock held by a node above. * * @return a boolean. * @throws RepositoryException if an error occurs. */ public function holdsLock(); /** * Returns true if this node is locked either as a result of a lock held by this node or by a deep * lock on a node above this node; otherwise returns false. * * @return a boolean. * @throws RepositoryException if an error occurs. */ public function isLocked(); } ?>