public class CommentContentTypeApiSupport extends BaseContentTypeApiSupport<Comment>
Comment
s.Constructor and Description |
---|
CommentContentTypeApiSupport(CommentManagerInternal commentManager,
PaginationService paginationService,
ContentFactory contentFactory,
PermissionManager permissionManager,
ContentEntityManager contentEntityManager,
ApiSupportProvider apiSupportProvider,
CommentService commentService,
ContentBodyConversionService contentBodyConversionService,
com.atlassian.plugin.PluginAccessor pluginAccessor) |
Modifier and Type | Method and Description |
---|---|
Comment |
create(Content newContent)
Create a new persistent entity for the given api content
|
protected void |
execute(ServiceCommand command) |
protected PageResponse<Content> |
getChildrenForThisType(Comment content,
LimitedRequest limitedRequest,
Expansions expansions,
Depth depth) |
protected PageResponse<Content> |
getChildrenForThisType(Comment content,
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
|
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<Comment> |
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<Comment> contentEntities,
Expansions expansions)
Get the set of extension properties for the collection of contentEntity Ids.
|
ContentType |
getHandledType() |
boolean |
supportsChildrenForParentType(ContentType parentType)
Determines whether this ContentTypeApiSupport will provide children for other types.
|
boolean |
supportsChildrenOfType(ContentType otherType)
Determines whether other ContentTypeApiSupports can provide children for this type.
|
Comment |
update(Content contentToUpdate,
Comment entity)
Updates an existing persistent entity from the given api content
|
ValidationResult |
validateCreate(Content newContent)
Validate the create operation
|
ValidationResult |
validateUpdate(Content updatedContent,
Comment existingEntity)
Validate the update operation
|
getChildren, getContainer, getFilteredChildrenForThisType, getFilteredChildrenOfThisTypeForOtherType, getLinks
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
container, getFilteredChildren
public CommentContentTypeApiSupport(CommentManagerInternal commentManager, PaginationService paginationService, ContentFactory contentFactory, PermissionManager permissionManager, ContentEntityManager contentEntityManager, ApiSupportProvider apiSupportProvider, CommentService commentService, ContentBodyConversionService contentBodyConversionService, com.atlassian.plugin.PluginAccessor pluginAccessor)
public ContentType getHandledType()
ContentType
of the Content
that this service provides.protected PageResponse<Content> getChildrenForThisType(Comment content, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
getChildrenForThisType
in class BaseContentTypeApiSupport<Comment>
protected PageResponse<Content> getChildrenForThisType(Comment content, LimitedRequest limitedRequest, Expansions expansions, Depth depth, com.google.common.base.Predicate<? super ContentEntityObject> predicate)
BaseContentTypeApiSupport
getChildrenForThisType
in class BaseContentTypeApiSupport<Comment>
public boolean supportsChildrenOfType(ContentType otherType)
ContentTypeApiSupport
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)
.
otherType
- 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 ContentTypeApiSupport.supportsChildrenForParentType(ContentType)
)ContentTypeApiSupport.supportsChildrenForParentType(ContentType)
protected PageResponse<Content> getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
getChildrenOfThisTypeForOtherType
in class BaseContentTypeApiSupport<Comment>
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<Comment>
public boolean supportsChildrenForParentType(ContentType parentType)
ContentTypeApiSupport
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 ContentTypeApiSupport.supportsChildrenOfType(ContentType)
)ContentTypeApiSupport.supportsChildrenOfType(ContentType)
public Map<ContentId,Map<String,Object>> getExtensions(Iterable<Comment> contentEntities, Expansions expansions)
BaseContentTypeApiSupport
Implementors should override to provide extensions for the given contentEntity.
getExtensions
in interface ContentTypeApiSupport<Comment>
getExtensions
in class BaseContentTypeApiSupport<Comment>
public Class<Comment> getEntityClass()
ContentTypeApiSupport
public Comment create(Content newContent)
ContentTypeApiSupport
create
in interface ContentTypeApiSupport<Comment>
create
in class BaseContentTypeApiSupport<Comment>
newContent
- the model object to create a persistent entity forpublic ValidationResult validateCreate(Content newContent)
ContentTypeApiSupport
validateCreate
in interface ContentTypeApiSupport<Comment>
validateCreate
in class BaseContentTypeApiSupport<Comment>
newContent
- the content that will be used to create an entitypublic ValidationResult validateUpdate(Content updatedContent, Comment existingEntity)
ContentTypeApiSupport
validateUpdate
in interface ContentTypeApiSupport<Comment>
validateUpdate
in class BaseContentTypeApiSupport<Comment>
updatedContent
- the content that will be used to update the entityexistingEntity
- the existing entity to be updatedpublic Comment update(Content contentToUpdate, Comment entity)
ContentTypeApiSupport
update
in interface ContentTypeApiSupport<Comment>
update
in class BaseContentTypeApiSupport<Comment>
contentToUpdate
- the updated contententity
- the existing entityprotected void execute(ServiceCommand command) throws PermissionException, BadRequestException
Copyright © 2003–2020 Atlassian. All rights reserved.