public class ContentLabelServiceImpl extends Object implements ContentLabelService
ContentLabelService.Validator
Constructor and Description |
---|
ContentLabelServiceImpl(ContentService contentService,
LabelsService labelsService,
ContentEntityManagerInternal contentEntityManager) |
Modifier and Type | Method and Description |
---|---|
PageResponse<Label> |
addLabels(ContentId contentId,
Iterable<Label> labels)
Adds the given labels to the specified content
|
PageResponse<Label> |
getLabels(ContentId contentId,
Collection<Label.Prefix> prefixes,
PageRequest pageRequest)
Get the labels attached to a given piece of content in the given namespaces
|
void |
removeLabel(@NonNull ContentId contentId,
@NonNull Label label)
Removes the given label the content with the given contentId
|
void |
removeLabel(ContentId contentId,
String label)
Deprecated.
since 6.5.0 use {
removeLabel(ContentId, Label) } |
com.atlassian.confluence.api.impl.service.content.ContentLabelServiceImpl.ValidatorImpl |
validator()
Provides a validator for validating actions on the ContentLabelService and checking permissions
related to labels on Content
|
public ContentLabelServiceImpl(ContentService contentService, LabelsService labelsService, ContentEntityManagerInternal contentEntityManager)
public PageResponse<Label> getLabels(ContentId contentId, Collection<Label.Prefix> prefixes, PageRequest pageRequest) throws NotFoundException
ContentLabelService
getLabels
in interface ContentLabelService
contentId
- the id of the content to retrieveprefixes
- - the prefixes to filter the returned labels by, if empty no prefix filter is appliedpageRequest
- - indicates how many labels to return and from what offsetNotFoundException
- if the content does not exist, or is not viewable by the userpublic PageResponse<Label> addLabels(ContentId contentId, Iterable<Label> labels) throws ServiceException
ContentLabelService
addLabels
in interface ContentLabelService
contentId
- the id of the content to add labels tolabels
- the label(s) that will be addedServiceException
- if at least one label is invalid. Provides an error message@Deprecated public void removeLabel(ContentId contentId, String label) throws ServiceException
removeLabel(ContentId, Label)
}ContentLabelService
removeLabel
in interface ContentLabelService
contentId
- the id of the content to remove label fromlabel
- the label that will be removedServiceException
- if the user can not delete the label. Provides an error message.public final void removeLabel(@NonNull ContentId contentId, @NonNull Label label)
ContentLabelService
removeLabel
in interface ContentLabelService
contentId
- the id of the content to remove the label fromlabel
- the label to be removedpublic com.atlassian.confluence.api.impl.service.content.ContentLabelServiceImpl.ValidatorImpl validator()
ContentLabelService
validator
in interface ContentLabelService
Copyright © 2003–2020 Atlassian. All rights reserved.