/**
* This file is auto generated from JavaDoc. Do not modify it manually.
*/
import type { Node } from "../../types/javax/jcr/Node";
import type { Map } from "../../types/java/util/Map";
import type { String } from "../../types/java/lang/String";
/**
* Image utility interface that handles nodes with primary node type sv:image.
*
*
* Note! This interface is used to create images. You would typically use * {@link senselogic.sitevision.api.webresource.structure.StructureUtil} to move an image * and {@link senselogic.sitevision.api.webresource.structure.TrashcanUtil} to delete an image. * To render images, you would typically use {@link senselogic.sitevision.api.render.ImageRenderer} * or {@link senselogic.sitevision.api.render.ImageLinkRenderer}. *
* *
* An instance of the Sitevision class implementing this interface can be obtained via {@link senselogic.sitevision.api.Utils#getImageUtil()}.
* See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the Utils interface.
*
* Adds several images to a sv:localImageRepository, sv:imageRepository, sv:personalImageRepository
* or a sv:folder residing as sub node to an image repository.
* If an other parent node is specified a ConstraintViolationException is thrown.
* The images map keys correspond to the file names (will correspond to the property fileName of the sv:image nodes)
* and the values to URIs pointing to the file resources.
*
* Note that the images must have an image mime-type to be created. *
* *
* URI note! The resource must be accessible from the Sitevision server! Sitevision opens
* a stream to an URL with the aUri value when creating the binary content of the image.
* If a firewall or such blocks outgoing communication from the server - image creation will fail.
*
* Permission note! Current user (the invoker of this method) must have WRITE permission
* on the parent node (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE})
* or a ConstraintViolationException is thrown.
* Creating an image for a sv:userIdentity requires
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES} on current page.
*
null
* @param aImages a map of file name to URI pairs May not be null
* @throws ConstraintViolationException if the user is not authorized to alter the parent node, if an invalid
parent node is specified or if image exceeds file size limit
* @throws RepositoryException if something else goes wrong
*/
createImages(aParent: Node, aImages: Map | {}): void;
/**
* Creates an image using an uri string.
*
*
* Note that the aParent for the image must be a sv:localImageRepository, sv:imageRepository,
* sv:personalImageRepository or a sv:folder residing as sub node to an image repository.
*
* The file must have an image mime-type or an IllegalArgumentException is thrown.
*
* URI note! The resource must be accessible from the Sitevision server! Sitevision opens
* a stream to an URL with the aUri value when creating the binary content of the image.
* If a firewall or such blocks outgoing communication from the server - image creation will fail.
*
* Permission note! Current user (the invoker of this method) must have WRITE permission
* on the parent node (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE})
* or a ConstraintViolationException is thrown.
* Creating an image for a sv:userIdentity requires
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES} on current page.
*
null
* @param aFileName the fileName property of the sv:image. May not be null
* @param aUri the URI pointing to the file resource. May not be null
* @return a sv:image node corresponding to the newly created image. Will never return null
* @throws ConstraintViolationException if the user is not authorized to alter the parent node, if an invalid
parent node is specified or if image exceeds file size limit
* @throws RepositoryException if something else goes wrong
*/
createImage(
aParent: Node,
aFileName: String | string,
aUri: String | string
): Node;
/**
* Creates an image using a base64 string.
*
* * The base64 decoder uses "The Base64 Alphabet" as specified in Table 1 of RFC 4648 and RFC 2045 for decoding operation. * The decoder rejects data that contains characters outside the base64 alphabet. *
*
* Note that the aParent for the image must be a sv:localImageRepository, sv:imageRepository,
* sv:personalImageRepository or a sv:folder residing as sub node to an image repository.
*
* The file name must correspond to an image mime-type or an IllegalArgumentException is thrown.
*
* Permission note! Current user (the invoker of this method) must have WRITE permission
* on the parent node (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE})
* or a ConstraintViolationException is thrown.
* Creating an image for a sv:userIdentity requires
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES} on current page.
*
null
* @param aFileName the fileName property of the sv:image. May not be null
* @param aBase64EncodedString a base64 encoded string. May not be null
* @return a sv:image node corresponding to the newly created image. Will never return null
* @throws ConstraintViolationException if the user is not authorized to alter the parent node, if an invalid
parent node is specified, if aBase64EncodedString is not base64 encoded or if image exceeds file size limit
* @throws RepositoryException if something else goes wrong
* @since Sitevision 4.5.4
*/
createImageFromBase64(
aParent: Node,
aFileName: String | string,
aBase64EncodedString: String | string
): Node;
/**
* Creates an image using a sv:temporaryFile.
*
*
* Note that the aParent for the image must be a sv:localImageRepository, sv:imageRepository,
* sv:personalImageRepository or a sv:folder residing as sub node to an image repository.
*
* The file name must correspond to an image mime-type or an IllegalArgumentException is thrown.
*
* Permission note! Current user (the invoker of this method) must have WRITE permission
* on the parent node (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE})
* or a ConstraintViolationException is thrown.
* Creating an image for a sv:userIdentity requires
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES} on current page.
*
null
* @throws ConstraintViolationException if the user is not authorized to alter the parent node, if an invalid
parent node is specified, if an invalid temporary node is specified or if image exceeds file size limit
* @throws RepositoryException if something else goes wrong
* @since Sitevision 4.5.4
*/
createImageFromTemporary(aParent: Node, aTemporaryFile: Node): Node;
/**
* Copies an image to a given parent.
*
*
* Note that the aParent for the image must be a sv:localImageRepository, sv:imageRepository,
* sv:personalImageRepository or a sv:folder residing as sub node to an image repository.
* The aParent must not be trashed.
*
* Permission note! Current user must be authorized to alter the parent node * (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}). *
* @param aImage the image node to copy * @param aParent the parent node where the image should be copied to * @return an image node corresponding to the newly created image * @throws ConstraintViolationException if the user is not authorized to alter the parent node, if an invalid parent node is specified, if an invalid image node is specified * @throws RepositoryException if something else goes wrong * @since Sitevision 2026.01.1 */ copyImage(aImage: Node, aParent: Node): Node; /** * Updates the binary content of an existing image using a uri string. * *
* Properties related to the binary content will also be updated (e.g. length, width and height).
*
* URI note! The URI must be accessible from the Sitevision server and the ending part * of the URI must match the file extension of the existing image that should be updated! *
*
* Permission note! Current user (the invoker of this method) must have WRITE permission
* on the image node that should be updated (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
* Updating an image for a sv:userIdentity requires
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES} on current page.
*
null
* @param aUri the URI pointing to the file resource to fetch new binary content from. May not be null
* @throws ConstraintViolationException if the user is not authorized to alter the image node,
if an invalid node is specified, if the end part of aUri doesn't match the file extension
of aImage or if image exceeds file size limit
* @throws RepositoryException if something else goes wrong
* @since Sitevision 3.6.3
*/
updateBinaryContent(aImage: Node, aUri: String | string): void;
/**
* Updates the binary content of an existing image using a base64 string.
*
* * The base64 decoder uses "The Base64 Alphabet" as specified in Table 1 of RFC 4648 and RFC 2045 for decoding operation. * The decoder rejects data that contains characters outside the base64 alphabet. *
*
* Properties related to the binary content will also be updated (e.g. length, width and height).
*
* Permission note! Current user (the invoker of this method) must have WRITE permission
* on the image node that should be updated (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
* Updating an image for a sv:userIdentity requires
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES} on current page.
*
null
* @param aBase64EncodedString a base64 encoded string. May not be null
* @throws ConstraintViolationException if the user is not authorized to alter the image node,
if an invalid node is specified, if aBase64EncodedString is not base64 encoded or if image exceeds file size limit
* @throws RepositoryException if something else goes wrong
* @since Sitevision 4.5.4
*/
updateBinaryContentFromBase64(
aImage: Node,
aBase64EncodedString: String | string
): void;
/**
* Updates the binary content of an existing image using a sv:temporaryFile.
*
*
* Properties related to the binary content will also be updated (e.g. length, width and height).
*
* Permission note! Current user (the invoker of this method) must have WRITE permission
* on the image node that should be updated (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
* Updating an image for a sv:userIdentity requires
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES} on current page.
*
null
* @param aTemporaryFile the sv:temporaryFile (typically created via {@link senselogic.sitevision.api.node.builder.TemporaryFileNodeBuilder})
* @throws ConstraintViolationException if the user is not authorized to alter the image node,
if an invalid node is specified, if the end part of the file represented by aTemporaryFile doesn't match the file extension
of aImage or if image exceeds file size limit
* @throws RepositoryException if something else goes wrong
* @since Sitevision 4.5.4
*/
updateBinaryContentFromTemporary(aImage: Node, aTemporaryFile: Node): void;
/**
* Alters the name of an image.
*
*
* If no image is specified a NullPointerException is thrown.
* If the node is not a sv:image an IllegalArgumentException is thrown.
* If no name is provided a NullPointerException is thrown.
*
* Permission note! Current user (the invoker of this method) must have WRITE permission
* on the image node that should be updated (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
* Updating an image for a sv:userIdentity requires
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES} on current page.
*
null
* @param aName the new name of the image. May not be null
* @throws ConstraintViolationException if the current user is not authorized to alter the name of the image
or if the image extension doesn't match
* @throws RepositoryException if something else goes wrong
* @since Sitevision 4.5.2
*/
renameImage(aImage: Node, aName: String | string): void;
/**
* The Base64 String representation of an image Node.
*
* * Reads the binary content of an image and encodes the bytes using * {@link senselogic.sitevision.api.text.EndecUtil#base64encodeToString(byte[])}. *
* @param aImage the image Node (sv:image or sv:temporaryFile), may not be null * @return aImage as base64-encoded String * @throws ConstraintViolationException if aImage is not a sv:image or sv:temporaryFile * @throws RepositoryException if something else goes wrong * @since Sitevision 4.5.5.2 */ toBase64(aImage: Node): string; /** * Sets the alt property for an image Node. * *
* Permission note! Current user (the invoker of this method) must have
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE WRITE} permission
* on the image node that should be updated. Updating an image for a sv:userIdentity requires
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES MANAGE_USER_IDENTITIES} permission
* on current page.
*
* Permission note! Current user (the invoker of this method) must have
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE WRITE} permission
* on the image node that should be updated. Updating an image for a sv:userIdentity requires
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES MANAGE_USER_IDENTITIES} permission
* on current page.
*
* Permission note! Current user (the invoker of this method) must have
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE WRITE} permission
* on the image node that should be updated. Updating an image for a sv:userIdentity requires
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES MANAGE_USER_IDENTITIES} permission
* on current page.
*