public interface ContentTypeApiSupport<T extends ContentConvertible>
Modifier and Type | Method and Description |
---|---|
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)
Retrieve the children of an item of Content filtered by a predicate.
|
com.atlassian.fugue.Option<Object> |
getContainer(T contentEntity,
Expansions expansions)
The return type of this method is intentionly broad.
|
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.
|
ContentType |
getHandledType() |
List<Link> |
getLinks(T contentEntity)
Get additional link properties for the _links map
Implementors should override and provide links for the given contentEntity
|
boolean |
supportsChildrenForParentType(ContentType parentType) |
boolean |
supportsChildrenOfType(ContentType otherType)
A check that prevents other ContentTypeApiSupports of providing 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.PageResponse<Content> getChildren(ContentConvertible content, LimitedRequest limitedRequest, Expansions expansions, Depth depth, com.google.common.base.Predicate<? super ContentEntityObject> predicate)
boolean supportsChildrenOfType(ContentType otherType)
otherType
- - the other Content type that wants to offer children of our typeboolean supportsChildrenForParentType(ContentType parentType)
Content
of this binding's ContentType
can be a child of contentEntity of the given typeMap<ContentId,Map<String,Object>> getExtensions(Iterable<T> contentEntities, Expansions expansions)
List<Link> getLinks(T contentEntity)
com.atlassian.fugue.Option<Object> getContainer(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–2015 Atlassian. All rights reserved.