Class CustomContentTypeApiSupport
- java.lang.Object
-
- com.atlassian.confluence.content.apisupport.BaseContentTypeApiSupport<CustomContentEntityObject>
-
- com.atlassian.confluence.content.apisupport.CustomContentTypeApiSupport
-
- All Implemented Interfaces:
ContentTypeApiSupport<CustomContentEntityObject>
- Direct Known Subclasses:
DummyAvailableContentTypeSupport
@ExperimentalSpi public abstract class CustomContentTypeApiSupport extends BaseContentTypeApiSupport<CustomContentEntityObject>
-
-
Constructor Summary
Constructors Constructor Description CustomContentTypeApiSupport(CustomContentApiSupportParams params)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CustomContentEntityObject
create(Content content)
Create a new persistent entity for the given api contentprotected 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)
Deprecated.since 7.0.1.Class<CustomContentEntityObject>
getEntityClass()
Get the class of the hibernate object used to persist the content type handled by this api supportCustomContentEntityObject
update(Content content, CustomContentEntityObject entity)
Updates an existing persistent entity from the given api contentprotected abstract boolean
updateCustomContentEntity(Content content, CustomContentEntityObject newVersion, CustomContentEntityObject original)
Set the extension properties on the entity.-
Methods inherited from class com.atlassian.confluence.content.apisupport.BaseContentTypeApiSupport
getChildren, getChildrenForThisType, getChildrenForThisType, getContainer, getExtensions, getFilteredChildrenForThisType, getFilteredChildrenOfThisTypeForOtherType, getLinks, validateCreate, validateUpdate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.content.apisupport.ContentTypeApiSupport
container, getFilteredChildren, getHandledType, supportsChildrenForParentType, supportsChildrenOfType
-
-
-
-
Constructor Detail
-
CustomContentTypeApiSupport
public CustomContentTypeApiSupport(CustomContentApiSupportParams params)
-
-
Method Detail
-
getEntityClass
public Class<CustomContentEntityObject> getEntityClass()
Description copied from interface:ContentTypeApiSupport
Get the class of the hibernate object used to persist the content type handled by this api support- Returns:
- the class of the entity used to persist changes
-
create
public CustomContentEntityObject create(Content content)
Description copied from interface:ContentTypeApiSupport
Create a new persistent entity for the given api content- Specified by:
create
in interfaceContentTypeApiSupport<CustomContentEntityObject>
- Overrides:
create
in classBaseContentTypeApiSupport<CustomContentEntityObject>
- Parameters:
content
- the model object to create a persistent entity for- Returns:
- the newly created persistent entity
-
update
public CustomContentEntityObject update(Content content, CustomContentEntityObject entity)
Description copied from interface:ContentTypeApiSupport
Updates an existing persistent entity from the given api content- Specified by:
update
in interfaceContentTypeApiSupport<CustomContentEntityObject>
- Overrides:
update
in classBaseContentTypeApiSupport<CustomContentEntityObject>
- Parameters:
content
- the updated contententity
- the existing entity- Returns:
- the updated entity
-
getChildrenOfThisTypeForOtherType
protected PageResponse<Content> getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
- Specified by:
getChildrenOfThisTypeForOtherType
in classBaseContentTypeApiSupport<CustomContentEntityObject>
-
getChildrenOfThisTypeForOtherType
@Deprecated protected PageResponse<Content> getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent, LimitedRequest limitedRequest, Expansions expansions, Depth depth, com.google.common.base.Predicate<? super ContentEntityObject> predicate)
Deprecated.Description copied from class:BaseContentTypeApiSupport
This method includes an additional parameter "location", it will call the default one if not overridden- Overrides:
getChildrenOfThisTypeForOtherType
in classBaseContentTypeApiSupport<CustomContentEntityObject>
-
updateCustomContentEntity
protected abstract boolean updateCustomContentEntity(Content content, CustomContentEntityObject newVersion, CustomContentEntityObject original)
Set the extension properties on the entity. Implementing classes can implement this to provide a lightweight hook into the content creation workflow to update extension properties whilst getting the default create behaviour.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.
- Parameters:
content
- the map of extension properties to set on the entitynewVersion
- the entity to updateoriginal
- the original copy of the entity- Returns:
- true if the method modified the entity and a save is required, false if a save is not required
- Throws:
ServiceException
-
createCustomContentEntity
protected abstract void createCustomContentEntity(Content content, CustomContentEntityObject newVersion)
Set the extension properties on the entity. Implementing classes can implement this to provide a lightweight hook into the content creation workflow to set extension properties whilst getting the default create behaviour.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.
- Parameters:
content
- the map of extension properties to set on the entitynewVersion
- the entity to update- Throws:
ServiceException
-
-