@NotThreadSafe public class CustomContentEntityObject extends SpaceContentEntityObject implements Contained<ContentEntityObject>, ContentConvertible
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_TYPE |
COLLABORATIVE_EDITING_UUID, CONFLUENCE_RECOVERY, CONFLUENCE_RECOVERY_WITH_EXTERNAL_CHANGE, CONTENT_RESTORED_SYNC_REV_SOURCE, CREATED, CURRENT, DELETED, 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
INITIAL_VERSION
Modifier | Constructor and Description |
---|---|
protected |
CustomContentEntityObject()
Protected.
|
Modifier and Type | Method and Description |
---|---|
void |
convertToHistoricalVersion()
Remove all data from the object that does not need to be saved by historical versions.
|
List<CustomContentEntityObject> |
getAncestors()
Return all of the ancestors of this content, with this content's parent as the last
element of the list.
|
String |
getAttachmentsUrlPath() |
String |
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).
|
String |
getBodyAsString()
Convenience method that returns the String representation of the content.
|
@Nullable ContentEntityObject |
getContainer() |
ContentId |
getContentId()
Returns the
ContentId for this entity object, if it implements ContentConvertible . |
ContentType |
getContentTypeObject() |
BodyType |
getDefaultBodyType() |
String |
getDisplayTitle()
Returns the display title.
|
String |
getExcerpt() |
String |
getNameForComparison()
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.
|
CustomContentEntityObject |
getParent() |
String |
getPluginModuleKey() |
String |
getPluginVersion() |
String |
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.
|
String |
getUrlPath() |
VersionChildOwnerPolicy |
getVersionChildPolicy(ContentType contentType)
Returns the right
VersionChildOwnerPolicy depending on the passed contentType. |
boolean |
isIndexable()
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
|
void |
setAdapter(ContentEntityAdapter adapter) |
void |
setContainer(@Nullable ContentEntityObject container) |
void |
setParent(CustomContentEntityObject parent) |
void |
setPluginModuleKey(String pluginModuleKey) |
void |
setPluginVersion(String pluginVersion) |
boolean |
shouldConvertToContent() |
String |
toString() |
getSpace, getSpaceKey, hashCode, isInSpace, setSpace
addAttachment, addComment, addCustomContent, addOutgoingLink, addPermission, addReferralLink, addTrackbackLink, applyChildVersioningPolicy, applyChildVersioningPolicy, clone, compareTo, ensureAttachmentBelongsToContent, equals, getAttachmentNamed, getAttachments, getBodyAsStringWithoutMarkup, getBodyContent, getBodyContent, getBodyContents, getCollaborativeEditingUuid, getComments, getContainerContent, getContentPermission, getContentPermissionSet, getContentStatus, getContentStatusObject, getEntity, getIdAsString, getLatestVersionId, getLatestVersionsOfAttachments, getLowerTitle, getOriginalVersionId, getOutgoingLinks, getPermissions, getProperties, getReferralLinks, getRenderedVersionComment, getSearchableDependants, getSelector, getShareId, getSynchronyRevision, getSynchronyRevisionSource, getTitle, getTrackbackLinks, getTypeEnum, getVersionComment, hasContentPermissions, hasPermissions, isCurrent, isDeleted, isDraft, isUnpublished, isVersionCommentAvailable, removeAttachment, removeComment, removeContentPermissionSet, removeCustomContent, removeOutgoingLink, removeReferralLink, removeTrackbackLink, replaceContentProperties, restore, restoreDependents, setAttachments, setBodyAsString, setBodyContent, setBodyContents, setCollaborativeEditingUuid, setComments, setContainerContent, setContentPropertiesFrom, setContentStatus, setOriginalVersion, setOriginalVersionId, setOutgoingLinks, setReferralLinks, setShareId, setSynchronyRevision, setSynchronyRevisionSource, setTitle, setTrackbackLinks, setVersionComment, sharedAccessAllowed, sharedAccessAllowed, toPageContext, trash, trashDependents, wasCreatedBy
addLabelling, getGlobalLabels, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getPersonalLabels, getTeamLabels, getVisibleLabels, isFavourite, removeLabelling, setLabellings
getConfluenceRevision, getLatestVersion, getVersion, isLatestVersion, isNew, setVersion
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierName
getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate
finalize, getClass, notify, notifyAll, wait, wait, wait
getSelector
getId
getId, isPersistent
public static final String CONTENT_TYPE
protected CustomContentEntityObject()
public String getType()
ContentEntityObject
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.
getType
in interface ContentTypeAware
getType
in class ContentEntityObject
public String getUrlPath()
getUrlPath
in interface Addressable
getUrlPath
in class ContentEntityObject
public String getDisplayTitle()
ContentEntityObject
getDisplayTitle
in interface Addressable
getDisplayTitle
in class ContentEntityObject
public String getNameForComparison()
ContentEntityObject
getNameForComparison
in class SpaceContentEntityObject
public String getAttachmentUrlPath(Attachment attachment)
ContentEntityObject
Attachment.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.
getAttachmentUrlPath
in class ContentEntityObject
attachment
- one of this content's attachmentspublic String getAttachmentsUrlPath()
getAttachmentsUrlPath
in class ContentEntityObject
public String getExcerpt()
getExcerpt
in class ContentEntityObject
public BodyType getDefaultBodyType()
getDefaultBodyType
in class ContentEntityObject
public String getPluginModuleKey()
public void setPluginModuleKey(String pluginModuleKey)
public String getPluginVersion()
public void setPluginVersion(String pluginVersion)
public CustomContentEntityObject getParent()
public void setParent(CustomContentEntityObject parent)
public @Nullable ContentEntityObject getContainer()
getContainer
in interface Contained<ContentEntityObject>
public void setContainer(@Nullable ContentEntityObject container)
public void setAdapter(ContentEntityAdapter adapter)
public void convertToHistoricalVersion()
Versioned
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.
convertToHistoricalVersion
in interface Versioned
convertToHistoricalVersion
in class SpaceContentEntityObject
public boolean isIndexable()
SpaceContentEntityObject
isIndexable
in interface com.atlassian.bonnie.Searchable
isIndexable
in class SpaceContentEntityObject
public String toString()
toString
in class ContentEntityObject
public List<CustomContentEntityObject> getAncestors()
Page.getAncestors()
Implementation is currently less efficient than the equivalent method on Page as there is no equivalent of the Ancestors table for custom content.
public ContentType getContentTypeObject()
getContentTypeObject
in interface ContentConvertible
public ContentId getContentId()
ContentEntityObject
ContentId
for this entity object, if it implements ContentConvertible
.
Subclasses implementing ContentConvertible must override this method.
getContentId
in interface ContentConvertible
getContentId
in class ContentEntityObject
public boolean shouldConvertToContent()
shouldConvertToContent
in interface ContentConvertible
public VersionChildOwnerPolicy getVersionChildPolicy(ContentType contentType)
Versioned
VersionChildOwnerPolicy
depending on the passed contentType.
By default, VersionChildOwnerPolicy.currentVersion
is returned
Right now, this is only enforced for children with content type Attachment or Comment
getVersionChildPolicy
in interface Versioned
getVersionChildPolicy
in class AbstractVersionedEntityObject
public String getBodyAsString()
ContentEntityObject
getBodyAsString
in class ContentEntityObject
Copyright © 2003–2019 Atlassian. All rights reserved.