/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { Node } from "../../types/javax/jcr/Node"; import type { Date } from "../../types/java/util/Date"; import type { PublisherBuilder } from "../PublisherBuilder"; import type PublishStatus from "../PublishStatus"; /** * Publishing/unpublishing utility interface. * *

* Note that when publishing a child node and the parent node hasn't been published, the child node publishing * will be put on hold (marked with a pause sign in editor) until the parent is published. *

* *

* When publishing a page - consider use of {@link Publisher} instead, which is a more powerful and flexible publishing interface. *

* *

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

* @author Mikael Wikblom * @since Sitevision 2.6.1_04 * @see Publisher */ export interface PublishingUtil { /** *

* Publishes a node. *

*

* Valid nodes are sv:sitePage, sv:page, sv:article, sv:collaborationGroupPage, * sv:template and sv:link (must be a "page link", a stand-alone link in the page tree). * If another node is specified an IllegalArgumentException is thrown. *

* *

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

* *

* The current user must be authorized to publish nodes or a ConstraintViolationException will be thrown. *

* @param aNode the node that should be published. May not be null * @throws ConstraintViolationException if current user is not authorized to publish nodes * @throws RepositoryException if something else goes wrong * @see senselogic.sitevision.api.security.PermissionUtil#hasEffectivePublishPermission(Node, Node) * @see Publisher */ publishNode(aNode: Node): void; /** *

* Schedules a node publish job for execution at a specified date. *

*

* Valid nodes are sv:sitePage, sv:page, sv:article, sv:collaborationGroupPage, * sv:template and sv:link (must be a "page link", a stand-alone link in the page tree). * If another node is specified an IllegalArgumentException is thrown. *

* *

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

* *

* The current user must be authorized to publish nodes or a ConstraintViolationException will be thrown. *

* @param aNode the node that should be published * @param aPublishDate the publish date * @throws ConstraintViolationException if current user is not authorized to publish nodes * @throws RepositoryException if something else goes wrong * @see senselogic.sitevision.api.security.PermissionUtil#hasEffectivePublishPermission(Node, Node) * @see Publisher */ publishNode(aNode: Node, aPublishDate: Date): void; /** *

* Schedules a node publish job for execution at a specified date and a node unpublish job for execution at another date. *

*

* Valid nodes are sv:sitePage, sv:page, sv:article, sv:collaborationGroupPage, * sv:template and sv:link (must be a "page link", a stand-alone link in the page tree). * If another node is specified an IllegalArgumentException is thrown. *

* *

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

* *

* The current user must be authorized to publish nodes or a ConstraintViolationException will be thrown. *

* @param aNode the node that should be published * @param aPublishDate the publish date * @param aUnpublishDate the unpublish date * @throws ConstraintViolationException if current user is not authorized to publish nodes * @throws RepositoryException if something else goes wrong * @see senselogic.sitevision.api.security.PermissionUtil#hasEffectivePublishPermission(Node, Node) * @see Publisher */ publishNode(aNode: Node, aPublishDate: Date, aUnpublishDate: Date): void; /** *

* Publishes a node instantly with a best before notification date. *

*

* Valid nodes are sv:sitePage, sv:page, sv:article, sv:collaborationGroupPage, * sv:template and sv:link (must be a "page link", a stand-alone link in the page tree). * If another node is specified an IllegalArgumentException is thrown. *

* *

* If a aNotificationDate is before current date a notification will be sent instantly. * If aNotificationDate is null, no notification will be sent. *

* *

* The current user must be authorized to publish nodes or a ConstraintViolationException will be thrown. *

* @param aNode the node that should be published. Valid nodes are sv:sitePage, sv:page, sv:article and sv:template. * @param aNotificationDate best-before notification date. * @throws NullPointerException if aNode is null. * @throws IllegalArgumentException if aNode is of invalid type. * @throws ConstraintViolationException if current user is not authorized to publish nodes. * @throws RepositoryException on unexpected failures. * @see senselogic.sitevision.api.security.PermissionUtil#hasEffectivePublishPermission(Node, Node) * @see Publisher * @since Sitevision 2.6.2_05 */ publishNodeWithNotification(aNode: Node, aNotificationDate: Date): void; /** *

* Schedules a node publish job for execution at a specified date with a best before notification date. *

*

* Valid nodes are sv:sitePage, sv:page, sv:article, sv:collaborationGroupPage, * sv:template and sv:link (must be a "page link", a stand-alone link in the page tree). * If another node is specified an IllegalArgumentException is thrown. *

*

* If aNotificationDate is null no notification will be sent. If aNotificationDate * is before aPublishDate no notification will be sent since node hasn't been published yet. * If a aNotificationDate is before current date, a notification will be sent instantly. *

* *

* If aPublishDate is null or before current time, the node will be published instantly. *

* *

* The current user must be authorized to publish nodes or a ConstraintViolationException will be thrown. *

* @param aNode the node that should be published. Valid nodes are sv:sitePage, sv:page, sv:article and sv:template. * @param aPublishDate the publish date for the node. * @param aNotificationDate best-before notification date. * @throws NullPointerException if aNode is null. * @throws IllegalArgumentException if aNode is of invalid type. * @throws ConstraintViolationException if current user is not authorized to publish nodes. * @throws RepositoryException on unexpected failures. * @see senselogic.sitevision.api.security.PermissionUtil#hasEffectivePublishPermission(Node, Node) * @see Publisher * @since Sitevision 2.6.2_05 */ publishNodeWithNotification( aNode: Node, aPublishDate: Date, aNotificationDate: Date ): void; /** *

* Schedules a node publish job for execution at a specified date and a node unpublish job for execution at a later * date and a best before notification date. *

*

* Valid nodes are sv:sitePage, sv:page, sv:article, sv:collaborationGroupPage, * sv:template and sv:link (must be a "page link", a stand-alone link in the page tree). * If another node is specified an IllegalArgumentException is thrown. *

* *

* If aNotificationDate is null, no notification will be sent. If aNotificationDate is * before aPublishDate no notification will be sent since node hasn't been published yet. If a * aNotificationDate is before current date, a notification will be sent instantly. *

* *

* If aPublishDate is null or before current time, the node will be published instantly. *

* *

* If aUnpublishDate is before aPublishDate the unpublish job will run but won't affect * the publishing, i.e. the node will be published at the given publish date. *

* *

* The current user must be authorized to publish nodes or a ConstraintViolationException will be thrown. *

* @param aNode the node that should be published. Valid nodes are sv:sitePage, sv:page, sv:article and sv:template. * @param aPublishDate the publish date for the node. * @param aUnpublishDate the unpublish date for the node. * @param aNotificationDate best-before notification date. * @throws NullPointerException if aNode or aUnpublishDate is null. * @throws IllegalArgumentException if aNode is of invalid type. * @throws ConstraintViolationException if current user is not authorized to publish nodes. * @throws RepositoryException on unexpected failures. * @see senselogic.sitevision.api.security.PermissionUtil#hasEffectivePublishPermission(Node, Node) * @see Publisher * @since Sitevision 2.6.2_05 */ publishNodeWithNotification( aNode: Node, aPublishDate: Date, aUnpublishDate: Date, aNotificationDate: Date ): void; /** * Gets a PublisherBuilder instance that offers more flexible publishing options than the publish methods in this interface. * @return a PublisherBuilder instance * @since Sitevision 2026.08.1 */ getPublisherBuilder(): PublisherBuilder; /** *

* Unpublishes a node. *

*

* Valid nodes are sv:sitePage, sv:page, sv:article, sv:collaborationGroupPage, * sv:template and sv:link (must be a "page link", a stand-alone link in the page tree). * If another node is specified an IllegalArgumentException is thrown. *

* *

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

* *

* The current user must be authorized to publish nodes or a ConstraintViolationException will be thrown. *

* @param aNode the node that should be unpublished * @throws ConstraintViolationException if current user is not authorized to unpublish nodes * @throws RepositoryException if something else goes wrong * @see senselogic.sitevision.api.security.PermissionUtil#hasEffectivePublishPermission(Node, Node) */ unpublishNode(aNode: Node): void; /** *

* Schedules a node unpublish job for execution at a specified date. *

*

* Valid nodes are sv:sitePage, sv:page, sv:article, sv:collaborationGroupPage, * sv:template and sv:link (must be a "page link", a stand-alone link in the page tree). * If another node is specified an IllegalArgumentException is thrown. *

* *

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

* *

* The current user must be authorized to publish nodes or a ConstraintViolationException will be thrown. *

* @param aNode the node that should be unpublished * @param aUnpublishDate the unpublish date * @throws ConstraintViolationException if current user is not authorized to unpublish nodes * @throws RepositoryException if something else goes wrong * @see senselogic.sitevision.api.security.PermissionUtil#hasEffectivePublishPermission(Node, Node) */ unpublishNode(aNode: Node, aUnpublishDate: Date): void; /** *

* Gets the publish status of a node. *

* *

* Valid nodes are sv:sitePage, sv:page, sv:article, sv:collaborationGroupPage, * sv:template and sv:link (must be a "page link", a stand-alone link in the page tree). * If another node is specified an IllegalArgumentException is thrown. *

* *

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

* @param aNode the node whose publish status is to be checked * @return the publish status for aNode * @throws NullPointerException if aNode is null * @throws IllegalArgumentException if aNode is of invalid type * @throws ConstraintViolationException if current user is not authorized to publish nodes * @throws RepositoryException if something else goes wrong * @since Sitevision 2024.01.2 */ getPublishStatus(aNode: Node): PublishStatus; /** *

* Clears the publish and unpublish schedule for a node. *

* *

* Valid nodes are sv:sitePage, sv:page, sv:article, sv:collaborationGroupPage, * sv:template and sv:link (must be a "page link", a stand-alone link in the page tree). * If another node is specified an IllegalArgumentException is thrown. *

* *

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

* *

* The current user must be authorized to publish nodes and manage publishing locks or a ConstraintViolationException * will be thrown. *

* @param aNode that is scheduled for either publishing, unpublishing or both * @throws NullPointerException if aNode is null * @throws IllegalArgumentException if aNode is of invalid type * @throws ConstraintViolationException if current user is not authorized to clear the schedule for aNode * @throws RepositoryException if something else goes wrong * @since Sitevision 2024.01.2 */ clearPublishingSchedule(aNode: Node): void; } declare namespace PublishingUtil {} declare var publishingUtil: PublishingUtil; export default publishingUtil;