Interface ContentTrashService
- All Known Implementing Classes:
ContentTrashServiceImpl
public interface ContentTrashService
Controls trashing, restoring and purging
Content
from the instance.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Provides methods for validating the trash, restore and purge methods. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Trash "created by" full name is stored in theContent
metadata as the "createdByFullName" entry.static final String
Trash "created by" username is stored in theContent
metadata as the "createdByUsername" entry.static final String
Trash date is stored in theContent
metadata as the "trashdate" entry.static final String
Trash "deleted by" full name is stored in theContent
metadata as the "deletedByFullName" entry.static final String
Trash "deleted by" username is stored in theContent
metadata as the "deletedByUsername" entry. -
Method Summary
Modifier and TypeMethodDescriptiongetTrashContents
(Space space, LimitedRequest request, Expansion... expansions) Retrieve a subset of the contents of the trash for a particular space.void
Permanently delete a piece of content.Restore a trashed piece of content.void
Trash a piece of content.Get the validator view of this service.
-
Field Details
-
TRASH_DATE_METADATA_KEY
Trash date is stored in theContent
metadata as the "trashdate" entry.- See Also:
-
TRASH_CREATED_BY_USERNAME_METADATA_KEY
Trash "created by" username is stored in theContent
metadata as the "createdByUsername" entry.- See Also:
-
TRASH_CREATED_BY_FULL_NAME_METADATA_KEY
Trash "created by" full name is stored in theContent
metadata as the "createdByFullName" entry.- See Also:
-
TRASH_DELETED_BY_USERNAME_METADATA_KEY
Trash "deleted by" username is stored in theContent
metadata as the "deletedByUsername" entry.- See Also:
-
TRASH_DELETED_BY_FULL_NAME_METADATA_KEY
Trash "deleted by" full name is stored in theContent
metadata as the "deletedByFullName" entry.- See Also:
-
-
Method Details
-
trash
Trash a piece of content.The
purge(Content)
method can be used for content that doesn't support trashing. Currently, only content with typesContentType.PAGE
,ContentType.BLOG_POST
andContentType.ATTACHMENT
(as of Confluence 5.8) support trashing.- Parameters:
content
- the content to be trashed- Throws:
NotFoundException
- if no current content matches the supplied content. If the supplied content is already trashed, thepurge(Content)
should be used instead.BadRequestException
- if the supplied content is invalidPermissionException
- if the current user is not permitted to trash the content
-
restore
Restore a trashed piece of content.- Parameters:
content
- the content to be restored- Returns:
- the content after being restored
- Throws:
NotFoundException
- if no stored content matches the supplied contentBadRequestException
- if the supplied content is invalidPermissionException
- if the current user is not permitted to restore the content
-
purge
Permanently delete a piece of content.There are two main cases:
- Trashable content (e.g. Pages, BlogPosts) must have status "trashed" to be purged.
- Non-trashable content (e.g. Comments, Attachment) can be purged with status "current".
- Parameters:
content
- the content to be purged- Throws:
NotFoundException
- if no purgable content matches the supplied content. This can happen if no content matches the id, or if the content found is trashable but not trashed.BadRequestException
- if the supplied content is invalidPermissionException
- if the current user is not permitted to purge the content
-
getTrashContents
PageResponse<Content> getTrashContents(Space space, LimitedRequest request, Expansion... expansions) Retrieve a subset of the contents of the trash for a particular space.- Parameters:
space
- the space where the trash contents belong torequest
- the pagination request, with a cursor which is an identifier to skip results from a previous query when paginating and limit for the resultexpansions
- the optional properties to expand on the result- Returns:
- the contents of the trash, up to the request limit
- Since:
- 9.0
-
validator
ContentTrashService.Validator validator()Get the validator view of this service.- Returns:
- a Validator that can be used to validate service requests.
-