@ExperimentalSpi
public interface ContentTypeApiSupport<T extends ContentConvertible>
Implementors should extend BaseContentTypeApiSupport
Modifier and Type | Method and Description |
---|---|
default Optional<Object> |
container(T contentEntity,
Expansions expansions)
The return type of this method is intentionally broad.
|
T |
create(Content content)
Create a new persistent entity for the given api content
|
PageResponse<Content> |
getChildren(ContentConvertible content,
LimitedRequest limitedRequest,
Expansions expansions,
Depth depth,
com.google.common.base.Predicate<? super ContentEntityObject> predicate)
Deprecated.
|
com.atlassian.fugue.Option<Object> |
getContainer(T contentEntity,
Expansions expansions)
Deprecated.
since 7.0.1. Use
container(ContentConvertible, Expansions) |
Class<T> |
getEntityClass()
Get the class of the hibernate object used to persist the content type handled by this api support
|
Map<ContentId,Map<String,Object>> |
getExtensions(Iterable<T> contentEntities,
Expansions expansions)
Get the set of extension properties for the collection of contentEntity Ids.
|
default PageResponse<Content> |
getFilteredChildren(ContentConvertible content,
LimitedRequest limitedRequest,
Expansions expansions,
Depth depth,
Predicate<? super ContentEntityObject> predicate)
Retrieve the children of an item of Content filtered by a predicate.
|
ContentType |
getHandledType() |
List<Link> |
getLinks(T contentEntity)
Get additional link properties for the _links map
|
boolean |
supportsChildrenForParentType(ContentType parentType)
Determines whether this ContentTypeApiSupport will provide children for other types.
|
boolean |
supportsChildrenOfType(ContentType childType)
Determines whether other ContentTypeApiSupports can provide children for this type.
|
T |
update(Content content,
T existingEntity)
Updates an existing persistent entity from the given api content
|
ValidationResult |
validateCreate(Content newContent)
Validate the create operation
|
ValidationResult |
validateUpdate(Content oldContent,
T existingEntity)
Validate the update operation
|
ContentType getHandledType()
ContentType
of the Content
that this service provides.@Deprecated PageResponse<Content> getChildren(ContentConvertible content, LimitedRequest limitedRequest, Expansions expansions, Depth depth, com.google.common.base.Predicate<? super ContentEntityObject> predicate)
getFilteredChildren(ContentConvertible, LimitedRequest, Expansions, Depth, Predicate)
default PageResponse<Content> getFilteredChildren(ContentConvertible content, LimitedRequest limitedRequest, Expansions expansions, Depth depth, Predicate<? super ContentEntityObject> predicate)
boolean supportsChildrenOfType(ContentType childType)
For children of type childType
to be allowed as children of this type,
this type needs to return true
for
supportsChildrenOfType(childType)
,
and childType
needs to return true
for
supportsChildrenForParentType(thisType)
.
childType
- the other Content type that wants to offer children below an instance of our typeContent
of otherType
's ContentType
should be allowed
as children of this type (as far as this type is concerned:
childType
also gets a say via supportsChildrenForParentType(ContentType)
)supportsChildrenForParentType(ContentType)
boolean supportsChildrenForParentType(ContentType parentType)
For children of this type to be allowed as children of parentType
,
this type needs to return true
for
supportsChildrenForParentType(parentType)
,
and parentType
needs to return true
for
supportsChildrenOfType(thisType)
.
parentType
- the other Content type that our type is offering children toContent
of this type's ContentType
should be allowed to be a child of
parentType
(as far as this type is concerned:
parentType
also gets a say via supportsChildrenOfType(ContentType)
)supportsChildrenOfType(ContentType)
Map<ContentId,Map<String,Object>> getExtensions(Iterable<T> contentEntities, Expansions expansions)
Implementors should override to provide extensions for the given contentEntity.
List<Link> getLinks(T contentEntity)
Implementors should override and provide links for the given contentEntity
@Deprecated com.atlassian.fugue.Option<Object> getContainer(T contentEntity, Expansions expansions)
container(ContentConvertible, Expansions)
contentEntity
- - the content entity to get the container object fordefault Optional<Object> container(T contentEntity, Expansions expansions)
contentEntity
- - the content entity to get the container object forClass<T> getEntityClass()
T create(Content content)
content
- the model object to create a persistent entity forT update(Content content, T existingEntity)
content
- the updated contentexistingEntity
- the existing entityValidationResult validateCreate(Content newContent)
newContent
- the content that will be used to create an entityValidationResult validateUpdate(Content oldContent, T existingEntity)
oldContent
- the content that will be used to update the entityexistingEntity
- the existing entity to be updatedCopyright © 2003–2020 Atlassian. All rights reserved.