/** * 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. *

* @author Mikael Wikblom * @since Sitevision 2.6.1 */ export interface MetadataUtil { /** *

* 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} *

* @param aNode the 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:

* * *

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

* @param aNode the 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}

* @param aNode the 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.

* @param aNode the 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 the Node 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

* @param aNode the 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 the 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 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

* @param aNode the 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. *

* @param aNode the 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 the Node 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)}. *

* @return a link value builder. * @since Sitevision 3.6 */ getLinkValueBuilder(): LinkValueBuilder; /** *

* 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)}. *

* @return a related value builder. * @since Sitevision 3.6 */ getRelatedValueBuilder(): RelatedValueBuilder; /** *

* 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)}. *

* @return a geolocation value builder * @since Sitevision 2025.11.1 */ getGeolocationValueBuilder(): GeolocationValueBuilder; } declare namespace MetadataUtil {} declare var metadataUtil: MetadataUtil; export default metadataUtil;