Package com.atlassian.confluence.pages
Class AbstractPage
java.lang.Object
com.atlassian.core.bean.EntityObject
- All Implemented Interfaces:
Searchable
,Content
,Addressable
,ContentTypeAware
,HasLinkWikiMarkup
,Versioned
,RelatableEntity
,EditableLabelable
,Labelable
,Spaced
,Serializable
,Cloneable
,Comparable<ContentEntityObject>
Parent of the concrete Page and BlogPost classes
- See Also:
-
Field Summary
Fields 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_SOURCE
Fields inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
INITIAL_VERSION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Remove all data from the object that does not need to be saved by historical versions.Deprecated, for removal: This API element is subject to removal in a future version.static String
generateTitleSlug
(String title) Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.generateTitleSlug(String)
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.getAttachmentsUrlPath()
getAttachmentUrlPath
(Attachment attachment) Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.getAttachmentUrlPath(Attachment)
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.getEditUrlPath()
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.getIdBasedPageUrl()
Get the latest, current version of this versioned object.if this page is a historical version, then this method returns the current/latest version of this page if this page is the latest version, then this returns null this method name should really be refactored to getCurrentVersionOfPage()int
Convenience method to get the immediately prior version since we can't perform arithmetic in velocity (assume that versions are sequential) Method is used in email templates where session is not available.When we un-index something (say, a page), we also need to un-index everything contained within that page (comments, attachments), because presumably they're all about to go away.Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.getUrlPath()
getUrlPath
(boolean shouldDisplayTitle) Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.getUrlPath(boolean)
static boolean
isValidPageTitle
(String title) boolean
There is anotherSpace.isValidSpaceKey(String)
but it only validates the personal space key with a very relaxed rulestatic boolean
isValidTitleLength
(String title) void
remove
(PageManager pageManager) Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 usePageManager.remove(AbstractPage)
void
Deprecated.void
setOriginalVersionPage
(AbstractPage originalVersionPage) void
Methods inherited from class com.atlassian.confluence.core.SpaceContentEntityObject
getNameForComparison, getSpace, getSpaceKey, hashCode, isIndexable, isInSpace, setSpace
Methods 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, getContentId, getContentPermission, getContentPermissionSet, getContentStatus, getContentStatusObject, getCustomContent, getDefaultBodyType, getDisplayTitle, getEntity, getExcerpt, getIdAsString, getLatestVersionId, getLatestVersionsOfAttachments, getLowerTitle, getOriginalVersionId, getOutgoingLinks, getPermissions, getProperties, getRenderedVersionComment, getSelector, getShareId, getSynchronyRevision, getSynchronyRevisionSource, getTitle, getTrashDate, getType, 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, trash, wasCreatedBy
Methods inherited from class com.atlassian.confluence.core.AbstractLabelableEntityObject
addLabelling, getGlobalLabels, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getPersonalLabels, getTeamLabels, getVisibleLabels, isFavourite, removeLabelling, setLabellings
Methods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
getVersion, getVersionChildPolicy, isLatestVersion, isNew, setVersion
Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierName
Methods inherited from class com.atlassian.confluence.core.AnnotatedEntityObject
getCreationDate, getLastModificationDate
Methods inherited from class com.atlassian.core.bean.EntityObject
getCurrentDate, getId, setClock, setCreationDate, setId, setLastModificationDate
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.atlassian.confluence.core.Addressable
getId
Methods inherited from interface com.atlassian.confluence.labels.EditableLabelable
getId, isPersistent
Methods inherited from interface com.atlassian.confluence.core.HasLinkWikiMarkup
getLinkWikiMarkup
Methods inherited from interface com.atlassian.bonnie.Searchable
getId
-
Constructor Details
-
AbstractPage
public AbstractPage()
-
-
Method Details
-
isValidPageTitle
@EnsuresNonNullIf(expression="title", result=true) public static boolean isValidPageTitle(String title) -
isValidTitleLength
-
setTitle
- Overrides:
setTitle
in classContentEntityObject
-
convertToHistoricalVersion
public void convertToHistoricalVersion()Description copied from interface:Versioned
Remove 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:
convertToHistoricalVersion
in interfaceVersioned
- Overrides:
convertToHistoricalVersion
in classSpaceContentEntityObject
-
getOriginalVersionPage
if this page is a historical version, then this method returns the current/latest version of this page if this page is the latest version, then this returns null this method name should really be refactored to getCurrentVersionOfPage() -
setOriginalVersionPage
-
getPreviousVersion
public int getPreviousVersion()Convenience method to get the immediately prior version since we can't perform arithmetic in velocity (assume that versions are sequential) Method is used in email templates where session is not available. Hence we cannot load previousVersions to return a page object -
remove
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 usePageManager.remove(AbstractPage)
Remove this page from the world. This method should sever any inverse relationships this page may have with other objects. -
getSearchableDependants
Description copied from interface:Searchable
When we un-index something (say, a page), we also need to un-index everything contained within that page (comments, attachments), because presumably they're all about to go away.- Specified by:
getSearchableDependants
in interfaceSearchable
-
getUrlPath
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.getUrlPath(boolean)
-
getUrlPath
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.getUrlPath()
- Specified by:
getUrlPath
in interfaceAddressable
- Specified by:
getUrlPath
in classContentEntityObject
-
getIdBasedPageUrl
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.getIdBasedPageUrl()
-
isValidSpaceKey
public boolean isValidSpaceKey()There is anotherSpace.isValidSpaceKey(String)
but it only validates the personal space key with a very relaxed rule- Returns:
- true if the space key is valid
-
generateTitleSlug
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.generateTitleSlug()
-
generateTitleSlug
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.generateTitleSlug(String)
-
getEditUrlPath
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.getEditUrlPath()
- Returns:
- String a URL to edit the page in the Confluence editor.
- Since:
- 6.1
-
getPageLevelComments
- Returns:
- List of page-level (i.e. not inline) comments.
- Since:
- 5.6
-
getTopLevelComments
-
getAttachmentsUrlPath
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.getAttachmentsUrlPath()
- Overrides:
getAttachmentsUrlPath
in classContentEntityObject
-
getAttachmentUrlPath
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useAddressablePage.getAttachmentUrlPath(Attachment)
Description copied from class:ContentEntityObject
Gets the path relative to Confluence's base URL to view the given attachment in the context of this content (for example, highlighted in the content's list of attachments). Generally you will want to callAttachment.getUrlPath()
instead of this method: if we ever implement view pages for individual attachments, that's the method that will be changed to point to them.The default implementation just returns the view page for this content.
- Overrides:
getAttachmentUrlPath
in classContentEntityObject
- Parameters:
attachment
- one of this content's attachments- Returns:
- the path relative to the base url to view the attachment in the context of this content.
-
getLatestVersion
Description copied from interface:Versioned
Get the latest, current version of this versioned object. If this object is the current version, return this object.Note that drafts are a special version of a
ContentEntityObject
so for drafts this method should return theContentEntityObject
the drafts points to if it exists and the draft itself otherwise.- Specified by:
getLatestVersion
in interfaceVersioned
- Overrides:
getLatestVersion
in classAbstractVersionedEntityObject
- Returns:
- the current version of this object.
- See Also:
-
setContentPropertiesFromDraft
Deprecated.Initialises theContentProperties
of this AbstractPage by performing a deep clone of theDraft
object's properties. -
getConfluenceRevision
- Overrides:
getConfluenceRevision
in classAbstractVersionedEntityObject
-
AddressablePage.generateTitleSlug()