Class CommentContentTypeApiSupport
- java.lang.Object
-
- com.atlassian.confluence.content.apisupport.BaseContentTypeApiSupport<Comment>
-
- com.atlassian.confluence.api.impl.service.content.typebinding.CommentContentTypeApiSupport
-
- All Implemented Interfaces:
ContentTypeApiSupport<Comment>
public class CommentContentTypeApiSupport extends BaseContentTypeApiSupport<Comment>
ΓΈ Performs API operations forComment
s.
-
-
Constructor Summary
Constructors Constructor Description CommentContentTypeApiSupport(CommentManagerInternal commentManager, PaginationService paginationService, ContentFactory contentFactory, PermissionManager permissionManager, ContentEntityManager contentEntityManager, ApiSupportProvider apiSupportProvider, CommentService commentService, ContentBodyConversionService contentBodyConversionService, com.atlassian.plugin.PluginAccessor pluginAccessor, com.atlassian.event.api.EventPublisher eventPublisher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Comment
create(Content newContent)
Create a new persistent entity for the given api contentprotected 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 overriddenprotected 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 overriddenClass<Comment>
getEntityClass()
Get the class of the hibernate object used to persist the content type handled by this api supportMap<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 contentValidationResult
validateCreate(Content newContent)
Validate the create operationValidationResult
validateUpdate(Content updatedContent, Comment existingEntity)
Validate the update operation-
Methods inherited from class com.atlassian.confluence.content.apisupport.BaseContentTypeApiSupport
getChildren, getContainer, getFilteredChildrenForThisType, getFilteredChildrenOfThisTypeForOtherType, getLinks
-
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
-
-
-
-
Constructor Detail
-
CommentContentTypeApiSupport
public CommentContentTypeApiSupport(CommentManagerInternal commentManager, PaginationService paginationService, ContentFactory contentFactory, PermissionManager permissionManager, ContentEntityManager contentEntityManager, ApiSupportProvider apiSupportProvider, CommentService commentService, ContentBodyConversionService contentBodyConversionService, com.atlassian.plugin.PluginAccessor pluginAccessor, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Detail
-
getHandledType
public ContentType getHandledType()
- Returns:
- the
ContentType
of theContent
that this service provides.
-
getChildrenForThisType
protected PageResponse<Content> getChildrenForThisType(Comment content, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
- Specified by:
getChildrenForThisType
in classBaseContentTypeApiSupport<Comment>
-
getChildrenForThisType
protected PageResponse<Content> getChildrenForThisType(Comment content, LimitedRequest limitedRequest, Expansions expansions, Depth depth, com.google.common.base.Predicate<? super ContentEntityObject> predicate)
Description copied from class:BaseContentTypeApiSupport
This method includes an additional parameter "location", it will call the default one if not overridden- Overrides:
getChildrenForThisType
in classBaseContentTypeApiSupport<Comment>
-
supportsChildrenOfType
public boolean supportsChildrenOfType(ContentType otherType)
Description copied from interface:ContentTypeApiSupport
Determines whether other ContentTypeApiSupports can provide children for this type.For children of type
childType
to be allowed as children of this type, this type needs to returntrue
forsupportsChildrenOfType(childType)
, andchildType
needs to returntrue
forsupportsChildrenForParentType(thisType)
.- Parameters:
otherType
- the other Content type that wants to offer children below an instance of our type- Returns:
- true if
Content
ofotherType
'sContentType
should be allowed as children of this type (as far as this type is concerned:childType
also gets a say viaContentTypeApiSupport.supportsChildrenForParentType(ContentType)
) - See Also:
ContentTypeApiSupport.supportsChildrenForParentType(ContentType)
-
getChildrenOfThisTypeForOtherType
protected PageResponse<Content> getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
- Specified by:
getChildrenOfThisTypeForOtherType
in classBaseContentTypeApiSupport<Comment>
-
getChildrenOfThisTypeForOtherType
protected PageResponse<Content> getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent, LimitedRequest limitedRequest, Expansions expansions, Depth depth, com.google.common.base.Predicate<? super ContentEntityObject> predicate)
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<Comment>
-
supportsChildrenForParentType
public boolean supportsChildrenForParentType(ContentType parentType)
Description copied from interface:ContentTypeApiSupport
Determines whether this ContentTypeApiSupport will provide children for other types.For children of this type to be allowed as children of
parentType
, this type needs to returntrue
forsupportsChildrenForParentType(parentType)
, andparentType
needs to returntrue
forsupportsChildrenOfType(thisType)
.- Parameters:
parentType
- the other Content type that our type is offering children to- Returns:
- true if
Content
of this type'sContentType
should be allowed to be a child ofparentType
(as far as this type is concerned:parentType
also gets a say viaContentTypeApiSupport.supportsChildrenOfType(ContentType)
) - See Also:
ContentTypeApiSupport.supportsChildrenOfType(ContentType)
-
getExtensions
public Map<ContentId,Map<String,Object>> getExtensions(Iterable<Comment> contentEntities, Expansions expansions)
Description copied from class:BaseContentTypeApiSupport
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<Comment>
- Overrides:
getExtensions
in classBaseContentTypeApiSupport<Comment>
-
getEntityClass
public Class<Comment> 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 Comment create(Content newContent)
Description copied from interface:ContentTypeApiSupport
Create a new persistent entity for the given api content- Specified by:
create
in interfaceContentTypeApiSupport<Comment>
- Overrides:
create
in classBaseContentTypeApiSupport<Comment>
- Parameters:
newContent
- 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<Comment>
- Overrides:
validateCreate
in classBaseContentTypeApiSupport<Comment>
- Parameters:
newContent
- the content that will be used to create an entity- Returns:
- a validation result wrapping any validation errors that were encountered
-
validateUpdate
public ValidationResult validateUpdate(Content updatedContent, Comment existingEntity)
Description copied from interface:ContentTypeApiSupport
Validate the update operation- Specified by:
validateUpdate
in interfaceContentTypeApiSupport<Comment>
- Overrides:
validateUpdate
in classBaseContentTypeApiSupport<Comment>
- 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
-
update
public Comment update(Content contentToUpdate, Comment entity)
Description copied from interface:ContentTypeApiSupport
Updates an existing persistent entity from the given api content- Specified by:
update
in interfaceContentTypeApiSupport<Comment>
- Overrides:
update
in classBaseContentTypeApiSupport<Comment>
- Parameters:
contentToUpdate
- the updated contententity
- the existing entity- Returns:
- the updated entity
-
execute
protected void execute(ServiceCommand command) throws PermissionException, BadRequestException
-
-