Interface ContentTrashService

  • All Known Implementing Classes:
    ContentTrashServiceImpl

    public interface ContentTrashService
    Controls trashing, restoring and purging Content from the instance.
    • Field Detail

      • TRASH_DATE_METADATA_KEY

        static final String TRASH_DATE_METADATA_KEY
        Trash date is stored in the Content metadata as the "trashdate" entry.
        See Also:
        Constant Field Values
      • TRASH_CREATED_BY_USERNAME_METADATA_KEY

        static final String TRASH_CREATED_BY_USERNAME_METADATA_KEY
        Trash "created by" username is stored in the Content metadata as the "createdByUsername" entry.
        See Also:
        Constant Field Values
      • TRASH_CREATED_BY_FULL_NAME_METADATA_KEY

        static final String TRASH_CREATED_BY_FULL_NAME_METADATA_KEY
        Trash "created by" full name is stored in the Content metadata as the "createdByFullName" entry.
        See Also:
        Constant Field Values
      • TRASH_DELETED_BY_USERNAME_METADATA_KEY

        static final String TRASH_DELETED_BY_USERNAME_METADATA_KEY
        Trash "deleted by" username is stored in the Content metadata as the "deletedByUsername" entry.
        See Also:
        Constant Field Values
      • TRASH_DELETED_BY_FULL_NAME_METADATA_KEY

        static final String TRASH_DELETED_BY_FULL_NAME_METADATA_KEY
        Trash "deleted by" full name is stored in the Content metadata as the "deletedByFullName" entry.
        See Also:
        Constant Field Values
    • Method Detail

      • restore

        Content restore​(Content content)
        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 content
        BadRequestException - if the supplied content is invalid
        PermissionException - if the current user is not permitted to restore the content
      • purge

        void purge​(Content content)
        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 invalid
        PermissionException - if the current user is not permitted to purge the content
      • validator

        ContentTrashService.Validator validator()
        Get the validator view of this service.
        Returns:
        a Validator that can be used to validate service requests.