com.atlassian.confluence.pages
Class Page

java.lang.Object
  extended bycom.atlassian.core.bean.EntityObject
      extended bycom.atlassian.confluence.core.ConfluenceEntityObject
          extended bycom.atlassian.confluence.core.AbstractVersionedEntityObject
              extended bycom.atlassian.confluence.core.ContentEntityObject
                  extended bycom.atlassian.confluence.core.SpaceContentEntityObject
                      extended bycom.atlassian.confluence.pages.AbstractPage
                          extended bycom.atlassian.confluence.pages.Page
All Implemented Interfaces:
Addressable, Cloneable, Comparable, Hierarchical, Labelable, Searchable, Serializable, Versioned

public class Page
extends AbstractPage
implements Hierarchical

Represents a Page within Confluence.

See Also:
Serialized Form

Field Summary
static String CONTENT_TYPE
           
protected static org.apache.log4j.Category log
           
 
Fields inherited from class com.atlassian.confluence.core.ContentEntityObject
CREATED, CURRENT, DELETED, MODIFIED
 
Constructor Summary
Page()
           
 
Method Summary
 void addChild(Page child)
           
 void convertToHistoricalVersion()
           
 List getAncestors()
           
 List getChildren()
           
 List getDescendents()
           
protected  org.apache.log4j.Category getLog()
           
 String getNameForComparison()
          Subclasses should implement this method, giving a String back so that the content can be alphabetically sorted in a mixed-type list of content-entities.
 Page getParent()
           
 List getSortedChildren()
           
 String getType()
          An easy name for the type of this content: makes it easy for things like the #contentLink macro to work out what to draw.
 boolean hasChildren()
           
 boolean isHomePage()
           
 boolean isRootLevel()
           
 void remove(PageManager pageManager)
          Sever any homepage
 void removeChild(Page child)
           
 void setAncestors(List ancestors)
           
 void setChildren(List children)
           
 void setParent(Page parent)
          Deprecated. Do not call this method. It exists solely for hibernate to use. Use #setParentPage instead. I would have made this method private, but CGLIB was complaining.
 void setParentPage(Page parent)
          Public setter that makes sure that the parent page is valid
 void setSpace(Space newSpace)
           
 void severParentChildRelationships()
          sever parent/child relationships
 void trash()
          places content in trash can
 
Methods inherited from class com.atlassian.confluence.pages.AbstractPage
addComment, getAttachmentsUrlPath, getComments, getOriginalVersionPage, getPreviousVersion, getSearchableDependants, getTopLevelComments, getUrlPath, isValidPageTitle, isValidPageTitleCharacter, removeComment, setComments, setOriginalVersionPage, setTitle
 
Methods inherited from class com.atlassian.confluence.core.SpaceContentEntityObject
addTrackbackLink, getSpace, getSpaceKey, hashCode, isIndexable, isInSpace
 
Methods inherited from class com.atlassian.confluence.core.ContentEntityObject
addAttachment, addLabelling, addOutgoingLink, addPermission, addReferralLink, clone, compareTo, equals, getAttachmentNamed, getAttachments, getBodyContents, getContent, getContentPermission, getContentPermissionSet, getContentStatus, getExcerpt, getGlobalLabels, getIdAsString, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getLabelUtil, getLatestVersionsOfAttachments, getOutgoingLinks, getPermissions, getPersonalLabels, getRealTitle, getReferralLinks, getRenderedVersionComment, getTitle, getTrackbackLinks, getUserAccessor, getVersionComment, getVisibleLabels, isCurrent, isDeleted, isFavourite, isRecentlyUpdatedFor, isVersionCommentAvailable, removeAttachment, removeContentPermissionSet, removeLabelling, removeOutgoingLink, removeReferralLink, removeTrackbackLink, setAttachments, setBodyContents, setContent, setContentStatus, setOutgoingLinks, setReferralLinks, setTrackbackLinks, setUserAccessor, setVersionComment, toPageContext, toString
 
Methods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
getLatestVersion, getOriginalVersion, getVersion, isLatestVersion, isNew, setOriginalVersion, setVersion
 
Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreatorName, getLastModifierName, isPersistent, setCreatorName, setLastModifierName
 
Methods inherited from class com.atlassian.core.bean.EntityObject
getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.bonnie.Searchable
getId
 
Methods inherited from interface com.atlassian.confluence.core.Addressable
getId
 

Field Detail

log

protected static org.apache.log4j.Category log

CONTENT_TYPE

public static final String CONTENT_TYPE
See Also:
Constant Field Values
Constructor Detail

Page

public Page()
Method Detail

isRootLevel

public boolean isRootLevel()
Specified by:
isRootLevel in interface Hierarchical

getParent

public Page getParent()
Specified by:
getParent in interface Hierarchical

setParent

public void setParent(Page parent)
Deprecated. Do not call this method. It exists solely for hibernate to use. Use #setParentPage instead. I would have made this method private, but CGLIB was complaining.

Specified by:
setParent in interface Hierarchical

setParentPage

public void setParentPage(Page parent)
Public setter that makes sure that the parent page is valid

Parameters:
parent - the page to set as this page's parent
Throws:
IllegalArgumentException - if the parent page is in a different space.

getChildren

public List getChildren()
Specified by:
getChildren in interface Hierarchical

hasChildren

public boolean hasChildren()
Specified by:
hasChildren in interface Hierarchical

getSortedChildren

public List getSortedChildren()

setChildren

public void setChildren(List children)
Specified by:
setChildren in interface Hierarchical

addChild

public void addChild(Page child)
Specified by:
addChild in interface Hierarchical

removeChild

public void removeChild(Page child)
Specified by:
removeChild in interface Hierarchical

isHomePage

public boolean isHomePage()

getType

public String getType()
Description copied from class: ContentEntityObject
An easy name for the type of this content: makes it easy for things like the #contentLink macro to work out what to draw.

This is a bit of a hack, but it saves heaps of code elsewhere, especially since we tend to get back these objects wrapped in all sorts of Hibernate CGLIB stuff.

Specified by:
getType in interface Addressable
Specified by:
getType in class ContentEntityObject

convertToHistoricalVersion

public void convertToHistoricalVersion()
Specified by:
convertToHistoricalVersion in interface Versioned
Overrides:
convertToHistoricalVersion in class AbstractPage

getNameForComparison

public String getNameForComparison()
Description copied from class: ContentEntityObject
Subclasses should implement this method, giving a String back so that the content can be alphabetically sorted in a mixed-type list of content-entities.

Overrides:
getNameForComparison in class SpaceContentEntityObject

severParentChildRelationships

public void severParentChildRelationships()
sever parent/child relationships


remove

public void remove(PageManager pageManager)
Sever any homepage

Overrides:
remove in class AbstractPage

trash

public void trash()
Description copied from class: ContentEntityObject
places content in trash can

Overrides:
trash in class ContentEntityObject

getDescendents

public List getDescendents()

getAncestors

public List getAncestors()
Specified by:
getAncestors in interface Hierarchical

setAncestors

public void setAncestors(List ancestors)

setSpace

public void setSpace(Space newSpace)
Overrides:
setSpace in class SpaceContentEntityObject

getLog

protected org.apache.log4j.Category getLog()
Specified by:
getLog in class ContentEntityObject
Returns:
The category to log for this class


Confluence is developed by Atlassian.