public class Page extends AbstractPage implements Hierarchical<Page>, ContentConvertible
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_TYPE |
COLLABORATIVE_EDITING_UUID, CONFLUENCE_RECOVERY, CONFLUENCE_RECOVERY_WITH_EXTERNAL_CHANGE, CONTENT_RESTORED_SYNC_REV_SOURCE, CREATED, CURRENT, DELETED, DRAFT, DUMMY_SYNC_REV, LIMITED_MODE_SYNC_REV_SOURCE, MODIFIED, SHARE_ID, SYNC_REV, SYNC_REV_SOURCE, SYNCHRONY_RECOVERY, SYNCHRONY_RECOVERY_WITH_EXTERNAL_CHANGE, SYNCHRONY_SYNC_REV_SOURCE
INITIAL_VERSION
Constructor and Description |
---|
Page() |
Modifier and Type | Method and Description |
---|---|
void |
addChild(Page child) |
void |
convertToHistoricalVersion()
Remove all data from the object that does not need to be saved by historical versions.
|
Page |
copyLatestVersion()
Copy page information
|
List<Page> |
getAncestors()
Gets the list of ancestors of this page (its parents, and its parents parents, right up to the root level
of the containing space).
|
List<Page> |
getChildren() |
ContentId |
getContentId()
Returns the
ContentId for this Page. |
ContentType |
getContentTypeObject() |
List<Page> |
getDescendants() |
List<Page> |
getDescendents()
Deprecated.
since 5.5.1. Use
getDescendants() |
String |
getLinkWikiMarkup() |
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() |
Integer |
getPosition() |
List<Page> |
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() |
void |
incPosition() |
boolean |
isHomePage() |
boolean |
isIndexable()
pages, blogs etc that aren't not associated with a space (either because they are historical or corrupt) should not be indexed
if they are indexed, and returned in search results, they are broken and are therefore useless
|
boolean |
isRootLevel() |
void |
remove(PageManager pageManager)
Sever any homepage
|
void |
removeChild(Page child) |
void |
setAncestors(List<Page> ancestors)
This should only ever be set by Hibernate.
|
void |
setChildren(List<Page> children) |
void |
setParent(Page parent)
Deprecated.
Since 1.1. 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 |
setPosition(Integer position) |
void |
setSpace(Space newSpace) |
void |
severParentChildRelationships()
sever parent/child relationships
|
boolean |
shouldConvertToContent() |
void |
trash()
places content in trash can
|
getAttachmentsUrlPath, getAttachmentUrlPath, getConfluenceRevision, getLatestVersion, getOriginalVersionPage, getPageLevelComments, getPreviousVersion, getSearchableDependants, getTopLevelComments, getUrlPath, hasInvalidTitleCharacters, isValidPageTitle, isValidPageTitleCharacter, isValidTitleLength, setContentPropertiesFromDraft, setOriginalVersionPage, setTitle
getSpace, getSpaceKey, hashCode, isInSpace
addAttachment, addComment, addCustomContent, addOutgoingLink, addPermission, addReferralLink, addTrackbackLink, applyChildVersioningPolicy, clone, compareTo, ensureAttachmentBelongsToContent, equals, getAttachmentNamed, getAttachments, getBodyAsString, getBodyAsStringWithoutMarkup, getBodyContent, getBodyContent, getBodyContents, getCollaborativeEditingUuid, getComments, getContainerContent, getContentEntityObject, getContentPermission, getContentPermissionSet, getContentStatus, getContentStatusObject, getDefaultBodyType, getDisplayTitle, getEntity, getExcerpt, getIdAsString, getLatestVersionId, getLatestVersionsOfAttachments, getLowerTitle, getOriginalVersionId, getOutgoingLinks, getPermissions, getProperties, getReferralLinks, getRenderedVersionComment, getSelector, getShareId, getSynchronyRevision, getSynchronyRevisionSource, getTitle, getTrackbackLinks, getTypeEnum, getUserAccessor, getVersionComment, hasContentPermissions, hasPermissions, isCurrent, isDeleted, isDraft, isRecentlyUpdatedFor, isUnpublished, isVersionCommentAvailable, removeAttachment, removeComment, removeContentPermissionSet, removeCustomContent, removeOutgoingLink, removeReferralLink, removeTrackbackLink, replaceContentProperties, restore, restoreDependents, setAttachments, setBodyAsString, setBodyContent, setBodyContents, setCollaborativeEditingUuid, setComments, setContainerContent, setContentPropertiesFrom, setContentStatus, setOriginalVersion, setOriginalVersionId, setOutgoingLinks, setReferralLinks, setShareId, setSynchronyRevision, setSynchronyRevisionSource, setTrackbackLinks, setUserAccessor, setVersionComment, sharedAccessAllowed, sharedAccessAllowed, toPageContext, toString, trashDependents, wasCreatedBy
addLabelling, getGlobalLabels, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getLabelUtil, getPersonalLabels, getTeamLabels, getVisibleLabels, isFavourite, isFavourite, removeLabelling, setLabellings
getOriginalVersion, getVersion, getVersionChildPolicy, isLatestVersion, isNew, setVersion
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierName
getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate
finalize, getClass, notify, notifyAll, wait, wait, wait
getSelector
getId
getId, isPersistent
public static final String CONTENT_TYPE
public void setPosition(Integer position)
public void incPosition()
public Integer getPosition()
public boolean isRootLevel()
isRootLevel
in interface Hierarchical<Page>
public Page getParent()
getParent
in interface Hierarchical<Page>
@Deprecated public void setParent(Page parent)
setParent
in interface Hierarchical<Page>
public void setParentPage(Page parent)
parent
- the page to set as this page's parentIllegalArgumentException
- if the parent page is in a different space.public List<Page> getChildren()
getChildren
in interface Hierarchical<Page>
public boolean hasChildren()
hasChildren
in interface Hierarchical<Page>
public void setChildren(List<Page> children)
setChildren
in interface Hierarchical<Page>
public void addChild(Page child)
addChild
in interface Hierarchical<Page>
public void removeChild(Page child)
removeChild
in interface Hierarchical<Page>
public boolean isHomePage()
public String getType()
ContentEntityObject
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.
getType
in interface ContentTypeAware
getType
in class ContentEntityObject
public void convertToHistoricalVersion()
Versioned
When using Hibernate to persist versioned objects, take special care to null any field that might contain a Hibernate-persisted collection, as Hibernate does not allow two different persistent objects to refer to the same persisted collection at the same time.
convertToHistoricalVersion
in interface Versioned
convertToHistoricalVersion
in class AbstractPage
public String getNameForComparison()
ContentEntityObject
getNameForComparison
in class SpaceContentEntityObject
public void severParentChildRelationships()
public void remove(PageManager pageManager)
remove
in class AbstractPage
public String getLinkWikiMarkup()
getLinkWikiMarkup
in interface HasLinkWikiMarkup
public void trash()
ContentEntityObject
trash
in class ContentEntityObject
@Deprecated public List<Page> getDescendents()
getDescendants()
public List<Page> getAncestors()
For strange historical reasons, this list is in the opposite order you would expect. The LAST element of the list will be this page's parent.
getAncestors
in interface Hierarchical<Page>
public void setAncestors(List<Page> ancestors)
public void setSpace(Space newSpace)
setSpace
in class SpaceContentEntityObject
public boolean isIndexable()
SpaceContentEntityObject
isIndexable
in interface com.atlassian.bonnie.Searchable
isIndexable
in class SpaceContentEntityObject
public ContentType getContentTypeObject()
getContentTypeObject
in interface ContentConvertible
public ContentId getContentId()
ContentId
for this Page.getContentId
in interface ContentConvertible
getContentId
in class ContentEntityObject
public boolean shouldConvertToContent()
shouldConvertToContent
in interface ContentConvertible
public Page copyLatestVersion()
Copyright © 2003–2016 Atlassian. All rights reserved.