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_SOURCEFields inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
INITIAL_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRemove 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 StringgenerateTitleSlug(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()intConvenience 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 booleanisValidPageTitle(String title) booleanThere is anotherSpace.isValidSpaceKey(String)but it only validates the personal space key with a very relaxed rulestatic booleanisValidTitleLength(String title) voidremove(PageManager pageManager) Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 usePageManager.remove(AbstractPage)voidDeprecated.voidsetOriginalVersionPage(AbstractPage originalVersionPage) voidMethods inherited from class com.atlassian.confluence.core.SpaceContentEntityObject
getNameForComparison, getSpace, getSpaceKey, hashCode, isIndexable, isInSpace, setSpaceMethods 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, 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.labels.EditableLabelable
getId, isPersistentMethods inherited from interface com.atlassian.confluence.core.HasLinkWikiMarkup
getLinkWikiMarkupMethods 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:
setTitlein classContentEntityObject
-
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 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:SearchableWhen 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:
getSearchableDependantsin 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:
getUrlPathin interfaceAddressable- Specified by:
getUrlPathin 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:
getAttachmentsUrlPathin 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:ContentEntityObjectGets 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:
getAttachmentUrlPathin 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:VersionedGet 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
ContentEntityObjectso for drafts this method should return theContentEntityObjectthe drafts points to if it exists and the draft itself otherwise.- Specified by:
getLatestVersionin interfaceVersioned- Overrides:
getLatestVersionin classAbstractVersionedEntityObject- Returns:
- the current version of this object.
- See Also:
-
setContentPropertiesFromDraft
Deprecated.Initialises theContentPropertiesof this AbstractPage by performing a deep clone of theDraftobject's properties. -
getConfluenceRevision
- Overrides:
getConfluenceRevisionin classAbstractVersionedEntityObject
-
AddressablePage.generateTitleSlug()