Interface ContentService

All Known Implementing Classes:
LegacyContentServiceImpl

@Deprecated public interface ContentService
Deprecated.
since 7.0.1 use ContentService and ContentLabelService where applicable
Basic service for managing Confluence content.
  • Method Details

    • findById

      com.atlassian.fugue.Option<Content> findById(long id, Expansion... expansions)
      Deprecated.
      Retrieve a piece of content by its ID.
      Parameters:
      id - the id of the content to retrieve.
      Returns:
      the content, if any exists by this ID and optional type restriction, or none otherwise.
    • findNextVersion

      com.atlassian.fugue.Option<Content> findNextVersion(long id, Expansion... expansions)
      Deprecated.
      Retrieve the next version of a piece of content, if it exists
      Parameters:
      id - the id of the content in question
      Returns:
      the next version of the content, if it exists
    • findPreviousVersion

      com.atlassian.fugue.Option<Content> findPreviousVersion(long id, Expansion... expansions)
      Deprecated.
      Retrieve the next version of a piece of content, if it exists
      Parameters:
      id - the id of the content in question
      Returns:
      the previous version of the content, if it exists
    • findCurrentVersion

      com.atlassian.fugue.Option<Content> findCurrentVersion(long id, Expansion... expansions)
      Deprecated.
      Retrieve the next version of a piece of content, if it exists
      Parameters:
      id - the id of the content in question
      Returns:
      the current version of the content, if it exists
    • find

      com.atlassian.fugue.Option<Content> find(ContentLocator locator, Expansion... expansions)
      Deprecated.
      Retrieve a piece of content by some more complex criteria (defined by the ContentLocator).
      Parameters:
      locator - the locator containing the criteria for the content you are looking for
      Returns:
      the content, if one exists matching the criteria, or none otherwise.
    • findSubContent

      PartialList<Content> findSubContent(long id, ContentType subContentType, int offset, int count, Expansion... expansions)
      Deprecated.
      Retrieve content that is "contained within" some other piece of content (i.e. comments attached to a page).
    • findSubContentTree

      PartialList<ContentTree> findSubContentTree(long parentId, ContentType subContentType, Expansion... expansions)
      Deprecated.
      Retrieve content that is "contained within" some other piece of content (i.e. comments attached to a page), returned as a tree of parent/child content to a given depth. Any expansions are applied to every node of the tree. This method should have some kind of depth sanity, but I can't think how...
    • getContentBody

      ContentBody getContentBody(long contentId, ContentRepresentation contentRepresentation) throws NotFoundException, InvalidRepresentationException
      Deprecated.
      Get the body of a piece of content in a given representation
      Parameters:
      contentId - The ID of the content to look up
      contentRepresentation - the format in which to render the content body
      Returns:
      the requested content body
      Throws:
      NotFoundException - if the content does not exist, or is not viewable by the user
      InvalidRepresentationException - if the content can not be provided in the requested representation
    • updateContentBody

      ContentBody updateContentBody(long contentId, ContentRepresentation contentRepresentation, ContentBody body) throws NotFoundException, InvalidRepresentationException, NotPermittedException
      Deprecated.
      Update the body of a given piece of content (i.e. perform an edit)
      Parameters:
      contentId - the ID of the content to edit
      contentRepresentation - the way the content is represented in the body
      body - the new body for the given content
      Throws:
      NotFoundException - if the content does not exist, or is not viewable by the user
      NotPermittedException - if the current user does not have permission to update the content
      InvalidRepresentationException - if the content can not be provided in the requested representation
    • getLabels

      Iterable<Label> getLabels(long contentId, Collection<Label.Prefix> prefixes) throws NotFoundException
      Deprecated.
      Get the labels attached to a given piece of content in the given namespaces
      Parameters:
      contentId - the id of the content to retrieve
      Throws:
      NotFoundException - if the content does not exist, or is not viewable by the user
    • addLabels

      Iterable<Label> addLabels(long contentId, Iterable<Label> labels) throws IllegalArgumentException
      Deprecated.
      Adds the given labels to the specified content
      Parameters:
      contentId - the id of the content to add labels to
      labels - the label(s) that will be added
      Returns:
      all the labels that are associated with the specified content
      Throws:
      IllegalArgumentException - if at least one label is invalid. Provides an error message
    • removeLabel

      void removeLabel(long contentId, long labelId) throws IllegalArgumentException
      Deprecated.
      Remove a label with labelId from the specified content
      Parameters:
      contentId - the id of the content to remove the label from
      labelId - the id of the label to remove
      Throws:
      IllegalArgumentException - failed to remove the label
    • validateLabels

      Iterable<Label> validateLabels(Iterable<Label> labels) throws IllegalArgumentException
      Deprecated.
      Validates the list of labels
      Parameters:
      labels - the list of labels to validate
      Returns:
      the list of labels iff all labels are valid
      Throws:
      IllegalArgumentException - if at least one label is invalid. Provides an error message
    • getThemeKey

      String getThemeKey(long contentId)
      Deprecated.
      Temporary method to check whether the page/blog post represented by contentId uses a theme that the new stack can render.
      Returns:
      String of the form "pluginKey:moduleKey" if the content represents a page/blog post, null otherwise
    • hasCustomLayout

      boolean hasCustomLayout(String spaceKey)
      Deprecated.
      Temporary method to check whether a space has custom layouts applied to it