Package com.atlassian.confluence.pages
Class Page
java.lang.Object
- All Implemented Interfaces:
Searchable,Content,Addressable,ContentTypeAware,HasLinkWikiMarkup,Hierarchical<Page>,Versioned,RelatableEntity,EditableLabelable,Labelable,ContentConvertible,Spaced,Serializable,Cloneable,Comparable<ContentEntityObject>
Represents a Page within Confluence.
- See Also:
-
Field Summary
FieldsFields inherited from class com.atlassian.confluence.core.ContentEntityObject
COLLABORATIVE_EDITING_UUID, CONFLUENCE_RECOVERY, CONFLUENCE_RECOVERY_WITH_EXTERNAL_CHANGE, CONTENT_RESTORED_SYNC_REV_SOURCE, CREATED, CURRENT, DELETED, DELETED_BY, DELETED_BY_ANON_VALUE, DRAFT, DUMMY_SYNC_REV, LIMITED_MODE_SYNC_REV_SOURCE, MODIFIED, SHARE_ID, SYNC_REV, SYNC_REV_SOURCE, SYNCHRONY_ACK_SYNC_REV_SOURCE, SYNCHRONY_RECOVERY, SYNCHRONY_RECOVERY_WITH_EXTERNAL_CHANGE, SYNCHRONY_SYNC_REV_SOURCEFields inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
INITIAL_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidRemove all data from the object that does not need to be saved by historical versions.Copy page informationGets the list of ancestors of this page (its parents, and its parents parents, right up to the root level of the containing space).Returns theContentIdfor this Page.Get descendants with "current" state onlyDeprecated.since 5.5.1.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.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.booleanvoidbooleanbooleanpages, 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 uselessbooleanvoidremove(PageManager pageManager) Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 usePageManager.remove(AbstractPage)voidremoveChild(Page child) voidsetAncestors(List<Page> ancestors) This should only ever be set by Hibernate.voidsetChildren(List<Page> children) voidDeprecated.Since 1.1.voidsetParentPage(Page parent) Public setter that makes sure that the parent page is validvoidsetPosition(Integer position) voidvoidsever parent/child relationshipsbooleanvoidtrash(ConfluenceUser authenticatedUser) Methods inherited from class com.atlassian.confluence.pages.AbstractPage
generateTitleSlug, generateTitleSlug, getAttachmentsUrlPath, getAttachmentUrlPath, getConfluenceRevision, getEditUrlPath, getIdBasedPageUrl, getLatestVersion, getOriginalVersionPage, getPageLevelComments, getPreviousVersion, getSearchableDependants, getTopLevelComments, getUrlPath, getUrlPath, isValidPageTitle, isValidSpaceKey, isValidTitleLength, setContentPropertiesFromDraft, setOriginalVersionPage, setTitleMethods inherited from class com.atlassian.confluence.core.SpaceContentEntityObject
getSpace, getSpaceKey, hashCode, isInSpaceMethods inherited from class com.atlassian.confluence.core.ContentEntityObject
addAttachment, addComment, addCustomContent, addOutgoingLink, addPermission, applyChildVersioningPolicy, clone, compareTo, ensureAttachmentBelongsToContent, equals, getAttachmentManager, getAttachmentNamed, getAttachments, getBodyAsString, getBodyAsStringWithoutMarkup, getBodyContent, getBodyContent, getBodyContents, getCollaborativeEditingUuid, getComments, getContainerContent, getContentPermission, getContentPermissionSet, getContentStatus, getContentStatusObject, getCustomContent, getDefaultBodyType, getDisplayTitle, getEntity, getExcerpt, getIdAsString, getLatestVersionId, getLatestVersionsOfAttachments, getLowerTitle, getOriginalVersionId, getOutgoingLinks, getPermissions, getProperties, getRenderedVersionComment, getSelector, getShareId, getSynchronyRevision, getSynchronyRevisionSource, getTitle, getTrashDate, getTypeEnum, getVersionComment, hasContentPermissions, hasPermissions, isCurrent, isDeleted, isDraft, isUnpublished, isVersionCommentAvailable, removeAttachment, removeComment, removeContentPermissionSet, removeCustomContent, removeOutgoingLink, replaceContentProperties, restore, restoreDependents, setAttachments, setBodyAsString, setBodyContent, setBodyContents, setCollaborativeEditingUuid, setComments, setContainerContent, setContentPropertiesFrom, setContentStatus, setOriginalVersion, setOriginalVersionId, setOutgoingLinks, setShareId, setSynchronyRevision, setSynchronyRevisionSource, setVersionComment, sharedAccessAllowed, sharedAccessAllowed, toPageContext, toString, trash, trash, wasCreatedByMethods inherited from class com.atlassian.confluence.core.AbstractLabelableEntityObject
addLabelling, getGlobalLabels, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getPersonalLabels, getTeamLabels, getVisibleLabels, isFavourite, removeLabelling, setLabellingsMethods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
getVersion, getVersionChildPolicy, isLatestVersion, isNew, setVersionMethods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierNameMethods inherited from class com.atlassian.confluence.core.AnnotatedEntityObject
getCreationDate, getLastModificationDateMethods inherited from class com.atlassian.core.bean.EntityObject
getCurrentDate, getId, setClock, setCreationDate, setId, setLastModificationDateMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.atlassian.confluence.core.Addressable
getIdMethods inherited from interface com.atlassian.confluence.pages.ContentConvertible
getSelectorMethods inherited from interface com.atlassian.confluence.labels.EditableLabelable
getId, isPersistentMethods inherited from interface com.atlassian.bonnie.Searchable
getId
-
Field Details
-
CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
Page
public Page()
-
-
Method Details
-
setPosition
-
incPosition
public void incPosition() -
getPosition
-
isRootLevel
public boolean isRootLevel()- Specified by:
isRootLevelin interfaceHierarchical<Page>
-
getParent
- Specified by:
getParentin interfaceHierarchical<Page>
-
setParent
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.- Specified by:
setParentin interfaceHierarchical<Page>
-
setParentPage
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
- Specified by:
getChildrenin interfaceHierarchical<Page>
-
hasChildren
public boolean hasChildren()- Specified by:
hasChildrenin interfaceHierarchical<Page>
-
getSortedChildren
-
setChildren
- Specified by:
setChildrenin interfaceHierarchical<Page>
-
addChild
- Specified by:
addChildin interfaceHierarchical<Page>
-
removeChild
- Specified by:
removeChildin interfaceHierarchical<Page>
-
isHomePage
public boolean isHomePage() -
getType
Description copied from class:ContentEntityObjectAn 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:
getTypein interfaceContentTypeAware- Specified by:
getTypein classContentEntityObject- Returns:
- the content type
-
convertToHistoricalVersion
public void convertToHistoricalVersion()Description copied from interface:VersionedRemove all data from the object that does not need to be saved by historical versions. For versioned objects that are persisted, this includes removing associations with other persisted objects that may otherwise cause us to break the expected arity of the database relations.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.
- Specified by:
convertToHistoricalVersionin interfaceVersioned- Overrides:
convertToHistoricalVersionin classAbstractPage
-
getNameForComparison
Description copied from class:ContentEntityObjectSubclasses 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:
getNameForComparisonin classSpaceContentEntityObject
-
severParentChildRelationships
public void severParentChildRelationships()sever parent/child relationships -
remove
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 usePageManager.remove(AbstractPage)Sever any homepage- Overrides:
removein classAbstractPage
-
getLinkWikiMarkup
- Specified by:
getLinkWikiMarkupin interfaceHasLinkWikiMarkup- Returns:
- the wiki markup used to link to this content
-
trash
- Overrides:
trashin classContentEntityObject
-
getDescendants
Get descendants with "current" state only- Returns:
- list of descendants
-
getDescendents
Deprecated.since 5.5.1. UsegetDescendants() -
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). This is more efficient than repeatedly calling getParent() as it does a single join across the ancestors table instead of one query per parent.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.
- Specified by:
getAncestorsin interfaceHierarchical<Page>- Returns:
- the list of ancestors of the page, ordered from the root of the space.
-
setAncestors
This should only ever be set by Hibernate. -
setSpace
- Overrides:
setSpacein classSpaceContentEntityObject
-
isIndexable
public boolean isIndexable()Description copied from class:SpaceContentEntityObjectpages, 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- Specified by:
isIndexablein interfaceSearchable- Overrides:
isIndexablein classSpaceContentEntityObject
-
getContentTypeObject
- Specified by:
getContentTypeObjectin interfaceContentConvertible- Returns:
- the api ContentType that this ContentConvertible converts to
-
getContentId
Returns theContentIdfor this Page.- Specified by:
getContentIdin interfaceContentConvertible- Overrides:
getContentIdin classContentEntityObject- Returns:
- the ContentId representation of this Page's id
-
shouldConvertToContent
public boolean shouldConvertToContent()- Specified by:
shouldConvertToContentin interfaceContentConvertible- Returns:
- true if the implementer wants to be part of the core API (default value), false otherwise
-
copyLatestVersion
Copy page information- Returns:
- Since:
- 5.10
-