Class Content
- java.lang.Object
-
- com.atlassian.confluence.api.model.content.Content
-
- All Implemented Interfaces:
Container
,Relatable
,NavigationAware
@ExperimentalApi public class Content extends Object implements Container, NavigationAware, Relatable
Represents all the different kinds of content that can be housed in Confluence: pages, blog posts, comments and so on.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Content.ContentBuilder
BuildsContent
objects.static class
Content.Expansions
Provides property names that can be used to expandContent
objects.static class
Content.IdProperties
-
Method Summary
-
-
-
Method Detail
-
getContentId
@Deprecated public static ContentId getContentId(Reference<Content> contentRef)
Deprecated.since 5.10. UsegetSelector()
.Get the ContentId from a Content Reference.- Parameters:
contentRef
- the Reference to return the id from- Returns:
- the contentId or null if the referenced content does not have a contentId.
-
getSelector
public static ContentSelector getSelector(Reference<Content> contentRef)
Get the selector from a Content Reference.- Parameters:
contentRef
- the Reference to return the selector from- Returns:
- the selector or null if the reference cannot return a selector.
-
builder
public static Content.ContentBuilder builder()
Returns aContent.ContentBuilder
instance that can be used to create a newContent
object.
-
builder
public static Content.ContentBuilder builder(ContentType type)
Returns aContent.ContentBuilder
instance that can be used to create a newContent
object.- Parameters:
type
- the type of Content to create
-
builder
public static Content.ContentBuilder builder(ContentType type, long id)
Returns aContent.ContentBuilder
instance that can be used to create a newContent
object.- Parameters:
type
- the type of Content to createid
- the id of the Content to create
-
builder
public static Content.ContentBuilder builder(ContentType type, ContentId id)
Returns aContent.ContentBuilder
instance that can be used to create a newContent
object.- Parameters:
type
- the type of Content to createid
- the id of the Content to create
-
builder
public static Content.ContentBuilder builder(Content content)
Returns aContent.ContentBuilder
instance that clones an existingContent
object.- Parameters:
content
- the Content to clone
-
buildReference
@Deprecated public static Reference<Content> buildReference(ContentId id)
Deprecated.since 5.10. UsebuildReference(ContentSelector)
- Returns:
- a collapsed reference to a piece of content with the given ID
-
buildReference
public static Reference<Content> buildReference(ContentSelector selector)
- Returns:
- a collapsed reference to a piece of content with the given selector
-
getSelector
public ContentSelector getSelector()
-
getId
public ContentId getId()
-
getStatus
public ContentStatus getStatus()
-
getType
public ContentType getType()
-
getTitle
public String getTitle()
-
getHistory
public History getHistory()
-
getSpace
public Space getSpace()
-
getContainer
public Container getContainer()
Returns the container for this Content, which for Pages and Blog Posts will be the Space, and for Comments the Page or BlogPost. The container class MUST be serializable for REST.For the parent of this Content, use
getAncestors()
.
-
getParentId
public ContentId getParentId()
- Returns:
- the contentId of the parent if it is set, or ContentId.UNSET
-
getParent
@Deprecated public com.atlassian.fugue.Option<Content> getParent()
Deprecated.since 6.13.0, use {getOptionalParent()
}
-
getOperations
public List<OperationCheckResult> getOperations()
-
getChildren
public Map<ContentType,PageResponse<Content>> getChildren()
Returns a map of the immediate sub-content of this Content, split by ContentType.Children includes Content of the same type, and Content of other types that is contained within this Content but has no other parent reference.
-
getDescendants
public Map<ContentType,PageResponse<Content>> getDescendants()
Returns a map of all sub-content of this Content, at any depth, split by ContentType.Descendants includes Content of the same type, and Content of other types that is contained within this Content at any depth.
-
getRestrictions
public Map<OperationKey,ContentRestriction> getRestrictions()
Returns a Map of restrictions present on the given Content, grouped by Operation.Is empty by default. Can be collapsed, if not asked to expand while retrieving.
-
getBody
public Map<ContentRepresentation,ContentBody> getBody()
-
getVersion
public Version getVersion()
-
resolveNavigation
public Navigation.Builder resolveNavigation(NavigationService navigationService)
- Specified by:
resolveNavigation
in interfaceNavigationAware
-
-