java.lang.Object | |||||
↳ | com.atlassian.core.bean.EntityObject | ||||
↳ | com.atlassian.confluence.core.ConfluenceEntityObject | ||||
↳ | com.atlassian.confluence.core.AbstractVersionedEntityObject | ||||
↳ | com.atlassian.confluence.core.AbstractLabelableEntityObject | ||||
↳ | com.atlassian.confluence.core.ContentEntityObject |
Known Direct Subclasses |
Known Indirect Subclasses |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | CREATED | ||||||||||
String | CURRENT | ||||||||||
String | DELETED | ||||||||||
String | MODIFIED |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.atlassian.confluence.core.AbstractVersionedEntityObject
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a ContentPermission.
| |||||||||||
Content entities are naturally ordered alphabetically by "comparison name", which
depends on the entity (it's the title for pages, the parent page title for
comments, etc.).
| |||||||||||
Remove all data from the object that does not need to be saved by historical versions.
| |||||||||||
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).
| |||||||||||
Don't use it directly, use AttachmentManager.getAttachments(page) instead
| |||||||||||
Convenience method that returns the String representation of the content.
| |||||||||||
Gets the
BodyContent object for this ContentEntityObject. | |||||||||||
Gets the
BodyContent object for this ContentEntityObject or throws an UnsupportedOperationException
if its body type is not the same as the supplied expectedBodyType . | |||||||||||
This method is deprecated.
use getContentPermissionSet
| |||||||||||
Note, this method does not return ContentPermissions inherited from the Content's ancestry.
| |||||||||||
Returns the display title.
| |||||||||||
Gets the ContentEntityObject that backs this piece of content.
| |||||||||||
Don't use it directly, use AttachmentManager.getLatestVersionsOfAttachments(page) instead
| |||||||||||
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.
| |||||||||||
This method is deprecated.
use
getContentPermissionSet(String)
| |||||||||||
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 method is deprecated.
since 4.0
| |||||||||||
Content entity objects that are historical versions should not be indexed.
| |||||||||||
This method is deprecated.
since 4.0. Use
isPageRecentlyUpdatedForUser(com.atlassian.confluence.pages.Page, com.atlassian.user.User) instead as this was only used for pages anyway.
| |||||||||||
This method removes the given ContentPermissionSet from this CEO and disconnects the set from
its owner.
| |||||||||||
Convenience method that sets the content of this ContentEntityObject.
| |||||||||||
Sets the
BodyContent object for this ContentEntityObject. | |||||||||||
This method is deprecated.
replace calls with calls to
setBodyAsString(String) .
| |||||||||||
This method is deprecated.
since 4.0
| |||||||||||
When the content is rendered, what context is it being rendered in?
| |||||||||||
places content in trash can
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.atlassian.confluence.core.AbstractLabelableEntityObject
| |||||||||||
From class
com.atlassian.confluence.core.AbstractVersionedEntityObject
| |||||||||||
From class
com.atlassian.confluence.core.ConfluenceEntityObject
| |||||||||||
From class
com.atlassian.core.bean.EntityObject
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.bonnie.Searchable
| |||||||||||
From interface
com.atlassian.confluence.content.Content
| |||||||||||
From interface
com.atlassian.confluence.core.Addressable
| |||||||||||
From interface
com.atlassian.confluence.core.ContentTypeAware
| |||||||||||
From interface
com.atlassian.confluence.core.Versioned
| |||||||||||
From interface
com.atlassian.confluence.labels.EditableLabelable
| |||||||||||
From interface
com.atlassian.confluence.labels.Labelable
| |||||||||||
From interface
java.lang.Comparable
|
Adds a ContentPermission. Do not add them manually via
addContentPermission(ContentPermission)
. If possible use
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)
Content entities are naturally ordered alphabetically by "comparison name", which depends on the entity (it's the title for pages, the parent page title for comments, etc.).
If the comparison names are identical, we fall back on creation dates. This ensures, for example, that comments are always listed after the pages they are contained in, and in posting order. Note also: comparison does NOT agree with equals(). This makes using content entities within sets a little dangerous, but the chances of two things with the exact same name being created on exactly the same millisecond is probably pretty low.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.
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 call
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.
attachment | one of this content's attachments |
---|
IllegalArgumentException | if the attachment is not attached to this content |
---|
Don't use it directly, use AttachmentManager.getAttachments(page) instead
Convenience method that returns the String representation of the content.
UnsupportedOperationException | if the BodyType of the content is not the normal type (by default
BodyType#XHTML ) used by this ContentEntityObject.
|
---|
Gets the BodyContent
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 to setBodyContent(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 getBodyAsString()
as you should normally be expecting only one type.
Gets the BodyContent
object for this ContentEntityObject or throws an UnsupportedOperationException
if its body type is not the same as the supplied expectedBodyType
.
This method should not normally be called directly unless, you need to be able to handle different body types.
Use getBodyAsString()
and getBodyAsString()
as you should normally be expecting only one type.
expectedBodyType | that can be handled by the caller. |
---|
UnsupportedOperationException | if the BodyType of the content is not the expectedBodyType . |
---|
This method is deprecated.
use getContentPermissionSet
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.Note, this method does not return ContentPermissions inherited from the Content's ancestry.
ContentPermission
s of this type, or null if there are no content permissions
explicitly set on this ContentEntityObject for the type.
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.
Gets the ContentEntityObject that backs this piece of content.
Don't use it directly, use AttachmentManager.getLatestVersionsOfAttachments(page) instead
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())
This method is deprecated.
use getContentPermissionSet(String)
Get all the permissions that apply to this content. Please do not modify the contents of this list!
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.ContentPermission
s of the type specified
Content entity objects that are historical versions should not be indexed.
This method is deprecated.
since 4.0. Use isPageRecentlyUpdatedForUser(com.atlassian.confluence.pages.Page, com.atlassian.user.User)
instead as this was only used for pages anyway.
Returns true if the page has been created or modified since the user last logged in. If the user has no last login time, returns false. For an anonymous user returns false.
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)
Convenience method that sets the content of this ContentEntityObject.
content | the String representation of the content. |
---|
UnsupportedOperationException | if the BodyType of the content is not the normal type (by default
BodyType#XHTML ) used by this ContentEntityObject.
|
---|
Sets the BodyContent
object for this ContentEntityObject.
This method should not normally be called directly unless, you need to be able to handle different body types.
Use setBodyAsString(String)
as you should normally be expecting only one type.
bodyContent | to be set. If the supplied bodyContent or its body are null , the list of body
contents are cleared.
|
---|
This method is deprecated.
replace calls with calls to setBodyAsString(String)
.
This method converts wiki content to xhtml on the fly.
This method is deprecated.
since 4.0
When the content is rendered, what context is it being rendered in?
places content in trash can