Interface ContentService

  • All Known Implementing Classes:

    public interface ContentService
    Provides methods for creating, reading, updating and deleting Confluence Content objects such as Pages, BlogPosts and Comments.
    • Method Detail

      • find

        ContentService.ContentFinder find​(Expansion... expansions)
        Create a ContentFinder for locating content, the expansions will be applied to each piece of content that matches the finder. Content will be retrieved by using the fetch methods on the returned ContentFinder.

        For example, to fetch the first 50 blog posts in the DEV Space :

             .fetchMany(new SimplePageRequest(0,50);
        expansions -
      • delete

        void delete​(Content content)
             throws ServiceException
        Removes a piece of Content from the system.

        The way that this method behaves depends on whether the Content being deleted supports trashing, and its current status:

        • Trashable content currently includes Pages and Blogpost, which can have two statuses relevant here:
          1. current, in which case calling this method will trash the content
          2. trashed, in which case calling this method will fail. Clients should use ContentTrashService.purge(Content) to permanently delete trashed content.
        • Non-trashable content (e.g. Comments, Attachments) will be immediately and permanently purged from the system, without being updated to have trashed status.

        The methods ContentTrashService.trash(Content) and ContentTrashService.purge(Content) can be used for content that is known to support trashing.

        content - the content to remove
        ServiceException - if the content cannot be found, or cannot be deleted
      • validator

        ContentService.Validator validator()
        Get the validator view of the ContentService.
        a Validator that can be used to validate service requests.