/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { Node } from "../../types/javax/jcr/Node"; import type { Property } from "../../types/javax/jcr/Property"; import type { Object } from "../../types/java/lang/Object"; import type { String } from "../../types/java/lang/String"; import type { List } from "../../types/java/util/List"; import type { LinkValueBuilder } from "../LinkValueBuilder"; import type { RelatedValueBuilder } from "../RelatedValueBuilder"; import type { GeolocationValueBuilder } from "../GeolocationValueBuilder"; /** *
* Utility used to handle metadata. Due to the nature of the Sitevision metadata it is not suited to alter the values using JCR * (i.e. due to inheritance). This utility adds the functionality needed to access and alter metadata. *
* ** Note that any metadata value is available as property on a JCR-node. *
* *
* An instance of the Sitevision class implementing this interface can be obtained via {@link senselogic.sitevision.api.Utils#getMetadataUtil()}.
* See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the Utils interface.
*
* Set a new value to a metadata Property on a Node. The node must
* be of such a type where it is possible to define a metadata value (e.g. page, article, template, file, image)
* or an IllegalArgumentException will be thrown.
*
* For comprehensive information about supported metadata see alternate method * {@link #setMetadataPropertyValue(javax.jcr.Node, String, Object)}. *
* *
* Important note! This method operates in the {@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION}.
* Hence, if you set a metadata value, aNode must be published (see {@link senselogic.sitevision.api.versioning.PublishingUtil})
* to have any effect in the {@link senselogic.sitevision.api.versioning.VersionUtil#ONLINE_VERSION}
*
Node where the metadata value should be altered. May not be null
* @param aProperty the Property that should be altered. May not be null
* @param aValue the new value. May not be null
* @throws LockException is thrown if the specified is locked for editing (i.e. someone else is currently editing the same node)
* @throws RepositoryException if anything goes wrong
* @see #setMetadataPropertyValue(javax.jcr.Node, String, Object)
*/
setMetadataPropertyValue(
aNode: Node,
aProperty: Property,
aValue: unknown
): void;
/**
*
* Set a new value to a metadata Property on a Node. The node must
* be of such a type where it is possible to define a metadata value (e.g. page, article, template, file, image)
* or an IllegalArgumentException will be thrown.
*
This method currently supports alternation of the following metadata types:
*UnsupportedOperationException is
* thrown. The value is handled as a string (i.e. toString).
* UnsupportedOperationException is thrown. The value is
* a comma separated string of the alternatives. It is also possible to provide a collection
* or an array of strings corresponding to the alternatives.
* Date, Calendar, Long,
* Integer or Double. If no valid value is provided an
* UnsupportedOperationException is thrown.
* Node (of type sv:user or sv:simpleUser) or an id String to a JCR-node
* corresponding to the designated user. If no valid value is provided an
* UnsupportedOperationException is thrown.
* Node (of type sv:user, sv:userGroup or sv:userContainer) or an id String to a JCR-node
* corresponding to the designated directory object. It is also possible to provide a collection, an
* array of such objects or a comma separated list of ids. If no valid value is provided an
* UnsupportedOperationException is thrown.
* Node or an id String to a JCR-node that can be used as link (e.g. page, article, image, file).
* If no valid value is provided an UnsupportedOperationException is thrown.
* Number (e.g. Integer, Long, Double etc.)
* or the toString() method of the value must be parseable as an int (i.e. Integer.parseInt(aValue.toString())
* must not throw a NumberFormatException).
* If no valid value is provided an UnsupportedOperationException is thrown.
* UnsupportedOperationException is thrown.
* UnsupportedOperationException is
* thrown. The value must be of type sv:tag or a tag name as a String.
* UnsupportedOperationException is thrown. The value is
* a comma separated string of the tag names. Note that tag names provided as a comma separated string must be prefixed with #.
* It is also possible to provide a collection or an array of sv:tag or strings of tag names.
* UnsupportedOperationException is thrown.
*
* Important note! This method operates in the {@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION}.
* Hence, if you set a metadata value, aNode must be published (see {@link senselogic.sitevision.api.versioning.PublishingUtil})
* to have any effect in the {@link senselogic.sitevision.api.versioning.VersionUtil#ONLINE_VERSION}
*
* Throws NullPointerException or IllegalArgumentException if an illegal argument is provided.
* Throws UnsupportedOperationException if an invalid value or metadata property type is specified.
* Throws ConstraintViolationException (i.e. a RepositoryException) if current user
* doesn't have permission to write metadata on the node.
*
Node where the metadata value should be altered. May not be null
* @param aPropertyName the name of the metadata property that should be altered. May not be null
* @param aValue the new value. May not be null
* @throws LockException is thrown if the specified node is locked for editing (i.e. someone else is currently editing the same node)
* @throws RepositoryException if anything goes wrong
* @see #setMetadataPropertyValue(javax.jcr.Node, javax.jcr.Property, Object)
*/
setMetadataPropertyValue(
aNode: Node,
aPropertyName: String | string,
aValue: unknown
): void;
/**
* Removes a metadata Property value on a Node. The node must
* be of such a type where it is possible to define a metadata value (e.g. page, article, template,
* file, image) or an IllegalArgumentException will be thrown.
* For comprehensive information, see alternate method * {@link #removeMetadataPropertyValue(javax.jcr.Node, String) removeMetadataPropertyValue(Node, String)} *
. * *Important note! This method operates in the {@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION}.
* Hence, if you remove a metadata value, aNode must be published (see {@link senselogic.sitevision.api.versioning.PublishingUtil})
* to have any effect in the {@link senselogic.sitevision.api.versioning.VersionUtil#ONLINE_VERSION}
Node where the metadata value should be removed. May not be null
* @param aProperty the Property that should be removed. May not be null
* @throws RepositoryException if anything goes wrong
* @see #removeMetadataPropertyValue(javax.jcr.Node, String)
*/
removeMetadataPropertyValue(aNode: Node, aProperty: Property): void;
/**
* Removes a metadata Property value on a Node. The node must
* be of such a type where it is possible to define a metadata value (e.g. page, article, template,
* file, image) or an IllegalArgumentException will be thrown.
Due to the hierarchical nature of the metadata and the inheritance mechanism, a removal of a value * does not necessarily mean that the value is removed (it may then be inherited from a parent node)
* *Note that the result of removal of a text metadata on the node where the metadata definition is defined
* is not the null value but an empty String. This means that the JCR property will be available after
* the removal and contain "" as value.
Important note! This method operates in the {@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION}.
* Hence, if you remove a metadata value, aNode must be published (see {@link senselogic.sitevision.api.versioning.PublishingUtil})
* to have any effect in the {@link senselogic.sitevision.api.versioning.VersionUtil#ONLINE_VERSION}
Throws NullPointerException or IllegalArgumentException if illegal arguments
* are used. Throws ConstraintViolationException (i.e. a RepositoryException)
* if current user doesn't have permission to write metadata on the node.
Node where the metadata value should be removed. May not be null
* @param aPropertyName the name of the metadata property that should be removed. May not be null
* @throws RepositoryException if anything goes wrong
* @see #removeMetadataPropertyValue(javax.jcr.Node, javax.jcr.Property)
*/
removeMetadataPropertyValue(
aNode: Node,
aPropertyName: String | string
): void;
/**
* Returns a boolean indicating that the metadata value on the Node is
* inherited from a parent node.
Note that this method returns true when the metadata definition is defined on the
* Node and the value is null
Important note! This method operates in the {@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION}
* @param aNode theNode that contains the metadata value. May not be null
* @param aProperty the metadata Property that should be queried. May not be null
* @return a boolean indicating the inheritance
* @throws RepositoryException if anything goes wrong
* @see #isMetadataValueInherited(javax.jcr.Node, javax.jcr.Property, int)
*/
isMetadataValueInherited(aNode: Node, aProperty: Property): boolean;
/**
* Returns a boolean indicating that the metadata value in a specified version on the Node is
* inherited from a parent node.
Note that this method returns true when the metadata definition is defined on the
* Node and the value is null
Node that contains the metadata value. May not be null
* @param aProperty the metadata Property that should be queried. May not be null
* @param aVersion {@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION}
or {@link senselogic.sitevision.api.versioning.VersionUtil#ONLINE_VERSION}
* @return a boolean indicating the inheritance
* @throws RepositoryException if anything goes wrong
* @since Sitevision 2.6.1_04
*/
isMetadataValueInherited(
aNode: Node,
aProperty: Property,
aVersion: number
): boolean;
/**
* Returns a boolean indicating that the metadata value on the Node is
* inherited from a parent node.
Note that this method returns true when the metadata definition is defined on the
* Node and the value is null
Important note! This method operates in the {@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION}
* @param aNode theNode that contains the metadata value. May not be null
* @param aPropertyName the name of the metadata property that should be queried. May not be null
* @return a boolean indicating the inheritance
* @throws RepositoryException if anything goes wrong
* @see #isMetadataValueInherited(javax.jcr.Node, String, int)
*/
isMetadataValueInherited(
aNode: Node,
aPropertyName: String | string
): boolean;
/**
* Returns a boolean indicating that the metadata value in a specified version on the Node is
* inherited from a parent node.
Note that this method returns true when the metadata definition is defined on the
* Node and the value is null
Node that contains the metadata value. May not be null
* @param aPropertyName the name of the metadata property that should be queried. May not be null
* @param aVersion {@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION}
or {@link senselogic.sitevision.api.versioning.VersionUtil#ONLINE_VERSION}
* @return a boolean indicating the inheritance
* @throws RepositoryException if anything goes wrong
* @since Sitevision 2.6.1_04
*/
isMetadataValueInherited(
aNode: Node,
aPropertyName: String | string,
aVersion: number
): boolean;
/**
*
* Returns a List containing all related metadata values for a specified Node.
*
* Important note! The returned List is not type safe and my contain either a Node
* and/or a String depending on its findings.
*
Node that contains the metadata value. May not be null
* @param aPropertyName the name of the metadata property that should be queried. May not be null
* @return a List containing all related metadata values, or an empty List if no could be found.
* @throws NullPointerException if aNode or aPropertyName is null.
* @throws IllegalArgumentException if aNode is of wrong type (a node that doesn't have metadata).
* @throws RepositoryException if anything goes wrong while accessing aNode or extracting the result
* @since Sitevision 2.6.2_03
*/
getRelatedMetadataPropertyValues(
aNode: Node,
aPropertyName: String | string
): List;
/**
* Returns a Node for a link metadata on a specified Node.
Important note! The nodes returned by this method are temporary objects and are not part of the * Sitevision model. This means that methods like {@link javax.jcr.Node#getPath()}, {@link javax.jcr.Node#getParent()} and * {@link javax.jcr.Node#getName()} etc. will not return any information.
* @param aNode theNode that contains the link metadata value. May not be null
* @param aPropertyName the name of the link metadata property that should be queried. May not be null
* @return a temporary Node representing the link metadata value, or null if no link could be found.
* @throws NullPointerException if aNode or aPropertyName is null.
* @throws IllegalArgumentException if aNode is of wrong type (a node that doesn't have metadata).
* @throws RepositoryException if anything goes wrong while accessing aNode or extracting the result
* @since Sitevision 3.1
*/
getLinkMetadataPropertyValue(
aNode: Node,
aPropertyName: String | string
): Node;
/**
* * Returns a link value builder that creates {@link senselogic.sitevision.api.metadata.value.LinkValue} instances. *
* *
* Tip! A LinkValue can be used to set a link metadata
* via {@link #setMetadataPropertyValue(javax.jcr.Node, String, Object)}
* or {@link #setMetadataPropertyValue(javax.jcr.Node, javax.jcr.Property, Object)}.
*
* Returns a related value builder that creates {@link senselogic.sitevision.api.metadata.value.RelatedValue} instances. *
* *
* Tip! A RelatedValue can be used to set a related metadata
* via {@link #setMetadataPropertyValue(javax.jcr.Node, String, Object)}
* or {@link #setMetadataPropertyValue(javax.jcr.Node, javax.jcr.Property, Object)}.
*
* Returns a geolocation value builder that creates {@link senselogic.sitevision.api.metadata.value.GeolocationValue} instances. *
* *
* Tip! A GeolocationValue can be used to set a geolocation metadata
* via {@link #setMetadataPropertyValue(javax.jcr.Node, String, Object)}
* or {@link #setMetadataPropertyValue(javax.jcr.Node, javax.jcr.Property, Object)}.
*