Class ReadOnlySpaceDescription
- All Implemented Interfaces:
Searchable
,Content
,Addressable
,ContentTypeAware
,Versioned
,RelatableEntity
,EditableLabelable
,Labelable
,Spaced
,Serializable
,Cloneable
,Comparable<ContentEntityObject>
- See Also:
-
Field Summary
Fields inherited from class com.atlassian.confluence.spaces.SpaceDescription
CONTENT_TYPE_PERSONAL_SPACEDESC, CONTENT_TYPE_SPACEDESC
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
addAttachment
(Attachment attachment) void
addComment
(Comment comment) void
addCustomContent
(CustomContentEntityObject customContentEntityObject) void
addLabelling
(Labelling content) void
addOutgoingLink
(OutgoingLink link) void
addPermission
(ContentPermission permission) Adds a ContentPermission.void
applyChildVersioningPolicy
(@Nullable Versioned versionToPromote, Consumer<? super Versioned> dao) IfVersioned.getVersionChildPolicy(com.atlassian.confluence.api.model.content.ContentType)
specifies so, moves content from versionToPromote to this Versioned instance or makes no change.clone()
void
Remove all data from the object that does not need to be saved by historical versions.boolean
getAttachmentNamed
(String fileName) Don't use it directly, use AttachmentManager.getAttachments(page) instead.getAttachmentUrlPath
(Attachment attachment) 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).Convenience method that returns the String representation of the content.Gets theBodyContent
object for this ContentEntityObject.getBodyContent
(BodyType expectedBodyType) Gets theBodyContent
object for this ContentEntityObject or throws an UnsupportedOperationException if its body type is not the same as the suppliedexpectedBodyType
.Returns theContentId
for this entity object, if it implementsContentConvertible
.getContentPermission
(String permissionType) Gives back the first content permission of a specific type.Note, this method does not return ContentPermissions inherited from the Content's ancestry.Get the hibernate field for content status, distinguishing only draft/deleted/current status.Get the api layer enum for content status, distinguishing CURRENT/HISTORICAL/DRAFT/TRASHED.Returns the display title.Gets the ContentEntityObject that backs this piece of content.getGlobalLabels
(com.atlassian.user.User user) List the labels on this content that are global labelslong
getId()
int
Get the number of labels that are associated with this object.Retrieve the labels that are associated with this object.getLabelsForDisplay
(com.atlassian.user.User user) List the labels on this content that are visible to a particular user, and should be shown in a list of labels.Get the latest, current version of this versioned object.long
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.An outgoing link is a link on this page to another confluence page.
It could also link to a website URL
These links are contained in the page content
They are refreshed each time the page is updated (LinkManager.updateOutgoingLinks())Get all the permissions that apply to this content.getPersonalLabels
(com.atlassian.user.User user) List the labels on this content that are personal labels for a particular userWhen 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.getSpace()
getTeamLabels
(com.atlassian.user.User user) List the labels on this content that are team labels for a particular usergetTitle()
Get trash date if this CEO has been added to the trash since Confluence 7.14.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.int
Return the version number of this version of the object.getVersionChildPolicy
(ContentType contentType) Returns the rightVersionChildOwnerPolicy
depending on the passed contentType.getVisibleLabels
(com.atlassian.user.User user) List the labels on this content that are visible to a particular userboolean
int
hashCode()
boolean
hasPermissions
(String type) boolean
Does this content have "current" status? (non-trashed and non-draft)boolean
boolean
isDraft()
boolean
isFavourite
(ConfluenceUser user) Is this object marked as somebody's favourite?boolean
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 uselessboolean
boolean
boolean
isNew()
Is this the first version of this object?boolean
This object is persistent if the id is not 0.boolean
boolean
boolean
void
removeAttachment
(Attachment attachment) void
removeComment
(Comment comment) void
This method removes the given ContentPermissionSet from this CEO and disconnects the set from its owner.void
removeCustomContent
(CustomContentEntityObject customContentEntityObject) void
removeLabelling
(Labelling labelling) void
void
restore()
restores content from the trashvoid
setAttachments
(List<Attachment> attachments) void
setBodyAsString
(String content) Convenience method that sets the content of this ContentEntityObject.void
setBodyContent
(BodyContent bodyContent) Sets theBodyContent
object for this ContentEntityObject.void
setBodyContents
(List<BodyContent> bodyContents) void
setClock
(com.atlassian.core.util.Clock clock) void
void
setComments
(List<Comment> comments) void
Initialises theContentProperties
of this ContentEntityObject by performing a deep clone of theContentEntityObject
object's properties.void
setContentStatus
(String contentStatus) Set the hibernate field for content status, distinguishing only draft/deleted/current status.void
setCreationDate
(Date creationDate) void
setCreator
(ConfluenceUser creator) void
setCreatorName
(String creatorName) Set the username of the creatorvoid
setId
(long id) void
setLastModificationDate
(Date lastModificationDate) void
setLastModifier
(ConfluenceUser lastModifier) void
setLastModifierName
(String lastModifierName) void
setOriginalVersion
(Versioned originalVersion) Set the current version of this object.void
setOutgoingLinks
(List<OutgoingLink> outgoingLinks) void
setShareId
(String shareId) void
void
setSynchronyRevision
(String synchronyRevision) void
setSynchronyRevisionSource
(String synchronyRevisionSource) void
void
setVersion
(int version) Set the version number of this version of the object.void
setVersionComment
(String versionComment) boolean
sharedAccessAllowed
(com.atlassian.user.User user) Checks if this draft can be accessed by users other than the creator (shared access)boolean
sharedAccessAllowed
(String shareId) Checks if this draft can be accessed by users other than the creator (shared access)toString()
void
trash()
places content in trash canboolean
wasCreatedBy
(com.atlassian.user.User user) Methods inherited from class com.atlassian.confluence.spaces.SpaceDescription
getPermissionLastModifiedDate, setPermissionLastModifiedDate
Methods inherited from class com.atlassian.confluence.core.ContentEntityObject
compareTo, ensureAttachmentBelongsToContent, getAttachmentManager, getContainerContent, replaceContentProperties, restoreDependents, setContainerContent, setOriginalVersionId, toPageContext, trash, trash
Methods inherited from class com.atlassian.confluence.core.AbstractLabelableEntityObject
setLabellings
Methods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
getConfluenceRevision
Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getRealClass
-
Constructor Details
-
ReadOnlySpaceDescription
-
-
Method Details
-
getLabels
Description copied from interface:Labelable
Retrieve the labels that are associated with this object.- Specified by:
getLabels
in interfaceLabelable
- Overrides:
getLabels
in classAbstractLabelableEntityObject
- Returns:
- a list of label instances.
-
getLabelCount
public int getLabelCount()Description copied from interface:Labelable
Get the number of labels that are associated with this object.- Specified by:
getLabelCount
in interfaceLabelable
- Overrides:
getLabelCount
in classAbstractLabelableEntityObject
- Returns:
- the number of labels associated with this object.
-
isFavourite
Description copied from interface:Labelable
Is this object marked as somebody's favourite?- Specified by:
isFavourite
in interfaceLabelable
- Overrides:
isFavourite
in classAbstractLabelableEntityObject
- Parameters:
user
- the user who is being checked against. If user is null this method must always return false (anonymous users can not mark anything as a favourite, obviously)- Returns:
- true if the labelable object is a 'favourite' of a given user, false otherwise
-
getVisibleLabels
Description copied from class:AbstractLabelableEntityObject
List the labels on this content that are visible to a particular user- Overrides:
getVisibleLabels
in classAbstractLabelableEntityObject
- Parameters:
user
- the user- Returns:
- the labels on this content visible to that user
-
getPersonalLabels
Description copied from class:AbstractLabelableEntityObject
List the labels on this content that are personal labels for a particular user- Overrides:
getPersonalLabels
in classAbstractLabelableEntityObject
- Parameters:
user
- the user- Returns:
- the personal labels on this content visible to the user
-
getGlobalLabels
Description copied from class:AbstractLabelableEntityObject
List the labels on this content that are global labels- Overrides:
getGlobalLabels
in classAbstractLabelableEntityObject
- Parameters:
user
- the user- Returns:
- the global labels on this content visible to the user
-
getTeamLabels
Description copied from class:AbstractLabelableEntityObject
List the labels on this content that are team labels for a particular user- Overrides:
getTeamLabels
in classAbstractLabelableEntityObject
- Parameters:
user
- the user- Returns:
- the team labels on this content visible to the user
-
getLabelsForDisplay
Description copied from class:AbstractLabelableEntityObject
List the labels on this content that are visible to a particular user, and should be shown in a list of labels. This is like {code}getVisibleLabels{code} except that it also filters out special labels like favourites- Overrides:
getLabelsForDisplay
in classAbstractLabelableEntityObject
- Parameters:
user
- the user- Returns:
- the labels on this content visible to that user
-
getLabellings
- Specified by:
getLabellings
in interfaceEditableLabelable
- Overrides:
getLabellings
in classAbstractLabelableEntityObject
-
addLabelling
- Specified by:
addLabelling
in interfaceEditableLabelable
- Overrides:
addLabelling
in classAbstractLabelableEntityObject
-
removeLabelling
- Specified by:
removeLabelling
in interfaceEditableLabelable
- Overrides:
removeLabelling
in classAbstractLabelableEntityObject
-
getVersion
public int getVersion()Description copied from interface:Versioned
Return the version number of this version of the object. Version numbers are integers in ascending chronological order from 1 (the first version). Clients must not assume if two versions x and y exist, that any integer versions between x and y also exist.- Specified by:
getVersion
in interfaceVersioned
- Overrides:
getVersion
in classAbstractVersionedEntityObject
- Returns:
- the version number of this version of the object
-
setVersion
public void setVersion(int version) Description copied from interface:Versioned
Set the version number of this version of the object. Only call this method if you are creating a new version.- Specified by:
setVersion
in interfaceVersioned
- Overrides:
setVersion
in classAbstractVersionedEntityObject
- Parameters:
version
- the new version number for this version of the object.
-
isNew
public boolean isNew()Description copied from interface:Versioned
Is this the first version of this object?- Specified by:
isNew
in interfaceVersioned
- Overrides:
isNew
in classAbstractVersionedEntityObject
- Returns:
- true if this is the first version of this versioned object, false if it is a later version.
-
isLatestVersion
public boolean isLatestVersion()- Specified by:
isLatestVersion
in interfaceVersioned
- Overrides:
isLatestVersion
in classAbstractVersionedEntityObject
- Returns:
- true if this is the latest (current) version of the object, false if it is an historical version.
-
getVersionChildPolicy
Description copied from interface:Versioned
Returns the rightVersionChildOwnerPolicy
depending on the passed contentType. By default,VersionChildOwnerPolicy.currentVersion
is returnedRight now, this is only enforced for children with content type Attachment or Comment
- Specified by:
getVersionChildPolicy
in interfaceVersioned
- Overrides:
getVersionChildPolicy
in classAbstractVersionedEntityObject
-
getCreatorName
- Overrides:
getCreatorName
in classConfluenceEntityObject
- Returns:
- username of the creator, or null if created anonymously
-
getCreator
- Overrides:
getCreator
in classConfluenceEntityObject
-
setCreatorName
Description copied from class:ConfluenceEntityObject
Set the username of the creator- Overrides:
setCreatorName
in classConfluenceEntityObject
-
getLastModifierName
- Overrides:
getLastModifierName
in classConfluenceEntityObject
- Returns:
- username of the last modifier, or null if none.
-
getLastModifier
- Overrides:
getLastModifier
in classConfluenceEntityObject
-
setLastModifierName
- Overrides:
setLastModifierName
in classConfluenceEntityObject
-
setCreator
- Overrides:
setCreator
in classConfluenceEntityObject
-
setLastModifier
- Overrides:
setLastModifier
in classConfluenceEntityObject
-
isPersistent
public boolean isPersistent()Description copied from class:ConfluenceEntityObject
This object is persistent if the id is not 0.- Specified by:
isPersistent
in interfaceEditableLabelable
- Overrides:
isPersistent
in classConfluenceEntityObject
- Returns:
- true if this instance is a persisted label.
-
getTypeEnum
- Overrides:
getTypeEnum
in classContentEntityObject
-
getIdAsString
- Overrides:
getIdAsString
in classContentEntityObject
-
getTitle
- Specified by:
getTitle
in interfaceEditableLabelable
- Overrides:
getTitle
in classContentEntityObject
-
setTitle
- Overrides:
setTitle
in classContentEntityObject
-
getLowerTitle
- Overrides:
getLowerTitle
in classContentEntityObject
-
getBodyContent
Description copied from class:ContentEntityObject
Gets theBodyContent
object for this ContentEntityObject. Although it appears that there may be a number of BodyContent objects attached to a ContentEntityObject, only one is ever used. If there are none currently attached, a new BodyContent object is created and returned. Any values set on the returned BodyContent will not be saved unless a call is made toContentEntityObject.setBodyContent(com.atlassian.confluence.core.BodyContent)
. Null is never returned.This method should not normally be called directly unless, you need to be able to handle different body types. Use
ContentEntityObject.getBodyAsString()
as you should normally be expecting only one type.- Overrides:
getBodyContent
in classContentEntityObject
- Returns:
- the BodyContent.
- See Also:
-
getBodyContent
Description copied from class:ContentEntityObject
Gets theBodyContent
object for this ContentEntityObject or throws an UnsupportedOperationException if its body type is not the same as the suppliedexpectedBodyType
.This method should not normally be called directly unless, you need to be able to handle different body types. Use
ContentEntityObject.getBodyAsString()
andContentEntityObject.getBodyAsString()
as you should normally be expecting only one type.- Overrides:
getBodyContent
in classContentEntityObject
- Parameters:
expectedBodyType
- that can be handled by the caller.- Returns:
- the BodyContent.
- See Also:
-
setBodyContent
Description copied from class:ContentEntityObject
Sets theBodyContent
object for this ContentEntityObject.This method should not normally be called directly unless, you need to be able to handle different body types. Use
ContentEntityObject.setBodyAsString(java.lang.String)
as you should normally be expecting only one type.- Overrides:
setBodyContent
in classContentEntityObject
- Parameters:
bodyContent
- to be set. If the supplied bodyContent or its body arenull
, the list of body contents are cleared.
-
getBodyAsString
Description copied from class:ContentEntityObject
Convenience method that returns the String representation of the content.- Overrides:
getBodyAsString
in classContentEntityObject
- Returns:
- the content.
-
setBodyAsString
Description copied from class:ContentEntityObject
Convenience method that sets the content of this ContentEntityObject.- Overrides:
setBodyAsString
in classContentEntityObject
- Parameters:
content
- the String representation of the content.
-
getBodyContents
- Overrides:
getBodyContents
in classContentEntityObject
-
setBodyContents
- Overrides:
setBodyContents
in classContentEntityObject
-
getOutgoingLinks
Description copied from class:ContentEntityObject
An outgoing link is a link on this page to another confluence page.
It could also link to a website URL
These links are contained in the page content
They are refreshed each time the page is updated (LinkManager.updateOutgoingLinks())- Overrides:
getOutgoingLinks
in classContentEntityObject
- Returns:
- List of OutgoingLinks
-
setOutgoingLinks
- Overrides:
setOutgoingLinks
in classContentEntityObject
-
addOutgoingLink
- Overrides:
addOutgoingLink
in classContentEntityObject
-
removeOutgoingLink
- Overrides:
removeOutgoingLink
in classContentEntityObject
-
setOriginalVersion
Description copied from interface:Versioned
Set the current version of this object. After this method is called, this object will become an historical version of the object passed in.- Specified by:
setOriginalVersion
in interfaceVersioned
- Overrides:
setOriginalVersion
in classContentEntityObject
- Parameters:
originalVersion
- the current version of this object.
-
applyChildVersioningPolicy
public void applyChildVersioningPolicy(@Nullable Versioned versionToPromote, Consumer<? super Versioned> dao) Description copied from interface:Versioned
IfVersioned.getVersionChildPolicy(com.atlassian.confluence.api.model.content.ContentType)
specifies so, moves content from versionToPromote to this Versioned instance or makes no change.- Specified by:
applyChildVersioningPolicy
in interfaceVersioned
- Overrides:
applyChildVersioningPolicy
in classContentEntityObject
- Parameters:
versionToPromote
- the new version of the current instance that we're getting the children fromdao
- onRemove used to delete dangling contained content
-
equals
- Overrides:
equals
in classContentEntityObject
-
toString
- Overrides:
toString
in classContentEntityObject
-
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. -
getPermissions
Description copied from class:ContentEntityObject
Get all the permissions that apply to this content. Please do not modify the contents of this list!
- Overrides:
getPermissions
in classContentEntityObject
- Returns:
- a list of all the permissions that apply to this content.
-
getContentPermission
Description copied from class:ContentEntityObject
Gives back the first content permission of a specific type. Returns only the permission if it is set on this object and not inherited. Returns null if no permission can't be found.Synchronized, as otherwise it was creating timing issues during the multi-threaded re-indexing.
- Overrides:
getContentPermission
in classContentEntityObject
- Returns:
- ContentPermission
-
getContentStatusObject
Description copied from class:ContentEntityObject
Get the api layer enum for content status, distinguishing CURRENT/HISTORICAL/DRAFT/TRASHED.Important: this has different semantics from the hibernate field
ContentEntityObject.getContentStatus()
, because it takes into account historical status, and uses different strings for some values.- Overrides:
getContentStatusObject
in classContentEntityObject
- Returns:
- the API ContentStatus for this content, distinguishing CURRENT/HISTORICAL/DRAFT/TRASHED
- See Also:
-
getContentStatus
Description copied from class:ContentEntityObject
Get the hibernate field for content status, distinguishing only draft/deleted/current status.Important: this is not the same as the string value of the api
ContentEntityObject.getContentStatusObject()
, because that one takes into account historical status, and uses different strings for some values.This method does NOT distinguish current and historical versions. Both will return "current". See
AbstractVersionedEntityObject.isLatestVersion()
to distinguish them.- Overrides:
getContentStatus
in classContentEntityObject
- Returns:
- the hibernate field value, distinguishing only
ContentEntityObject.CURRENT
,ContentEntityObject.DRAFT
,ContentEntityObject.DELETED
. - See Also:
-
setContentStatus
Description copied from class:ContentEntityObject
Set the hibernate field for content status, distinguishing only draft/deleted/current status.Important: this is not the same as the string value of the api
ContentEntityObject.getContentStatusObject()
, because that one takes into account historical status, and uses different strings for some values.This method does NOT distinguish current and historical versions. Both use "current". See
AbstractVersionedEntityObject.isLatestVersion()
to distinguish them.- Overrides:
setContentStatus
in classContentEntityObject
- Parameters:
contentStatus
- the hibernate field value,ContentEntityObject.CURRENT
,ContentEntityObject.DRAFT
,ContentEntityObject.DELETED
.- See Also:
-
isCurrent
public boolean isCurrent()Description copied from class:ContentEntityObject
Does this content have "current" status? (non-trashed and non-draft)This method does NOT distinguish current and historical versions. Both will return true. See
AbstractVersionedEntityObject.isLatestVersion()
to distinguish them.- Overrides:
isCurrent
in classContentEntityObject
- Returns:
- true if the content is live, i.e. not trashed and not a draft
- See Also:
-
isDeleted
public boolean isDeleted()- Overrides:
isDeleted
in classContentEntityObject
-
isDraft
public boolean isDraft()- Overrides:
isDraft
in classContentEntityObject
-
getSynchronyRevision
- Overrides:
getSynchronyRevision
in classContentEntityObject
- See Also:
-
setSynchronyRevision
- Overrides:
setSynchronyRevision
in classContentEntityObject
- See Also:
-
getSynchronyRevisionSource
- Overrides:
getSynchronyRevisionSource
in classContentEntityObject
- See Also:
-
getTrashDate
Description copied from class:ContentEntityObject
Get trash date if this CEO has been added to the trash since Confluence 7.14. For generic cases, useTrashManagerInternal#findTrashDate
- Overrides:
getTrashDate
in classContentEntityObject
- Returns:
- when this content entity was added to the trash or
Optional.empty()
if it was trashed before 7.14
-
setSynchronyRevisionSource
- Overrides:
setSynchronyRevisionSource
in classContentEntityObject
- See Also:
-
getCollaborativeEditingUuid
- Overrides:
getCollaborativeEditingUuid
in classContentEntityObject
- See Also:
-
setCollaborativeEditingUuid
- Overrides:
setCollaborativeEditingUuid
in classContentEntityObject
- See Also:
-
isUnpublished
public boolean isUnpublished()- Overrides:
isUnpublished
in classContentEntityObject
-
wasCreatedBy
public boolean wasCreatedBy(com.atlassian.user.User user) - Overrides:
wasCreatedBy
in classContentEntityObject
-
trash
public void trash()Description copied from class:ContentEntityObject
places content in trash can- Overrides:
trash
in classContentEntityObject
-
restore
public void restore()Description copied from class:ContentEntityObject
restores content from the trash- Overrides:
restore
in classContentEntityObject
-
getAttachments
Description copied from class:ContentEntityObject
Don't use it directly, use AttachmentManager.getAttachments(page) instead.
This also includes trashed items.
- Overrides:
getAttachments
in classContentEntityObject
-
getLatestVersionsOfAttachments
- Overrides:
getLatestVersionsOfAttachments
in classContentEntityObject
-
setAttachments
- Overrides:
setAttachments
in classContentEntityObject
-
addAttachment
- Overrides:
addAttachment
in classContentEntityObject
-
removeAttachment
- Overrides:
removeAttachment
in classContentEntityObject
-
getBodyAsStringWithoutMarkup
- Overrides:
getBodyAsStringWithoutMarkup
in classContentEntityObject
-
getExcerpt
- Overrides:
getExcerpt
in classContentEntityObject
-
getAttachmentsUrlPath
- Overrides:
getAttachmentsUrlPath
in classContentEntityObject
-
getAttachmentNamed
- Overrides:
getAttachmentNamed
in classContentEntityObject
-
getVersionComment
- Overrides:
getVersionComment
in classContentEntityObject
-
setVersionComment
- Overrides:
setVersionComment
in classContentEntityObject
-
isVersionCommentAvailable
public boolean isVersionCommentAvailable()- Overrides:
isVersionCommentAvailable
in classContentEntityObject
-
clone
- Overrides:
clone
in classContentEntityObject
-
getRenderedVersionComment
- Overrides:
getRenderedVersionComment
in classContentEntityObject
-
getContentPermissionSet
Description copied from class:ContentEntityObject
Note, this method does not return ContentPermissions inherited from the Content's ancestry.- Overrides:
getContentPermissionSet
in classContentEntityObject
- Returns:
- a set containing
ContentPermission
s of this type, or null if there are no content permissions explicitly set on this ContentEntityObject for the type.
-
hasPermissions
- Overrides:
hasPermissions
in classContentEntityObject
- Returns:
- true if this content entity object contains any
ContentPermission
s of the type specified
-
hasContentPermissions
public boolean hasContentPermissions()- Overrides:
hasContentPermissions
in classContentEntityObject
-
addPermission
Description copied from class:ContentEntityObject
Adds a ContentPermission. Do not add them manually viaContentPermissionSet.addContentPermission(ContentPermission)
. If possible useContentPermissionManager.addContentPermission(com.atlassian.confluence.security.ContentPermission, ContentEntityObject)
instead. Also note that as of Confluence 2.4 although methods have been added to facilitate having multiple ContentPermissions per page, Confluence does not yet properly support them (eg users permitted by them will not see the data in their searches)- Overrides:
addPermission
in classContentEntityObject
-
removeContentPermissionSet
Description copied from class:ContentEntityObject
This method removes the given ContentPermissionSet from this CEO and disconnects the set from its owner. This method should only be called by the DefaultContentPermissionManager. Note that as of Confluence 2.4 although methods have been added to facilitate having multiple ContentPermissions per page, Confluence does not yet properly support them (eg users permitted by them will not see the data in their searches) -
getComments
- Overrides:
getComments
in classContentEntityObject
-
setComments
- Overrides:
setComments
in classContentEntityObject
-
addComment
- Overrides:
addComment
in classContentEntityObject
-
removeComment
- Overrides:
removeComment
in classContentEntityObject
-
getCustomContent
- Overrides:
getCustomContent
in classContentEntityObject
- Returns:
- all custom content that is a child of this CEO.
-
addCustomContent
- Overrides:
addCustomContent
in classContentEntityObject
-
removeCustomContent
- Overrides:
removeCustomContent
in classContentEntityObject
-
getEntity
Description copied from interface:Content
Gets the ContentEntityObject that backs this piece of content.- Specified by:
getEntity
in interfaceContent
- Overrides:
getEntity
in classContentEntityObject
- Returns:
- the persistent object behind this content
-
getContentId
Description copied from class:ContentEntityObject
Returns theContentId
for this entity object, if it implementsContentConvertible
.Subclasses implementing ContentConvertible must override this method.
- Overrides:
getContentId
in classContentEntityObject
- Returns:
- the ContentId representation of this object's id
-
getSelector
- Overrides:
getSelector
in classContentEntityObject
- Returns:
- the ContentSelector for this entity, which will always include the id of the latest version, and the version number for this version of the entity.
-
getProperties
- Overrides:
getProperties
in classContentEntityObject
- Returns:
- the content properties associated with this entity
-
setContentPropertiesFrom
Description copied from class:ContentEntityObject
Initialises theContentProperties
of this ContentEntityObject by performing a deep clone of theContentEntityObject
object's properties.- Overrides:
setContentPropertiesFrom
in classContentEntityObject
-
getOriginalVersionId
- Overrides:
getOriginalVersionId
in classContentEntityObject
-
getLatestVersionId
public long getLatestVersionId()- Overrides:
getLatestVersionId
in classContentEntityObject
-
getSpace
- Specified by:
getSpace
in interfaceSpaced
- Overrides:
getSpace
in classSpaceContentEntityObject
-
setSpace
- Overrides:
setSpace
in classSpaceContentEntityObject
-
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
-
hashCode
public int hashCode()- Overrides:
hashCode
in classSpaceContentEntityObject
-
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 classSpaceContentEntityObject
-
isIndexable
public boolean isIndexable()Description copied from class:SpaceContentEntityObject
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- Specified by:
isIndexable
in interfaceSearchable
- Overrides:
isIndexable
in classSpaceContentEntityObject
-
isInSpace
- Overrides:
isInSpace
in classSpaceContentEntityObject
-
getDisplayTitle
Description copied from class:ContentEntityObject
Returns the display title. Some entities don't have titles for identification. For example, personal information objects use the user's fullname. Override this method to provide a custom title.- Specified by:
getDisplayTitle
in interfaceAddressable
- Overrides:
getDisplayTitle
in classSpaceDescription
- Returns:
- the display title
-
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 classSpaceDescription
- Returns:
- the current version of this object.
- See Also:
-
getUrlPath
- Specified by:
getUrlPath
in interfaceAddressable
- Overrides:
getUrlPath
in classSpaceDescription
- Returns:
- a link to the home page of the associated space
-
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 interfaceContentTypeAware
- Overrides:
getType
in classSpaceDescription
- Returns:
- the content type
-
getSpaceKey
- Overrides:
getSpaceKey
in classSpaceDescription
-
isPersonalSpace
public boolean isPersonalSpace()- Overrides:
isPersonalSpace
in classSpaceDescription
-
getDefaultBodyType
- Overrides:
getDefaultBodyType
in classSpaceDescription
-
getAttachmentUrlPath
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 classSpaceDescription
- 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.
-
getId
public long getId()- Specified by:
getId
in interfaceAddressable
- Specified by:
getId
in interfaceEditableLabelable
- Specified by:
getId
in interfaceSearchable
- Overrides:
getId
in classcom.atlassian.core.bean.EntityObject
-
setId
public void setId(long id) - Overrides:
setId
in classcom.atlassian.core.bean.EntityObject
-
getCreationDate
- Overrides:
getCreationDate
in classAnnotatedEntityObject
-
setCreationDate
- Overrides:
setCreationDate
in classcom.atlassian.core.bean.EntityObject
-
getLastModificationDate
- Overrides:
getLastModificationDate
in classAnnotatedEntityObject
-
setLastModificationDate
- Overrides:
setLastModificationDate
in classcom.atlassian.core.bean.EntityObject
-
setClock
public void setClock(com.atlassian.core.util.Clock clock) - Overrides:
setClock
in classcom.atlassian.core.bean.EntityObject
-
getCurrentDate
- Overrides:
getCurrentDate
in classcom.atlassian.core.bean.EntityObject
-