com.atlassian.confluence.rest.resources
Class ContentLabelsResource

java.lang.Object
  extended by com.atlassian.confluence.rest.resources.ContentLabelsResource

public class ContentLabelsResource
extends java.lang.Object

REST wrapper for the ContentLabelService.


Constructor Summary
ContentLabelsResource(ContentLabelService contentLabelService)
           
 
Method Summary
 PageResponse<Label> addLabels(ContentId contentId, java.util.List<Label> labels)
          Adds a list of labels to the specified content.
 PageResponse<Label> labels(ContentId contentId, java.util.List<java.lang.String> prefixes, int start, int limit, javax.ws.rs.core.UriInfo uriInfo)
          Returns the list of labels on a piece of Content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentLabelsResource

public ContentLabelsResource(ContentLabelService contentLabelService)
Method Detail

labels

@PublicApi
public PageResponse<Label> labels(ContentId contentId,
                                            java.util.List<java.lang.String> prefixes,
                                            int start,
                                            int limit,
                                            @Context
                                            javax.ws.rs.core.UriInfo uriInfo)
                           throws ServiceException

Returns the list of labels on a piece of Content.

Example request URI(s):

  • http://example.com/rest/api/content/1234/labels
  • http://example.com/rest/api/content/1234/labels?prefix=global&start=0&limit=200

Parameters:
contentId - a string containing the id of the labels content container
prefixes - the prefixes to filter the labels with Label.Prefix
start - the start point of the collection to return
limit - the limit of the number of labels to return, this may be restricted by fixed system limits
uriInfo - (injected) information about the request URI
Returns:
a JSON representation of the labels on the content with the given id, or a 404 NOT FOUND if there is no content with the given id or if the user is not permitted. An empty list will be returned if there are no labels on the given content
Throws:
ServiceException

addLabels

@PublicApi
public PageResponse<Label> addLabels(ContentId contentId,
                                               java.util.List<Label> labels)
                              throws ServiceException

Adds a list of labels to the specified content.

The body is the json representation of the list.

Example body: [ { "prefix": "global", "name": "label2" }, { "prefix": "global", "name": "label2" } ]

Parameters:
contentId - A string containing the id of the labels content container
labels - list of labels to add
Returns:
a JSON representation of the existing and added labels on the content with the given id, or a 404 NOT FOUND if there is no content with the given id or if the user is not permitted. An empty list will be returned if there are no labels on the given content
Throws:
ServiceException


Copyright © 2003-2014 Atlassian. All Rights Reserved.