Copyright© 2008-2024 Sitevision AB, all rights reserved.
@Requireable(value="PublishingUtil") public interface PublishingUtil
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.
An instance of the Sitevision class implementing this interface can be obtained via
Utils.getPublishingUtil()
.
See Utils
for how to obtain an instance of the Utils
interface.
Modifier and Type | Method and Description |
---|---|
void |
clearPublishingSchedule(Node aNode)
Clears the publish and unpublish schedule for a node.
|
PublishStatus |
getPublishStatus(Node aNode)
Gets the publish status of a node.
|
void |
publishNode(Node aNode)
Publishes a node.
|
void |
publishNode(Node aNode,
Date aDate)
Schedules a node publish job for execution at a specified date.
|
void |
publishNode(Node aNode,
Date aPublishDate,
Date anUnpublishDate)
Schedules a node publish job for execution at a specified date and a node unpublish job for execution at another date.
|
void |
publishNodeWithNotification(Node aNode,
Date aNotificationDate)
Publishes a node instantly with a best before notification date.
|
void |
publishNodeWithNotification(Node aNode,
Date aPublishDate,
Date aNotificationDate)
Schedules a node publish job for execution at a specified date with a best before notification date.
|
void |
publishNodeWithNotification(Node aNode,
Date aPublishDate,
Date aUnpublishDate,
Date aNotificationDate)
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.
|
void |
unpublishNode(Node aNode)
Unpublishes a node.
|
void |
unpublishNode(Node aNode,
Date aDate)
Schedules a node unpublish job for execution at a specified date.
|
void publishNode(Node aNode) throws ConstraintViolationException, RepositoryException
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.
aNode
- the node that should be published. May not be null
ConstraintViolationException
- if current user is not authorized to publish nodesRepositoryException
- if something else goes wrongPermissionUtil.hasEffectivePublishPermission(Node, Node)
void publishNode(Node aNode, Date aDate) throws ConstraintViolationException, RepositoryException
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.
aNode
- the node that should be publishedaDate
- the publish dateConstraintViolationException
- if current user is not authorized to publish nodesRepositoryException
- if something else goes wrongPermissionUtil.hasEffectivePublishPermission(Node, Node)
void publishNode(Node aNode, Date aPublishDate, Date anUnpublishDate) throws ConstraintViolationException, RepositoryException
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.
aNode
- the node that should be publishedaPublishDate
- the publish dateanUnpublishDate
- the unpublish dateConstraintViolationException
- if current user is not authorized to publish nodesRepositoryException
- if something else goes wrongPermissionUtil.hasEffectivePublishPermission(Node, Node)
void publishNodeWithNotification(Node aNode, Date aNotificationDate) throws ConstraintViolationException, IllegalArgumentException, RepositoryException
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.
aNode
- the node that should be published. Valid nodes are sv:sitePage, sv:page, sv:article and sv:template.aNotificationDate
- best-before notification date.NullPointerException
- if aNode
is null.IllegalArgumentException
- if aNode
is of invalid type.ConstraintViolationException
- if current user is not authorized to publish nodes.RepositoryException
- on unexpected failures.PermissionUtil.hasEffectivePublishPermission(Node, Node)
void publishNodeWithNotification(Node aNode, Date aPublishDate, Date aNotificationDate) throws ConstraintViolationException, IllegalArgumentException, RepositoryException
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.
aNode
- the node that should be published. Valid nodes are sv:sitePage, sv:page, sv:article and sv:template.aPublishDate
- the publish date for the node.aNotificationDate
- best-before notification date.NullPointerException
- if aNode
is null.IllegalArgumentException
- if aNode
is of invalid type.ConstraintViolationException
- if current user is not authorized to publish nodes.RepositoryException
- on unexpected failures.PermissionUtil.hasEffectivePublishPermission(Node, Node)
void publishNodeWithNotification(Node aNode, Date aPublishDate, Date aUnpublishDate, Date aNotificationDate) throws ConstraintViolationException, IllegalArgumentException, RepositoryException
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.
aNode
- the node that should be published. Valid nodes are sv:sitePage, sv:page, sv:article and sv:template.aPublishDate
- the publish date for the node.aUnpublishDate
- the unpublish date for the node.aNotificationDate
- best-before notification date.NullPointerException
- if aNode
or aUnpublishDate
is null.IllegalArgumentException
- if aNode
is of invalid type.ConstraintViolationException
- if current user is not authorized to publish nodes.RepositoryException
- on unexpected failures.PermissionUtil.hasEffectivePublishPermission(Node, Node)
void unpublishNode(Node aNode) throws RepositoryException
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.
aNode
- the node that should be unpublishedConstraintViolationException
- if current user is not authorized to unpublish nodesRepositoryException
- if something else goes wrongPermissionUtil.hasEffectivePublishPermission(Node, Node)
void unpublishNode(Node aNode, Date aDate) throws RepositoryException
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.
aNode
- the node that should be unpublishedaDate
- the unpublish dateConstraintViolationException
- if current user is not authorized to unpublish nodesRepositoryException
- if something else goes wrongPermissionUtil.hasEffectivePublishPermission(Node, Node)
PublishStatus getPublishStatus(Node aNode) throws RepositoryException
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.
aNode
- the node whose publish status is to be checkedNullPointerException
- if aNode
is nullIllegalArgumentException
- if aNode
is of invalid typeConstraintViolationException
- if current user is not authorized to publish nodesRepositoryException
- if something else goes wrongvoid clearPublishingSchedule(Node aNode) throws RepositoryException
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.
aNode
- that is scheduled for either publishing, unpublishing or bothNullPointerException
- if aNode
is nullIllegalArgumentException
- if aNode
is of invalid typeConstraintViolationException
- if current user is not authorized to clear the schedule for aNode
RepositoryException
- if something else goes wrongSitevision - Portal and Content Management Made Easy
Sitevision is an advanced Java enterprise portal product and a portlet container (JSR 286) that implements Java Content Repository (JSR 283).
Copyright© 2008-2024 Sitevision AB, all rights reserved.