@ExperimentalSpi public abstract class CustomContentTypeApiSupport extends BaseContentTypeApiSupport<CustomContentEntityObject>
Constructor and Description |
---|
CustomContentTypeApiSupport(CustomContentApiSupportParams params) |
Modifier and Type | Method and Description |
---|---|
CustomContentEntityObject |
create(Content content)
Create a new persistent entity for the given api content
|
protected abstract void |
createCustomContentEntity(Content content,
CustomContentEntityObject newVersion)
Set the extension properties on the entity.
|
protected PageResponse<Content> |
getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent,
LimitedRequest limitedRequest,
Expansions expansions,
Depth depth) |
protected PageResponse<Content> |
getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent,
LimitedRequest limitedRequest,
Expansions expansions,
Depth depth,
com.google.common.base.Predicate<? super ContentEntityObject> predicate)
This method includes an additional parameter "location", it will call the default one if not overridden
|
Class<CustomContentEntityObject> |
getEntityClass()
Get the class of the hibernate object used to persist the content type handled by this api support
|
void |
purge(Content content)
Purge an existing persistent entity from the given api content
|
void |
restore(Content content)
Restore an trashed entity from the given api content
|
boolean |
supportsTrash()
Determines whether this ContentTypeApiSupport will provide trash operation.
|
void |
trash(Content content)
Trash an existing persistent entity from the given api content
|
CustomContentEntityObject |
update(Content content,
CustomContentEntityObject entity)
Updates an existing persistent entity from the given api content
|
protected abstract boolean |
updateCustomContentEntity(Content content,
CustomContentEntityObject newVersion,
CustomContentEntityObject original)
Set the extension properties on the entity.
|
ValidationResult |
validatePurge(Content content)
Validate the purge operation
|
ValidationResult |
validateRestore(Content content)
Validate the restore operation
|
ValidationResult |
validateTrash(Content content)
Validate the trash operation
|
getChildren, getChildrenForThisType, getChildrenForThisType, getContainer, getExtensions, getLinks, hasChildren, validateCreate, validateUpdate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHandledType, supportsChildrenForParentType, supportsChildrenOfType
public CustomContentTypeApiSupport(CustomContentApiSupportParams params)
public Class<CustomContentEntityObject> getEntityClass()
ContentTypeApiSupport
public CustomContentEntityObject create(Content content)
ContentTypeApiSupport
create
in interface ContentTypeApiSupport<CustomContentEntityObject>
create
in class BaseContentTypeApiSupport<CustomContentEntityObject>
content
- the model object to create a persistent entity forpublic CustomContentEntityObject update(Content content, CustomContentEntityObject entity)
ContentTypeApiSupport
update
in interface ContentTypeApiSupport<CustomContentEntityObject>
update
in class BaseContentTypeApiSupport<CustomContentEntityObject>
content
- the updated contententity
- the existing entityprotected PageResponse<Content> getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
getChildrenOfThisTypeForOtherType
in class BaseContentTypeApiSupport<CustomContentEntityObject>
protected PageResponse<Content> getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent, LimitedRequest limitedRequest, Expansions expansions, Depth depth, com.google.common.base.Predicate<? super ContentEntityObject> predicate)
BaseContentTypeApiSupport
getChildrenOfThisTypeForOtherType
in class BaseContentTypeApiSupport<CustomContentEntityObject>
protected abstract boolean updateCustomContentEntity(Content content, CustomContentEntityObject newVersion, CustomContentEntityObject original)
Implementors can also use this hook to fire relevant update events
This method will be called from the default update method in this class. Common properties, including body and title are populated before this methods is called.
Implementors that override create and update methods directly in this class should call this method for consistency.
content
- the map of extension properties to set on the entitynewVersion
- the entity to updateoriginal
- the original copy of the entityServiceException
protected abstract void createCustomContentEntity(Content content, CustomContentEntityObject newVersion)
Implementors can also use this hook to fire relevant create events
This method will be called from the default create method in this class. Common properties, including title, space and body are populated before this method is called.
Implementors that override create and update behaviour directly in this class should call this method for consistency.
content
- the map of extension properties to set on the entitynewVersion
- the entity to updateServiceException
public void trash(Content content)
ContentTypeApiSupport
trash
in interface ContentTypeApiSupport<CustomContentEntityObject>
trash
in class BaseContentTypeApiSupport<CustomContentEntityObject>
content
- the content to be trashedpublic ValidationResult validateTrash(Content content)
ContentTypeApiSupport
validateTrash
in interface ContentTypeApiSupport<CustomContentEntityObject>
validateTrash
in class BaseContentTypeApiSupport<CustomContentEntityObject>
content
- the content that will be used to trash the entitytrue
for isValid if the content type supports trash operation.public boolean supportsTrash()
ContentTypeApiSupport
supportsTrash
in interface ContentTypeApiSupport<CustomContentEntityObject>
supportsTrash
in class BaseContentTypeApiSupport<CustomContentEntityObject>
true
if content type supports trash.public void purge(Content content)
ContentTypeApiSupport
purge
in interface ContentTypeApiSupport<CustomContentEntityObject>
purge
in class BaseContentTypeApiSupport<CustomContentEntityObject>
content
- the content to be purgedpublic ValidationResult validatePurge(Content content)
ContentTypeApiSupport
validatePurge
in interface ContentTypeApiSupport<CustomContentEntityObject>
validatePurge
in class BaseContentTypeApiSupport<CustomContentEntityObject>
content
- the content that will be used to purge the entitypublic void restore(Content content)
ContentTypeApiSupport
restore
in interface ContentTypeApiSupport<CustomContentEntityObject>
restore
in class BaseContentTypeApiSupport<CustomContentEntityObject>
content
- the content to be restoredpublic ValidationResult validateRestore(Content content)
ContentTypeApiSupport
validateRestore
in interface ContentTypeApiSupport<CustomContentEntityObject>
validateRestore
in class BaseContentTypeApiSupport<CustomContentEntityObject>
content
- the content that will be used to restore the entityCopyright © 2003–2016 Atlassian. All rights reserved.