com.atlassian.confluence.rest.resources
Class ChildContentResource

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

public class ChildContentResource
extends java.lang.Object

REST wrapper for the ChildContentService.


Constructor Summary
ChildContentResource(ChildContentService childContentService)
           
 
Method Summary
 java.util.Map<ContentType,PageResponse<Content>> children(ContentId contentId, java.lang.String expand, javax.ws.rs.core.UriInfo uriInfo)
          Returns a map of the direct children of a piece of Content.
 RestList<Content> childrenOfType(ContentId contentId, ContentType type, java.lang.String expand, int start, int limit, javax.ws.rs.core.UriInfo uriInfo)
          Returns the direct children of a piece of Content, limited to a single child type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChildContentResource

public ChildContentResource(ChildContentService childContentService)
Method Detail

children

public java.util.Map<ContentType,PageResponse<Content>> children(ContentId contentId,
                                                                 java.lang.String expand,
                                                                 @Context
                                                                 javax.ws.rs.core.UriInfo uriInfo)
                                                          throws ServiceException
Returns a map of the direct children of a piece of Content. Content can have multiple types of children - for example a Page can have children that are also Pages, but it can also have Comments and Attachments.

The ContentType(s) of the children returned is specified by the "expand" query parameter in the request - this parameter can include expands for multiple child types.
If no types are included in the expand parameter, the map returned will just list the child types that are available to be expanded for the Content referenced by the "id" path parameter.

Example request URI(s):

  • http://example.com/rest/api/content/1234/children
  • http://example.com/rest/api/content/1234/children?expand=page.body.VIEW
  • http://example.com/rest/api/content/1234/children?expand=page&start=20&limit=10

Parameters:
contentId - a string containing the id of the content to retrieve children for
expand - a comma separated list of properties to expand on the children
uriInfo - (injected) information about the request URI
Returns:
a JSON Map of the children, keyed by their ContentTypes, or a 404 NOT FOUND if there is no content with the given id or if the user is not permitted to see it.
Throws:
ServiceException - if the request cannot be satisfied for any reason

childrenOfType

public RestList<Content> childrenOfType(ContentId contentId,
                                        ContentType type,
                                        java.lang.String expand,
                                        int start,
                                        int limit,
                                        @Context
                                        javax.ws.rs.core.UriInfo uriInfo)
                                 throws ServiceException
Returns the direct children of a piece of Content, limited to a single child type.

The ContentType(s) of the children returned is specified by the "type" path parameter in the request.

Example request URI(s):

  • http://example.com/rest/api/content/1234/children/page
  • http://example.com/rest/api/content/1234/children/comment
  • http://example.com/rest/api/content/1234/children/page?expand=body.VIEW
  • http://example.com/rest/api/content/1234/children/comment?start=20&limit=10

Parameters:
contentId - a string containing the id of the content to retrieve children for
type - a ContentType to filter children on.
expand - a comma separated list of properties to expand on the children
start - (optional, default: 0) the index of the first item within the result set that should be returned
limit - (optional, default: site limit) how many items should be returned after the start index
uriInfo - (injected) information about the request URI
Returns:
a JSON Map of the children, keyed by their ContentTypes, or a 404 NOT FOUND if there is no content with the given id or if the user is not permitted to see it.
Throws:
ServiceException - if the request cannot be satisfied for any reason


Copyright © 2003-2014 Atlassian. All Rights Reserved.