Class ContentLabelServiceImpl
java.lang.Object
com.atlassian.confluence.api.impl.service.content.ContentLabelServiceImpl
- All Implemented Interfaces:
ContentLabelService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.confluence.api.service.content.ContentLabelService
ContentLabelService.Validator -
Constructor Summary
ConstructorsConstructorDescriptionContentLabelServiceImpl(ContentService contentService, LabelsService labelsService, ContentEntityManagerInternal contentEntityManager) -
Method Summary
Modifier and TypeMethodDescriptionAdds the given labels to the specified contentgetLabels(ContentId contentId, Collection<Label.Prefix> prefixes, PageRequest pageRequest) Get the labels attached to a given piece of content in the given namespacesfinal voidremoveLabel(@NonNull ContentId contentId, @NonNull Label label) Removes the given label the content with the given contentIdvoidremoveLabel(ContentId contentId, String label) Deprecated.com.atlassian.confluence.api.impl.service.content.ContentLabelServiceImpl.ValidatorImplProvides a validator for validating actions on the ContentLabelService and checking permissions related to labels on Content
-
Constructor Details
-
ContentLabelServiceImpl
public ContentLabelServiceImpl(ContentService contentService, LabelsService labelsService, ContentEntityManagerInternal contentEntityManager)
-
-
Method Details
-
getLabels
public PageResponse<Label> getLabels(ContentId contentId, Collection<Label.Prefix> prefixes, PageRequest pageRequest) throws NotFoundException Description copied from interface:ContentLabelServiceGet the labels attached to a given piece of content in the given namespaces- Specified by:
getLabelsin interfaceContentLabelService- Parameters:
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 offset- Returns:
- all the labels associated with the given content up to the limit of the page request, or a system defined limit
- Throws:
NotFoundException- if the content does not exist, or is not viewable by the user
-
addLabels
public PageResponse<Label> addLabels(ContentId contentId, Iterable<Label> labels) throws ServiceException Description copied from interface:ContentLabelServiceAdds the given labels to the specified content- Specified by:
addLabelsin interfaceContentLabelService- Parameters:
contentId- the id of the content to add labels tolabels- the label(s) that will be added- Returns:
- all the labels that are associated with the specified content
- Throws:
ServiceException- if at least one label is invalid. Provides an error message
-
removeLabel
Deprecated.since 6.5.0 use {removeLabel(ContentId, Label)}Description copied from interface:ContentLabelServiceRemoves the given label from the specified content- Specified by:
removeLabelin interfaceContentLabelService- Parameters:
contentId- the id of the content to remove label fromlabel- the label that will be removed- Throws:
ServiceException- if the user can not delete the label. Provides an error message.
-
removeLabel
Description copied from interface:ContentLabelServiceRemoves the given label the content with the given contentId- Specified by:
removeLabelin interfaceContentLabelService- Parameters:
contentId- the id of the content to remove the label fromlabel- the label to be removed
-
validator
public com.atlassian.confluence.api.impl.service.content.ContentLabelServiceImpl.ValidatorImpl validator()Description copied from interface:ContentLabelServiceProvides a validator for validating actions on the ContentLabelService and checking permissions related to labels on Content- Specified by:
validatorin interfaceContentLabelService- Returns:
- an contentLabelService Validator
-
removeLabel(ContentId, Label)}