public class TemplateServiceImpl extends Object implements TemplateService
Constructor and Description |
---|
TemplateServiceImpl(PageTemplateManager pageTemplateManager,
PermissionManager permissionManager,
LabelsService labelsService) |
Modifier and Type | Method and Description |
---|---|
Iterable<Label> |
addLabels(long pageTemplateId,
Iterable<Label> labels)
Adds the given labels to the specified content
|
Iterable<Label> |
getLabels(long pageTemplateId,
Collection<Label.Prefix> prefixes)
Get the labels attached to a given page template
|
void |
removeLabel(long pageTemplateId,
long labelId)
Remove a label with labelId from the specified content
|
public TemplateServiceImpl(PageTemplateManager pageTemplateManager, PermissionManager permissionManager, LabelsService labelsService)
public Iterable<Label> getLabels(long pageTemplateId, Collection<Label.Prefix> prefixes) throws NotFoundException
TemplateService
getLabels
in interface TemplateService
pageTemplateId
- id of the page template to fetch labels for.NotFoundException
- if the page template does not exist, or is not viewable by the userpublic Iterable<Label> addLabels(long pageTemplateId, Iterable<Label> labels) throws IllegalArgumentException
TemplateService
addLabels
in interface TemplateService
pageTemplateId
- the id of the content to add labels tolabels
- the label(s) that will be addedIllegalArgumentException
- if at least one label is invalid. Provides an error messagepublic void removeLabel(long pageTemplateId, long labelId) throws IllegalArgumentException
TemplateService
removeLabel
in interface TemplateService
pageTemplateId
- the id of the content to remove the label fromlabelId
- the id of the label to removeIllegalArgumentException
- failed to remove the labelCopyright © 2003–2016 Atlassian. All rights reserved.