com.atlassian.confluence.content
Interface Content

All Known Implementing Classes:
DefaultContent

public interface Content

This represents some content in Confluence, this can be for example a wiki page, a comment on a page, a blog post, a discussion forum, etc...

Content have an associated ContentType which allow customizing behavior, rendering, possible actions, etc...

TODO: Links - Content can link to other content. Links are from some specific content (by id) to some URL. This allows links to be speculative on content that does not yet exist. Metadata - Content has metadata (stored as content properties) that may be used to display further information about the content.


Method Summary
 Content getContainer()
          Get the container for this content.
 ContentType getContentType()
          Get the type of the content.
 java.util.List getLabels()
          Get the Labels the content has been associated with.
 Content getParent()
          Get the parent content of this content.
 Space getSpace()
          Get the space that the content belongs to
 java.lang.String getStatus()
          Get the status of the content, this can be used to allow/deny access/viewing of contents.
 java.lang.String getText()
          Get the text data of this content.
 java.lang.String getTitle()
          Get the title of this content.
 java.lang.String getType()
          Get the name of the ContentType of this content.
 void setParent(Content parent)
          Sets the parent of this content.
 void setSpace(Space space)
          Set the space this content belongs to
 void setStatus(java.lang.String status)
          Set ths status of this content.
 void setText(java.lang.String text)
          Sets the text data of this content.
 void setTitle(java.lang.String title)
          Sets the title of this content.
 

Method Detail

getLabels

java.util.List getLabels()
Get the Labels the content has been associated with.

Returns:
a list of Labels associated to this content.

getSpace

Space getSpace()
Get the space that the content belongs to

Returns:
Space the space which the content belongs to.

setSpace

void setSpace(Space space)
Set the space this content belongs to

Parameters:
space - the new space

getParent

Content getParent()

Get the parent content of this content. If the content doesn't have any parent then null will be returned.

Examples of parent/child relationship can be a page and a comment, where the comment has the page as a parent, but if you reply to a comment then its 'direct' parent will be the comment it is replying to.

Returns:
the parent Content of this content. null if this content doesn't have a parent.

setParent

void setParent(Content parent)
Sets the parent of this content. Set this to null to indicate this content has no parent.

Parameters:
parent - the new parent of this content
See Also:
getParent()

getStatus

java.lang.String getStatus()

Get the status of the content, this can be used to allow/deny access/viewing of contents.

For example a page could be 'deleted' and therefore not be visible (except from the trash), a blogpost could have a status 'pending' and not be visible except by the author.

Returns:
the String representation of the content's status.

setStatus

void setStatus(java.lang.String status)
Set ths status of this content.

Parameters:
status - the new status

getContainer

Content getContainer()

Get the container for this content.

The container represents the closest parent that is of a different ContentType. For example, a comment, no matter how deeply threaded, has its page as a container.

Returns:
The Content that 'contains' this content. null if this content has no container.

getTitle

java.lang.String getTitle()
Get the title of this content.

Returns:
the String representation ot the content's title.

setTitle

void setTitle(java.lang.String title)
Sets the title of this content.

Parameters:
title - the title of this content

getType

java.lang.String getType()
Get the name of the ContentType of this content.

Returns:
the name of the ContentType, this should return the same value as getContentType().getName

getContentType

ContentType getContentType()

Get the type of the content.

The ContentType allow implementation of the strategy pattern. One can retrieve some (if not all) of a specific content behavior through the ContentType.

Returns:
the ContentType of this content.

getText

java.lang.String getText()

Get the text data of this content.

This should never return null

Returns:
the text data of this content. It will return an empty string if no text data has been set.
See Also:
setText(String)

setText

void setText(java.lang.String text)

Sets the text data of this content.

Parameters:
text - the text to set this content to
See Also:
getText()


Copyright © 2003-2009 Atlassian Pty Ltd. All Rights Reserved.