Class DescendantContentResource
- java.lang.Object
-
- com.atlassian.confluence.plugins.restapi.resources.DescendantContentResource
-
public class DescendantContentResource extends Object
REST wrapper for theChildContentService
, whenDepth
is ALL.
-
-
Constructor Summary
Constructors Constructor Description DescendantContentResource(ChildContentService childContentService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<ContentType,PageResponse<Content>>
descendants(ContentId contentId, String expand, javax.ws.rs.core.UriInfo uriInfo)
Returns a map of the descendants of a piece of Content.RestList<Content>
descendantsOfType(ContentId contentId, ContentType type, String expand, int start, int limit, javax.ws.rs.core.UriInfo uriInfo)
Returns the direct descendants of a piece of Content, limited to a single descendant type.
-
-
-
Constructor Detail
-
DescendantContentResource
public DescendantContentResource(ChildContentService childContentService)
-
-
Method Detail
-
descendants
public Map<ContentType,PageResponse<Content>> descendants(ContentId contentId, String expand, @Context javax.ws.rs.core.UriInfo uriInfo) throws ServiceException
Returns a map of the descendants of a piece of Content. Content can have multiple types of descendants - for example a Page can have descendants that are also Pages, but it can also have Comments and Attachments.The
ContentType
(s) of the descendants returned is specified by the "expand" query parameter in the request - this parameter can include expands for multiple descendant types.
If no types are included in the expand parameter, the map returned will just list the descendant types that are available to be expanded for theContent
referenced by the "id" path parameter.Currently the only supported descendants are comment descendants of non-comment Content.
Example request URI(s):
http://example.com/confluence/rest/api/content/1234/descendant
http://example.com/confluence/rest/api/content/1234/descendant?expand=comment.body.VIEW
http://example.com/confluence/rest/api/content/1234/descendant?expand=comment
- Parameters:
contentId
- a string containing the id of the content to retrieve descendants forexpand
- a comma separated list of properties to expand on the descendantsuriInfo
- (injected) information about the request URI- Returns:
- a JSON Map of the descendants, keyed by their
ContentType
s, 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
-
descendantsOfType
public RestList<Content> descendantsOfType(ContentId contentId, ContentType type, String expand, int start, int limit, @Context javax.ws.rs.core.UriInfo uriInfo) throws ServiceException
Returns the direct descendants of a piece of Content, limited to a single descendant type.The
ContentType
(s) of the descendants returned is specified by the "type" path parameter in the request.Currently the only supported descendants are comment descendants of non-comment Content.
Example request URI(s):
http://example.com/confluence/rest/api/content/1234/descendant/comment
http://example.com/confluence/rest/api/content/1234/descendant/comment?expand=body.VIEW
http://example.com/confluence/rest/api/content/1234/descendant/comment?start=20&limit=10
- Parameters:
contentId
- a string containing the id of the content to retrieve descendants fortype
- aContentType
to filter descendants on.expand
- a comma separated list of properties to expand on the descendantsstart
- (optional, default: 0) the index of the first item within the result set that should be returnedlimit
- (optional, default: site limit) how many items should be returned after the start indexuriInfo
- (injected) information about the request URI- Returns:
- a JSON Map of the descendants, keyed by their
ContentType
s, 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
-
-