/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { Node } from "../../types/javax/jcr/Node"; /** * Trashcan utility interface for delete and restore of nodes. * *

* An instance of the Sitevision class implementing this interface can be obtained via {@link senselogic.sitevision.api.Utils#getTrashcanUtil()}. * See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the Utils interface. *

* @author Mikael Wikblom * @see senselogic.sitevision.api.resource.ResourceLocatorUtil#getTrashcan() * @since Sitevision 2.6.2 */ export interface TrashcanUtil { /** *

* Puts a node in the site trashcan. *

*

* A node that has been deleted (i.e. put in the site trashcan) can later be restored using the method * {@link #restoreNode(javax.jcr.Node)} or be permanently removed with the method * {@link #deleteNodeFromTrashcan(javax.jcr.Node)}. *

*

* Valid node types are: *

* *

* If any other node is specified a ConstraintViolationException is thrown. *

* *

* The current user must be authorized to delete objects, to alter the node and its current parent or * a ConstraintViolationException is thrown * (see {@link senselogic.sitevision.api.security.PermissionUtil#hasEffectiveDeletePermission(Node, Node)}). *

* *

* If no node is specified a NullPointerException is thrown. *

* @param aNode the node that will be moved to the site trashcan. May not be null * @throws ConstraintViolationException if an invalid node is specified or if the current user is not authorized to perform the delete operation * @throws RepositoryException if something else goes wrong * @see senselogic.sitevision.api.security.PermissionUtil#hasEffectiveDeletePermission(Node, Node) */ moveNodeToTrashcan(aNode: Node): void; /** *

* Restores a node from the site trashcan. *

*

* If the node is not in the site trashcan or if an invalid node type is specified * (i.e. a node that never could be in the site trashcan like the sv:site node) * a IllegalArgumentException is thrown. *

* *

* The current user must be authorized to alter the node and the parent node after the * restore operation or a ConstraintViolationException is thrown. *

* *

* If no node is specified a NullPointerException is thrown. *

* @param aNode the node that should be restored. This node must be located in the site trashcan. May not be null * @throws ConstraintViolationException is thrown if the current user is not authorized to perform the restore operation * @throws RepositoryException is thrown if something else goes wrong */ restoreNode(aNode: Node): void; /** *

* Deletes a node from the site trashcan. *

*

* If the node is not in the site trashcan or if an invalid node type is specified * (i.e. a node that never could be in the site trashcan like the sv:site node) * a IllegalArgumentException is thrown. *

* *

* The current user must be authorized to delete objects or a ConstraintViolationException is thrown. *

* *

* If no node is specified a NullPointerException is thrown. *

* @param aNode the node that should be removed from the site trashcan. This node must be located in the site trashcan. May not be null * @throws ConstraintViolationException if the current user is not authorized to perform the delete operation * @throws RepositoryException if something else goes wrong */ deleteNodeFromTrashcan(aNode: Node): void; /** *

* Checks if a node is in the site trashcan *

* *

* If no node is specified a NullPointerException is thrown. *

* *

* Note that some nodes can't be put in the trashcan (e.g. sv:user, sv:color, sv:portlet, sv:layout etc). * For such nodes false will be returned. *

* @param aNode the node to be checked if it is located in the site trashcan. May not be null * @return true if the Node is in site trashcan, false otherwise * @since Sitevision 6.2 */ isInTrashcan(aNode: Node): boolean; } declare namespace TrashcanUtil {} declare var trashcanUtil: TrashcanUtil; export default trashcanUtil;