Class CustomContentEntityObject
- All Implemented Interfaces:
Searchable
,Content
,Addressable
,ContentTypeAware
,Versioned
,RelatableEntity
,EditableLabelable
,Labelable
,Contained<ContentEntityObject>
,ContentConvertible
,Spaced
,Serializable
,Cloneable
,Comparable<ContentEntityObject>
- 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_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.Return all of the ancestors of this content, with this content's parent as the last element of the list.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.@Nullable ContentEntityObject
Returns theContentId
for this entity object, if it implementsContentConvertible
.Returns the display title.Deprecated, for removal: This API element is subject to removal in a future version.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.getVersionChildPolicy
(ContentType contentType) Returns the rightVersionChildOwnerPolicy
depending on the passed contentType.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 uselessvoid
setAdapter
(ContentEntityAdapter adapter) void
setContainer
(@Nullable ContentEntityObject container) void
setParent
(CustomContentEntityObject parent) void
setPluginModuleKey
(String pluginModuleKey) void
setPluginVersion
(String pluginVersion) boolean
toString()
Methods inherited from class com.atlassian.confluence.core.SpaceContentEntityObject
getSpace, getSpaceKey, hashCode, isInSpace, setSpace
Methods inherited from class com.atlassian.confluence.core.ContentEntityObject
addAttachment, addComment, addCustomContent, addOutgoingLink, addPermission, applyChildVersioningPolicy, clone, compareTo, ensureAttachmentBelongsToContent, equals, getAttachmentManager, getAttachmentNamed, getAttachments, getBodyAsStringWithoutMarkup, getBodyContent, getBodyContent, getBodyContents, getCollaborativeEditingUuid, getComments, getContainerContent, getContentPermission, getContentPermissionSet, getContentStatus, getContentStatusObject, getCustomContent, getEntity, 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, setTitle, setVersionComment, sharedAccessAllowed, sharedAccessAllowed, toPageContext, 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
getConfluenceRevision, getLatestVersion, getVersion, 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.pages.ContentConvertible
getSelector
Methods inherited from interface com.atlassian.confluence.labels.EditableLabelable
getId, isPersistent
Methods inherited from interface com.atlassian.bonnie.Searchable
getId, getSearchableDependants
-
Field Details
-
CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
CustomContentEntityObject
public CustomContentEntityObject()Protected. If you want a new CustomContentEntityObject, get it from the CustomContentManager
-
-
Method Details
-
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
- Specified by:
getType
in classContentEntityObject
- Returns:
- the content type
-
getUrlPath
- Specified by:
getUrlPath
in interfaceAddressable
- Specified by:
getUrlPath
in classContentEntityObject
-
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 classContentEntityObject
- Returns:
- the display title
-
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
-
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 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.
-
getAttachmentsUrlPath
- Overrides:
getAttachmentsUrlPath
in classContentEntityObject
-
getExcerpt
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
getExcerpt
in classContentEntityObject
-
getDefaultBodyType
- Overrides:
getDefaultBodyType
in classContentEntityObject
-
getPluginModuleKey
-
setPluginModuleKey
-
getPluginVersion
-
setPluginVersion
-
getParent
-
setParent
-
getContainer
- Specified by:
getContainer
in interfaceContained<ContentEntityObject>
- Returns:
- the owner of this content object. Can be null.
-
setContainer
-
setAdapter
-
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
-
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
-
toString
- Overrides:
toString
in classContentEntityObject
-
getAncestors
Return all of the ancestors of this content, with this content's parent as the last element of the list. This ordering is to remain consistent withPage.getAncestors()
Implementation is currently less efficient than the equivalent method on Page as there is no equivalent of the Ancestors table for custom content.
- Returns:
- all of the ancestors of this content
-
getContentTypeObject
- Specified by:
getContentTypeObject
in interfaceContentConvertible
- Returns:
- the api ContentType that this ContentConvertible converts to
-
getContentId
Description copied from class:ContentEntityObject
Returns theContentId
for this entity object, if it implementsContentConvertible
.Subclasses implementing ContentConvertible must override this method.
- Specified by:
getContentId
in interfaceContentConvertible
- Overrides:
getContentId
in classContentEntityObject
- Returns:
- the ContentId representation of this object's id
-
shouldConvertToContent
public boolean shouldConvertToContent()- Specified by:
shouldConvertToContent
in interfaceContentConvertible
- Returns:
- true if the implementer wants to be part of the core API (default value), false otherwise
-
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
-
getBodyAsString
Description copied from class:ContentEntityObject
Convenience method that returns the String representation of the content.- Overrides:
getBodyAsString
in classContentEntityObject
- Returns:
- the content.
-
ContentEntityExcerpter.createExcerpt(CustomContentEntityObject)