/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { String } from "../../../java/lang/String"; import type { Value } from "../Value"; import type { Property } from "../Property"; import type { InputStream } from "../../../java/io/InputStream"; import type { Binary } from "../Binary"; import type { BigDecimal } from "../../../java/math/BigDecimal"; import type { Calendar } from "../../../java/util/Calendar"; import type { NodeIterator } from "../NodeIterator"; import type { PropertyIterator } from "../PropertyIterator"; import type { Item } from "../Item"; import type { NodeType } from "../nodetype/NodeType"; import type { NodeDefinition } from "../nodetype/NodeDefinition"; import type { Version } from "../version/Version"; import type { VersionHistory } from "../version/VersionHistory"; import type { Lock } from "../lock/Lock"; /** * The Node interface represents a node in a workspace. */ export type Node = Item & { /** * Sets the single-value property of this node called name to * the specified value. *

* If the property does not yet exist, it is created and its property type * determined by the by the node type of this node. If, based on the * name and value passed, there is more than one * property definition that applies, the repository chooses one definition * according to some implementation-specific criteria. Once a property with * name P has been created, the behavior of a subsequent * setProperty(P,V) may differ across implementations. Some * repositories may allow P to be dynamically re-bound to a * different property definition (based for example, on the new value being * of a different type than the original value) while other repositories may * not allow such dynamic re-binding. *

* If the property type of the supplied Value object is * different from that required, then a best-effort conversion is * attempted. *

* If the node type of this node does not indicate a specific property type, * then the property type of the supplied Value object is used * and if the property already exists it assumes both the new value and new * property type. *

* Passing a null as the second parameter removes the property. * It is equivalent to calling remove on the * Property object itself. *

* This is a session-write method, meaning that changes made through this * method are dispatched on {@link Session#save}. *

* A ConstraintViolationException will be thrown either * immediately, on dispatch (save whether within or without transactions) or * on persist (save without transactions, commit within a transaction), if * the change would violate a node type or implementation-specific * constraint. Implementations may differ on when this validation is * performed. *

* A VersionException will be thrown either immediately, on * dispatch (save whether within or without transactions) or on persist * (save without transactions, commit within a transaction), if this node is * read-only due to a checked-in node. Implementations may differ on when * this validation is performed. *

* A LockException will be thrown either immediately, on * dispatch (save whether within or without transactions) or on persist * (save without transactions, commit within a transaction), if a lock * prevents the setting of the property. Implementations may differ on when * this validation is performed. * *

Sitevision note: Limited to nodes of primary {@link javax.jcr.nodetype.NodeType} * sv:simpleUser

* @param name The name of a property of this node * @param value The value to be assigned * @return The updated Property object * @throws ValueFormatException if the specified property is a DATE but the value cannot be expressed in the ISO 8601-based format defined in the JCR 2.0 specification and the implementation does not support dates incompatible with that format or if value cannot be converted to the type of the specified property or if the property already exists and is multi-valued. * @throws VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. * @throws LockException if a lock prevents the setting of the property and this implementation performs this validation immediately. * @throws ConstraintViolationException if the change would violate a node-type or other constraint and this implementation performs this validation immediately. * @throws RepositoryException if another error occurs. */ setProperty(name: String | string, value: Value): Property; /** * Sets the multi-value property of this node called name to * the specified array of values. *

* If the property does not yet exist, it is created. *

* The behavior of this method is identical to that of {@link * #setProperty(String name, Value value)} except that an array of * Value objects is assigned instead of a single * Value. *

* The property type of the property will be that specified by the node type * of this node. If the property type of one or more of the supplied * Value objects is different from that required, then a * best-effort conversion is attempted, according to an * implemention-dependent definition of "best effort". If the conversion * fails, a ValueFormatException is thrown. *

* If the property is not multi-valued then a ValueFormatException * is also thrown. If another error occurs, a RepositoryException * is thrown. *

* If the node type of this node does not indicate a specific property type, * then the property type of the supplied Value objects is used * and if the property already exists it assumes both the new values and the * new property type. *

* Passing a null as the second parameter removes the property. * It is equivalent to calling remove on the * Property object itself. Note that this is different from * passing an array that contains null elements. In such a * case, the array is compacted by removing the null values. * The resulting set of values never contains a null. However, the set may * be empty: N.setProperty("P", new Value[]{null}) would set * the property to the empty set of values. * *

Sitevision note: Limited to nodes of primary {@link javax.jcr.nodetype.NodeType} * sv:simpleUser

* @param name the name of the property to be set. * @param values an array of Value objects. * @return the updated Property object. * @throws ValueFormatException if value cannot be converted to the type of the specified property or if the property already exists and is not multi-valued. * @throws VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. * @throws LockException if a lock prevents the setting of the property and this implementation performs this validation immediately. * @throws ConstraintViolationException if the change would violate a node-type or other constraint and this implementation performs this validation immediately. * @throws RepositoryException if another error occurs. */ setProperty(name: String | string, values: Value[]): Property; /** * Sets the specified property to the specified array of values. Same as * {@link #setProperty(String name, Value[] values)} except that the values * are specified as String objects instead of * Value objects. * *

Sitevision note: Limited to nodes of primary {@link javax.jcr.nodetype.NodeType} * sv:simpleUser

* @param name the name of the property to be set. * @param values an array of Value objects. * @return the updated Property object. * @throws ValueFormatException if a value cannot be converted to the type of the specified property or if the property already exists and is not multi-valued. * @throws VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. * @throws LockException if a lock prevents the setting of the property and this implementation performs this validation immediately. * @throws ConstraintViolationException if the change would violate a node-type or other constraint and this implementation performs this validation immediately. * @throws RepositoryException if another error occurs. */ setProperty(name: String | string, values: String[] | string[]): Property; /** * Sets the specified single-value property to the specified value. The * behavior of this method is identical to that of {@link * #setProperty(String name, Value value)} except that the value is * specified as a String. and, if possible, the type assigned * to the property is STRING, otherwise a best-effort * conversion is attempted. * *

Sitevision note: Limited to nodes of primary {@link javax.jcr.nodetype.NodeType} * sv:simpleUser

* @param name The name of a property of this node * @param value The value to assigned * @return The updated Property object * @throws ValueFormatException if value cannot be converted to the type of the specified property or if the property already exists and is multi-valued. * @throws VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. * @throws LockException if a lock prevents the setting of the property and this implementation performs this validation immediately. * @throws ConstraintViolationException if the change would violate a node-type or other constraint and this implementation performs this validation immediately. * @throws RepositoryException if another error occurs. */ setProperty(name: String | string, value: String | string): Property; /** * Sets the specified single-value property to the specified value. If the * property does not yet exist, it is created. *

* The behavior of this method is identical to that of {@link * #setProperty(String name, String value)} except that the intended type of * the property is explicitly specified by the type parameter. * @param name the name of the property to be set. * @param value a String object. * @param type the type of the property. * @return the Property object set, or null if this method was used to remove a property (by setting its value to null). * @throws ValueFormatException if value cannot be converted to the specified type or if the property already exists and is multi-valued. * @throws VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. * @throws LockException if a lock prevents the setting of the property and this implementation performs this validation immediately. * @throws ConstraintViolationException if the change would violate a node-type or other constraint and this implementation performs this validation immediately. * @throws RepositoryException if another error occurs. */ setProperty( name: String | string, value: String | string, type: number ): Property; /** * The behavior of this method is identical to that of {@link * #setProperty(String name, Value value)} except that the value is * specified as a {@link InputStream} and, if possible, the type assigned to * the property is BINARY, otherwise a best-effort conversion * is attempted. *

* The passed stream is closed before this method returns either normally or * because of an exception. *

* @param name The name of a property of this node * @param value The value to assigned * @return The updated Property object * @throws ValueFormatException if value cannot be converted to the type of the specified property or if the property already exists and is multi-valued. * @throws VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. * @throws LockException if a lock prevents the setting of the property and this implementation performs this validation immediately. * @throws ConstraintViolationException if the change would violate a node-type or other constraint and this implementation performs this validation immediately. * @throws RepositoryException if another error occurs. * @deprecated As of JCR 2.0, {@link #setProperty(String, Binary)} should be used instead. */ setProperty(name: String | string, value: InputStream): Property; /** * The behavior of this method is identical to that of {@link * #setProperty(String name, Value value)} except that the value is * specified as a boolean and, if possible, the type assigned * to the property is BOOLEAN, otherwise a best-effort * conversion is attempted. * *

Sitevision note: Limited to nodes of primary {@link javax.jcr.nodetype.NodeType} * sv:simpleUser

* @param name The name of a property of this node * @param value The value to assigned * @return The updated Property object * @throws ValueFormatException if value cannot be converted to the type of the specified property or if the property already exists and is multi-valued. * @throws VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. * @throws LockException if a lock prevents the setting of the property and this implementation performs this validation immediately. * @throws ConstraintViolationException if the change would violate a node-type or other constraint and this implementation performs this validation immediately. * @throws RepositoryException if another error occurs. */ setProperty(name: String | string, value: boolean): Property; /** * The behavior of this method is identical to that of {@link * #setProperty(String name, Value value)} except that the value is * specified as a double and, if possible, the type assigned to * the property is DOUBLE, otherwise a best-effort conversion * is attempted. * *

Sitevision note: Limited to nodes of primary {@link javax.jcr.nodetype.NodeType} * sv:simpleUser

* @param name The name of a property of this node * @param value The value to assigned * @return The updated Property object * @throws ValueFormatException if value cannot be converted to the type of the specified property or if the property already exists and is multi-valued. * @throws VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. * @throws LockException if a lock prevents the setting of the property and this implementation performs this validation immediately. * @throws ConstraintViolationException if the change would violate a node-type or other constraint and this implementation performs this validation immediately. * @throws RepositoryException if another error occurs. */ setProperty(name: String | string, value: number): Property; /** * The behavior of this method is identical to that of {@link * #setProperty(String name, Value value)} except that the value is * specified as a {@link BigDecimal} and, if possible, the type assigned to * the property is DECIMAL, otherwise a best-effort conversion * is attempted. * *

Sitevision note: Limited to nodes of primary {@link javax.jcr.nodetype.NodeType} * sv:simpleUser

* @param name The name of a property of this node * @param value The value to assigned * @return The updated Property object * @throws ValueFormatException if value cannot be converted to the type of the specified property or if the property already exists and is multi-valued. * @throws VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. * @throws LockException if a lock prevents the setting of the property and this implementation performs this validation immediately. * @throws ConstraintViolationException if the change would violate a node-type or other constraint and this implementation performs this validation immediately. * @throws RepositoryException if another error occurs. * @since JCR 2.0 */ setProperty(name: String | string, value: BigDecimal): Property; /** * The behavior of this method is identical to that of {@link * #setProperty(String name, Value value)} except that the value is * specified as a long and, if possible, the type assigned to * the property is LONG, otherwise a best-effort conversion is * attempted. * *

Sitevision note: Limited to nodes of primary {@link javax.jcr.nodetype.NodeType} * sv:simpleUser

* @param name The name of a property of this node * @param value The value to assigned * @return The updated Property object * @throws ValueFormatException if value cannot be converted to the type of the specified property or if the property already exists and is multi-valued. * @throws VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. * @throws LockException if a lock prevents the setting of the property and this implementation performs this validation immediately. * @throws ConstraintViolationException if the change would violate a node-type or other constraint and this implementation performs this validation immediately. * @throws RepositoryException if another error occurs. */ setProperty(name: String | string, value: number): Property; /** * The behavior of this method is identical to that of {@link * #setProperty(String name, Value value)} except that the value is * specified as a {@link Calendar} and, if possible, the type assigned to * the property is DATE, otherwise a best-effort conversion is * attempted. * *

Sitevision note: Limited to nodes of primary {@link javax.jcr.nodetype.NodeType} * sv:simpleUser

* @param name The name of a property of this node * @param value The value to assigned * @return The updated Property object * @throws ValueFormatException if the specified property is a DATE but the value cannot be expressed in the ISO 8601-based format defined in the JCR 2.0 specification (section 3.6.4.3) and the implementation does not support dates incompatible with that format or if value cannot be converted to the type of the specified property or if the property already exists and is multi-valued. * @throws VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. * @throws LockException if a lock prevents the setting of the property and this implementation performs this validation immediately. * @throws ConstraintViolationException if the change would violate a node-type or other constraint and this implementation performs this validation immediately. * @throws RepositoryException if another error occurs. */ setProperty(name: String | string, value: Calendar): Property; /** * The behavior of this method is identical to that of {@link * #setProperty(String name, Value value)} except that the value is * specified as a {@link Node} and, if possible, the type assigned to the * property is REFERENCE or WEAKREFERENCE, * otherwise a best-effort conversion is attempted. *

* The value to which the property is set is the identifier of the passed * node. *

* If the named property does not yet exist and the repository cannot * determine whether a REFERENCE or WEAKREFERENCE * property is intended, then a REFERENCE property is created. * *

Sitevision note: Limited to nodes of primary {@link javax.jcr.nodetype.NodeType} * sv:simpleUser

* @param name The name of a property of this node * @param value The value to assigned * @return The updated Property object. * @throws ValueFormatException if this property is not of type REFERENCE or WEAKREFERENCE or the specified node is not referenceable or if the specified property already exists and is multi-valued. * @throws VersionException if this node is read-only due to a checked-in node and this implementation performs this validation immediately. * @throws LockException if a lock prevents the setting of the property and this implementation performs this validation immediately. * @throws ConstraintViolationException if the change would violate a node-type or other constraint and this implementation performs this validation immediately. * @throws RepositoryException if another error occurs. */ setProperty(name: String | string, value: Node): Property; /** * Returns the node at relPath relative to this node. *

* If relPath contains a path element that refers to a node * with same-name sibling nodes without explicitly including an index using * the array-style notation ([x]), then the index [1] is * assumed (indexing of same name siblings begins at 1, not 0, in order to * preserve compatibility with XPath). *

* Within the scope of a single Session object, if a * Node object has been acquired, any subsequent call of * getNode reacquiring the same node must return a * Node object reflecting the same state as the earlier * Node object. Whether this object is actually the same * Node instance, or simply one wrapping the same state, is up * to the implementation. * @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 or the current Session does not read access to the node at the specified path. * @throws RepositoryException If another error occurs. */ getNode(relPath: String | string): Node; /** * 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 {@link * #getNode(String)}. If this node has no accessible child nodes, then an * empty iterator is returned. * *

* Sitevision note: {@link senselogic.sitevision.api.node.NodeIteratorUtil} can help * facilitate more targeted iteration over child nodes. Typically in combination with a node filter * created via {@link senselogic.sitevision.api.node.NodeFilterUtil}. *

* @return A NodeIterator over all child Nodes of this Node. * @throws RepositoryException if an error occurs. */ getNodes(): NodeIterator; /** * 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 {@link * #getNode(String)}. * @param namePattern a name pattern. * @return a NodeIterator. * @throws RepositoryException if an unexpected error occurs. */ getNodes(namePattern: String | string): NodeIterator; /** * Returns the property at relPath relative to * this node. The same reacquisition semantics apply as with * {@link #getNode(String)}. * *

* Sitevision note: Use {@link senselogic.sitevision.api.property.PropertyUtil} or * {@link senselogic.sitevision.api.property.Properties} instead when working with properties. *

* @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 or if the current

Session does not have read access to the specified property. * @throws RepositoryException If another error occurs. */ getProperty(relPath: String | string): Property; /** * 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 {@link * #getNode(String)}. If this node has no accessible properties, then * an empty iterator is returned. * @return A PropertyIterator. * @throws RepositoryException if an error occurs. */ getProperties(): PropertyIterator; /** * 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 {@link #getNode(String)}. *

* *

* Sitevision note: Use {@link senselogic.sitevision.api.property.PropertyUtil} or * {@link senselogic.sitevision.api.property.Properties} instead when working with properties. *

* @param namePattern a name pattern. * @return a PropertyIterator. * @throws RepositoryException if an unexpected error occurs. */ getProperties(namePattern: String | string): PropertyIterator; /** * 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 {@link #isNodeType(String) isNodeType("mix:referenceable")} can * be made. * @return the UUID of this node. * @throws UnsupportedRepositoryOperationException if this node nonreferenceable. * @throws RepositoryException if another error occurs. * @deprecated As of JCR 2.0, {@link #getIdentifier()} should be used instead. */ getUUID(): string; /** * Returns the identifier of this node. Applies to both referenceable and * non-referenceable nodes. *

* A RepositoryException is thrown if an error occurs. * @return the identifier of this node. * @throws RepositoryException if an error occurs. * @since JCR 2.0 */ getIdentifier(): string; /** * Indicates whether a node exists at relPath Returns * true if a node accessible through the current * Session 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 error occurs. */ hasNode(relPath: String | string): boolean; /** * Indicates whether a property exists at relPath Returns * true if a property accessible through the current * Session 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 error occurs. */ hasProperty(relPath: String | string): boolean; /** * 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. * @return true if this node has one or more child nodes; false otherwise. * @throws RepositoryException if an error occurs. */ hasNodes(): boolean; /** * Indicates whether this node has properties. Returns true if * this node has one or more properties accessible through the current * Session; false otherwise. * @return true if this node has one or more properties; false otherwise. * @throws RepositoryException if an error occurs. */ hasProperties(): boolean; /** * Returns the primary node type in effect for this node. Which * NodeType is returned when this method is called on the root * node of a workspace is up to the implementation. * @return a NodeType object. * @throws RepositoryException if an error occurs */ getPrimaryNodeType(): NodeType; /** * Returns an array of NodeType objects representing the mixin * node types in effect for this node. This includes only those mixin types * explicitly assigned to this node. It does not include mixin types * inherited through the addition of supertypes to the primary type * hierarchy or through the addition of supertypes to the type hierarchy of * any of the declared mixin types. * @return an array of NodeType objects. * @throws RepositoryException if an error occurs */ getMixinNodeTypes(): NodeType; /** * 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. * @param nodeTypeName the name of a node type. * @return 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. */ isNodeType(nodeTypeName: String | string): boolean; /** * A constant for the JCR name jcr:content. This is the name of * a child node declared in {@link NodeType#NT_FILE nt:file} and a property * declared in {@link javax.jcr.nodetype.NodeType#NT_LINKED_FILE * nt:linkedFile}. * @since JCR 2.0 */ JCR_CONTENT: string; /** * A constant for the node name jcr:propertyDefinition declared * in {@link NodeType#NT_FILE nt:nodeType}. * @since JCR 2.0 */ JCR_PROPERTY_DEFINITION: string; /** * A constant for the node name jcr:childNodeDefinition * declared in {@link NodeType#NT_FILE nt:nodeType}. * @since JCR 2.0 */ JCR_CHILD_NODE_DEFINITION: string; /** * A constant for the node name jcr:rootVersion declared in * {@link NodeType#NT_VERSION_HISTORY nt:versionHistory}. * @since JCR 2.0 */ JCR_ROOT_VERSION: string; /** * A constant for the node name jcr:versionLabels declared in * {@link NodeType#NT_VERSION_HISTORY nt:versionHistory}. * @since JCR 2.0 */ JCR_VERSION_LABELS: string; /** * A constant for the node name jcr:frozenNode declared in * {@link NodeType#NT_VERSION nt:version}. * @since JCR 2.0 */ JCR_FROZEN_NODE: string; };