@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_SOURCEINITIAL_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, setSpaceaddAttachment, addComment, addCustomContent, addOutgoingLink, addPermission, addReferralLink, addTrackbackLink, applyChildVersioningPolicy, applyChildVersioningPolicy, clone, compareTo, ensureAttachmentBelongsToContent, equals, getAttachmentManager, 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, wasCreatedByaddLabelling, getGlobalLabels, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getPersonalLabels, getTeamLabels, getVisibleLabels, isFavourite, removeLabelling, setLabellingsgetConfluenceRevision, getLatestVersion, getVersion, isLatestVersion, isNew, setVersiongetCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierNamegetCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDatefinalize, getClass, notify, notifyAll, wait, wait, waitgetSelectorgetIdgetId, isPersistentpublic static final String CONTENT_TYPE
protected CustomContentEntityObject()
public String getType()
ContentEntityObjectThis 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 ContentTypeAwaregetType in class ContentEntityObjectpublic String getUrlPath()
getUrlPath in interface AddressablegetUrlPath in class ContentEntityObjectpublic String getDisplayTitle()
ContentEntityObjectgetDisplayTitle in interface AddressablegetDisplayTitle in class ContentEntityObjectpublic String getNameForComparison()
ContentEntityObjectgetNameForComparison in class SpaceContentEntityObjectpublic String getAttachmentUrlPath(Attachment attachment)
ContentEntityObjectAttachment.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 ContentEntityObjectattachment - one of this content's attachmentspublic String getAttachmentsUrlPath()
getAttachmentsUrlPath in class ContentEntityObjectpublic String getExcerpt()
getExcerpt in class ContentEntityObjectpublic BodyType getDefaultBodyType()
getDefaultBodyType in class ContentEntityObjectpublic 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 VersionedconvertToHistoricalVersion in class SpaceContentEntityObjectpublic boolean isIndexable()
SpaceContentEntityObjectisIndexable in interface com.atlassian.bonnie.SearchableisIndexable in class SpaceContentEntityObjectpublic String toString()
toString in class ContentEntityObjectpublic 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 ContentConvertiblepublic ContentId getContentId()
ContentEntityObjectContentId for this entity object, if it implements ContentConvertible.
Subclasses implementing ContentConvertible must override this method.
getContentId in interface ContentConvertiblegetContentId in class ContentEntityObjectpublic boolean shouldConvertToContent()
shouldConvertToContent in interface ContentConvertiblepublic VersionChildOwnerPolicy getVersionChildPolicy(ContentType contentType)
VersionedVersionChildOwnerPolicy 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 VersionedgetVersionChildPolicy in class AbstractVersionedEntityObjectpublic String getBodyAsString()
ContentEntityObjectgetBodyAsString in class ContentEntityObjectCopyright © 2003–2020 Atlassian. All rights reserved.