public class AttachmentContentTypeApiSupport extends BaseContentTypeApiSupport<Attachment>
Attachment
s.Constructor and Description |
---|
AttachmentContentTypeApiSupport(ContentEntityManager contentEntityManager,
ContentFactory contentFactory,
AttachmentManagerInternal attachmentManager,
PaginationService paginationService,
PermissionManager permissionManager,
ApiSupportProvider apiSupportProvider,
ContentCreator contentCreator,
ThumbnailManager thumbnailManager) |
Modifier and Type | Method and Description |
---|---|
boolean |
canCreateAttachments(ContentEntityObject ceo) |
boolean |
canRemoveAttachment(Attachment attachment) |
PageResponse<Content> |
getAttachments(ContentId containerId,
LimitedRequest limitedRequest,
com.google.common.base.Predicate<? super Attachment> predicate,
Expansions contentExpansions) |
com.atlassian.fugue.Option<Content> |
getById(ContentId attachmentId,
List<ContentStatus> statuses,
Expansions expansions) |
protected PageResponse<Content> |
getChildrenForThisType(Attachment content,
LimitedRequest limitedRequest,
Expansions expansions,
Depth depth) |
PageResponse<Content> |
getChildrenOfThisTypeForOtherType(ContentConvertible parent,
LimitedRequest limitedRequest,
Expansions expansions,
Depth depth) |
Class<Attachment> |
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<Attachment> attachments,
Expansions expansions)
Get the set of extension properties for the collection of contentEntity Ids.
|
ContentType |
getHandledType() |
List<Link> |
getLinks(Attachment attachment)
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 otherType)
Determines whether other ContentTypeApiSupports can provide children for this type.
|
Attachment |
update(Content content,
Attachment entity)
Updates an existing persistent entity from the given api content
|
ValidationResult |
validateCreate(Content newContent)
Validate the create operation
|
ValidationResult |
validateUpdate(Content updatedContent,
Attachment existingEntity)
Validate the update operation
|
create, getChildren, getChildrenForThisType, getChildrenOfThisTypeForOtherType, getContainer, getFilteredChildrenForThisType, getFilteredChildrenOfThisTypeForOtherType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
container, getFilteredChildren
public AttachmentContentTypeApiSupport(ContentEntityManager contentEntityManager, ContentFactory contentFactory, AttachmentManagerInternal attachmentManager, PaginationService paginationService, PermissionManager permissionManager, ApiSupportProvider apiSupportProvider, ContentCreator contentCreator, ThumbnailManager thumbnailManager)
public PageResponse<Content> getChildrenOfThisTypeForOtherType(ContentConvertible parent, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
getChildrenOfThisTypeForOtherType
in class BaseContentTypeApiSupport<Attachment>
public PageResponse<Content> getAttachments(ContentId containerId, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super Attachment> predicate, Expansions contentExpansions) throws ServiceException
ServiceException
public com.atlassian.fugue.Option<Content> getById(ContentId attachmentId, List<ContentStatus> statuses, Expansions expansions)
public ContentType getHandledType()
ContentType
of the Content
that this service provides.protected PageResponse<Content> getChildrenForThisType(Attachment content, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
getChildrenForThisType
in class BaseContentTypeApiSupport<Attachment>
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)
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<Attachment> attachments, Expansions expansions)
BaseContentTypeApiSupport
Implementors should override to provide extensions for the given contentEntity.
getExtensions
in interface ContentTypeApiSupport<Attachment>
getExtensions
in class BaseContentTypeApiSupport<Attachment>
public List<Link> getLinks(Attachment attachment)
BaseContentTypeApiSupport
Implementors should override and provide links for the given contentEntity
getLinks
in interface ContentTypeApiSupport<Attachment>
getLinks
in class BaseContentTypeApiSupport<Attachment>
public Class<Attachment> getEntityClass()
ContentTypeApiSupport
public ValidationResult validateCreate(Content newContent)
ContentTypeApiSupport
validateCreate
in interface ContentTypeApiSupport<Attachment>
validateCreate
in class BaseContentTypeApiSupport<Attachment>
newContent
- the content that will be used to create an entitypublic ValidationResult validateUpdate(Content updatedContent, Attachment existingEntity)
ContentTypeApiSupport
validateUpdate
in interface ContentTypeApiSupport<Attachment>
validateUpdate
in class BaseContentTypeApiSupport<Attachment>
updatedContent
- the content that will be used to update the entityexistingEntity
- the existing entity to be updatedpublic Attachment update(Content content, Attachment entity)
ContentTypeApiSupport
update
in interface ContentTypeApiSupport<Attachment>
update
in class BaseContentTypeApiSupport<Attachment>
content
- the updated contententity
- the existing entitypublic boolean canCreateAttachments(ContentEntityObject ceo)
public boolean canRemoveAttachment(Attachment attachment)
Copyright © 2003–2020 Atlassian. All rights reserved.