|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.core.bean.EntityObject
com.atlassian.confluence.core.ConfluenceEntityObject
com.atlassian.confluence.core.AbstractVersionedEntityObject
com.atlassian.confluence.core.AbstractLabelableEntityObject
com.atlassian.confluence.core.ContentEntityObject
com.atlassian.confluence.core.SpaceContentEntityObject
com.atlassian.confluence.content.CustomContentEntityObject
public class CustomContentEntityObject
Generic ContentEntityObject that plugins can use to extend Confluence's content system.
| Field Summary | |
|---|---|
static String |
CONTENT_TYPE
|
| Fields inherited from class com.atlassian.confluence.core.ContentEntityObject |
|---|
CREATED, CURRENT, DELETED, MODIFIED |
| Fields inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject |
|---|
INITIAL_VERSION |
| Constructor Summary | |
|---|---|
protected |
CustomContentEntityObject()
Protected. |
| Method Summary | |
|---|---|
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). |
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(ContentEntityObject container)
|
void |
setParent(CustomContentEntityObject parent)
|
void |
setPluginModuleKey(String pluginModuleKey)
|
void |
setPluginVersion(String pluginVersion)
|
boolean |
shouldConvertToContent()
|
String |
toString()
|
| Methods inherited from class com.atlassian.confluence.core.SpaceContentEntityObject |
|---|
getSpace, getSpaceKey, hashCode, isInSpace, setSpace |
| Methods inherited from class com.atlassian.confluence.core.AbstractLabelableEntityObject |
|---|
addLabelling, getGlobalLabels, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getLabelUtil, getPersonalLabels, getTeamLabels, getVisibleLabels, isFavourite, isFavourite, removeLabelling, setLabellings |
| Methods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject |
|---|
getLatestVersion, getOriginalVersion, getVersion, isLatestVersion, isNew, setOriginalVersion, 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.core.bean.EntityObject |
|---|
getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.atlassian.bonnie.Searchable |
|---|
getId |
| Methods inherited from interface com.atlassian.confluence.core.Addressable |
|---|
getId |
| Methods inherited from interface com.atlassian.confluence.labels.EditableLabelable |
|---|
getId, isPersistent |
| Field Detail |
|---|
public static final String CONTENT_TYPE
| Constructor Detail |
|---|
protected CustomContentEntityObject()
| Method Detail |
|---|
public String getType()
ContentEntityObject
getType in interface ContentTypeAwaregetType in class ContentEntityObjectpublic String getUrlPath()
getUrlPath in interface AddressablegetUrlPath in class ContentEntityObjectpublic String getDisplayTitle()
ContentEntityObject
getDisplayTitle in interface AddressablegetDisplayTitle in class ContentEntityObjectpublic String getNameForComparison()
ContentEntityObject
getNameForComparison 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 attachments
public 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)
@Nullable public ContentEntityObject getContainer()
getContainer in interface Contained<ContentEntityObject>
public void setContainer(@Nullable
ContentEntityObject container)
public void setAdapter(ContentEntityAdapter adapter)
public void convertToHistoricalVersion()
VersionedWhen 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()
SpaceContentEntityObject
isIndexable 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 AbstractVersionedEntityObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||