Interface ContentLabelService
-
- All Known Implementing Classes:
ContentLabelServiceImpl
@ExperimentalApi public interface ContentLabelService
API Service for interacting with labels on Content- Since:
- 5.5
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ContentLabelService.Validator
Provides methods for validating actions on the ContentLabelService
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description PageResponse<Label>
addLabels(ContentId contentId, Iterable<Label> labels)
Adds the given labels to the specified contentPageResponse<Label>
getLabels(ContentId contentId, Collection<Label.Prefix> prefixes, PageRequest pageRequest)
Get the labels attached to a given piece of content in the given namespacesvoid
removeLabel(@NonNull ContentId contentId, @NonNull Label label)
Removes the given label the content with the given contentIdvoid
removeLabel(ContentId contentId, String label)
Deprecated.since 6.5.0, useremoveLabel(ContentId, Label)
ContentLabelService.Validator
validator()
Provides a validator for validating actions on the ContentLabelService and checking permissions related to labels on Content
-
-
-
Method Detail
-
getLabels
PageResponse<Label> getLabels(ContentId contentId, Collection<Label.Prefix> prefixes, PageRequest pageRequest) throws NotFoundException
Get the labels attached to a given piece of content in the given namespaces- 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
PageResponse<Label> addLabels(ContentId contentId, Iterable<Label> labels) throws ServiceException
Adds the given labels to the specified content- 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 void removeLabel(ContentId contentId, String label)
Deprecated.since 6.5.0, useremoveLabel(ContentId, Label)
Removes the given label from the specified content- 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
void removeLabel(@NonNull ContentId contentId, @NonNull Label label)
Removes the given label the content with the given contentId- Parameters:
contentId
- the id of the content to remove the label fromlabel
- the label to be removed- Since:
- 6.5.0
-
validator
ContentLabelService.Validator validator()
Provides a validator for validating actions on the ContentLabelService and checking permissions related to labels on Content- Returns:
- an contentLabelService Validator
-
-