Class BaseContentTypeApiSupport<T extends ContentConvertible>
- java.lang.Object
-
- com.atlassian.confluence.content.apisupport.BaseContentTypeApiSupport<T>
-
- All Implemented Interfaces:
ContentTypeApiSupport<T>
- Direct Known Subclasses:
AttachmentContentTypeApiSupport
,BlogPostContentTypeApiSupport
,CommentContentTypeApiSupport
,CustomContentTypeApiSupport
,PageContentTypeApiSupport
@ExperimentalSpi public abstract class BaseContentTypeApiSupport<T extends ContentConvertible> extends Object implements ContentTypeApiSupport<T>
A subclass for extensible content type support in the api- Since:
- 5.7
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseContentTypeApiSupport(ApiSupportProvider provider)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description T
create(Content content)
Create a new persistent entity for the given api contentPageResponse<Content>
getChildren(ContentConvertible content, LimitedRequest limitedRequest, Expansions expansions, Depth depth, com.google.common.base.Predicate<? super ContentEntityObject> predicate)
Deprecated.since 7.0.1.protected abstract PageResponse<Content>
getChildrenForThisType(T content, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
protected PageResponse<Content>
getChildrenForThisType(T content, LimitedRequest limitedRequest, Expansions expansions, Depth depth, com.google.common.base.Predicate<? super ContentEntityObject> predicate)
Deprecated.since 7.0.1.protected abstract 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.com.atlassian.fugue.Option<Object>
getContainer(T contentEntity, Expansions expansions)
Deprecated.since 7.0.1.Map<ContentId,Map<String,Object>>
getExtensions(Iterable<T> contentEntities, Expansions expansions)
Get the set of extension properties for the collection of contentEntity Ids.protected PageResponse<Content>
getFilteredChildrenForThisType(T content, LimitedRequest limitedRequest, Expansions expansions, Depth depth, Predicate<? super ContentEntityObject> predicate)
This method includes an additional parameter "location", it will call the default one if not overriddenprotected PageResponse<Content>
getFilteredChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent, LimitedRequest limitedRequest, Expansions expansions, Depth depth, Predicate<? super ContentEntityObject> predicate)
This method includes an additional parameter "location", it will call the default one if not overriddenList<Link>
getLinks(T contentEntity)
Get additional link properties for the _links mapT
update(Content content, T entity)
Updates an existing persistent entity from the given api contentValidationResult
validateCreate(Content newContent)
Validate the create operationValidationResult
validateUpdate(Content updatedContent, T existingEntity)
Validate the update operation-
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, getEntityClass, getFilteredChildren, getHandledType, supportsChildrenForParentType, supportsChildrenOfType
-
-
-
-
Constructor Detail
-
BaseContentTypeApiSupport
protected BaseContentTypeApiSupport(ApiSupportProvider provider)
-
-
Method Detail
-
getChildren
@Deprecated public final PageResponse<Content> getChildren(ContentConvertible content, LimitedRequest limitedRequest, Expansions expansions, Depth depth, com.google.common.base.Predicate<? super ContentEntityObject> predicate)
Deprecated.Retrieve the children of an item of Content.- Specified by:
getChildren
in interfaceContentTypeApiSupport<T extends ContentConvertible>
-
getChildrenForThisType
protected abstract PageResponse<Content> getChildrenForThisType(T content, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
-
getChildrenForThisType
@Deprecated protected PageResponse<Content> getChildrenForThisType(T content, LimitedRequest limitedRequest, Expansions expansions, Depth depth, com.google.common.base.Predicate<? super ContentEntityObject> predicate)
Deprecated.This method includes an additional parameter "location", it will call the default one if not overridden- Since:
- 5.7
-
getFilteredChildrenForThisType
protected PageResponse<Content> getFilteredChildrenForThisType(T content, LimitedRequest limitedRequest, Expansions expansions, Depth depth, Predicate<? super ContentEntityObject> predicate)
This method includes an additional parameter "location", it will call the default one if not overridden- Since:
- 7.0.1
-
getChildrenOfThisTypeForOtherType
protected abstract PageResponse<Content> getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
-
getChildrenOfThisTypeForOtherType
@Deprecated protected PageResponse<Content> getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent, LimitedRequest limitedRequest, Expansions expansions, Depth depth, com.google.common.base.Predicate<? super ContentEntityObject> predicate)
Deprecated.This method includes an additional parameter "location", it will call the default one if not overridden- Since:
- 5.7
-
getFilteredChildrenOfThisTypeForOtherType
protected PageResponse<Content> getFilteredChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent, LimitedRequest limitedRequest, Expansions expansions, Depth depth, Predicate<? super ContentEntityObject> predicate)
This method includes an additional parameter "location", it will call the default one if not overridden- Since:
- 7.0.1
-
getExtensions
public Map<ContentId,Map<String,Object>> getExtensions(Iterable<T> contentEntities, Expansions expansions)
Get the set of extension properties for the collection of contentEntity Ids. Dealing with collections here may help reduce the number of db queries we need to execute.Implementors should override to provide extensions for the given contentEntity.
- Specified by:
getExtensions
in interfaceContentTypeApiSupport<T extends ContentConvertible>
-
getLinks
public List<Link> getLinks(T contentEntity)
Get additional link properties for the _links mapImplementors should override and provide links for the given contentEntity
- Specified by:
getLinks
in interfaceContentTypeApiSupport<T extends ContentConvertible>
-
getContainer
@Deprecated public com.atlassian.fugue.Option<Object> getContainer(T contentEntity, Expansions expansions)
Deprecated.since 7.0.1. UseContentTypeApiSupport.container(ContentConvertible, Expansions)
The return type of this method is intentionly broad. Implementors can choose to return the commonly handled container hibernate entities, namely Space, Page or BlogPost, or can choose to provide a model object that implements the api Container interface, no further conversion of instances of Container objects will occur.- Specified by:
getContainer
in interfaceContentTypeApiSupport<T extends ContentConvertible>
- Parameters:
contentEntity
- - the content entity to get the container object for- Returns:
- either a Space, Page or BlogPost or an instance of Container
-
create
public T create(Content content)
Description copied from interface:ContentTypeApiSupport
Create a new persistent entity for the given api content- Specified by:
create
in interfaceContentTypeApiSupport<T extends ContentConvertible>
- Parameters:
content
- the model object to create a persistent entity for- Returns:
- the newly created persistent entity
-
validateCreate
public ValidationResult validateCreate(Content newContent)
Description copied from interface:ContentTypeApiSupport
Validate the create operation- Specified by:
validateCreate
in interfaceContentTypeApiSupport<T extends ContentConvertible>
- Parameters:
newContent
- the content that will be used to create an entity- Returns:
- a validation result wrapping any validation errors that were encountered
-
update
public T update(Content content, T entity)
Description copied from interface:ContentTypeApiSupport
Updates an existing persistent entity from the given api content- Specified by:
update
in interfaceContentTypeApiSupport<T extends ContentConvertible>
- Parameters:
content
- the updated contententity
- the existing entity- Returns:
- the updated entity
-
validateUpdate
public ValidationResult validateUpdate(Content updatedContent, T existingEntity)
Description copied from interface:ContentTypeApiSupport
Validate the update operation- Specified by:
validateUpdate
in interfaceContentTypeApiSupport<T extends ContentConvertible>
- Parameters:
updatedContent
- the content that will be used to update the entityexistingEntity
- the existing entity to be updated- Returns:
- a validation result wrapping any validation errors that were encountered
-
-