Class ChildContentResource
- java.lang.Object
-
- com.atlassian.confluence.plugins.restapi.resources.ChildContentResource
-
public class ChildContentResource extends Object
REST wrapper for theChildContentService
.
-
-
Constructor Summary
Constructors Constructor Description ChildContentResource(ChildContentService childContentService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<ContentType,PageResponse<Content>>
children(ContentId contentId, String expand, Integer parentVersion, int start, int limit, 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, String expand, Integer parentVersion, 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.RestList<Content>
commentsOfContent(ContentId contentId, String expand, Integer parentVersion, int start, int limit, Set<String> location, String depth, javax.ws.rs.core.UriInfo uriInfo)
Returns the comments of a content
-
-
-
Constructor Detail
-
ChildContentResource
public ChildContentResource(ChildContentService childContentService)
-
-
Method Detail
-
children
public Map<ContentType,PageResponse<Content>> children(ContentId contentId, String expand, Integer parentVersion, int start, int limit, @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 theContent
referenced by the "id" path parameter.Example request URI(s):
http://example.com/confluence/rest/api/content/1234/child
http://example.com/confluence/rest/api/content/1234/child?expand=page.body.VIEW
http://example.com/confluence/rest/api/content/1234/child?expand=page&start=20&limit=10
- Parameters:
contentId
- a string containing the id of the content to retrieve children forexpand
- a comma separated list of properties to expand on the childrenparentVersion
- an int representing the version of the content to retrieve children foruriInfo
- (injected) information about the request URI- Returns:
- a JSON Map of the children, 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
-
childrenOfType
public RestList<Content> childrenOfType(ContentId contentId, ContentType type, String expand, Integer parentVersion, 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/confluence/rest/api/content/1234/child/page
http://example.com/confluence/rest/api/content/1234/child/comment
http://example.com/confluence/rest/api/content/1234/child/page?expand=body.view
http://example.com/confluence/rest/api/content/1234/child/comment?start=20&limit=10
- Parameters:
contentId
- a string containing the id of the content to retrieve children fortype
- aContentType
to filter children on.expand
- a comma separated list of properties to expand on the childrenparentVersion
- an int representing the version of the content to retrieve children forstart
- (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 children, 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
-
commentsOfContent
public RestList<Content> commentsOfContent(ContentId contentId, String expand, Integer parentVersion, int start, int limit, Set<String> location, String depth, @Context javax.ws.rs.core.UriInfo uriInfo) throws ServiceException
Returns the comments of a contentExample request URI(s):
http://example.com/confluence/rest/api/content/1234/child/comment
http://example.com/confluence/rest/api/content/1234/child/comment?expand=body.view
http://example.com/confluence/rest/api/content/1234/child/comment?start=20&limit=10
http://example.com/confluence/rest/api/content/1234/child/comment?location=footer&location=inline&location=resolved
http://example.com/confluence/rest/api/content/1234/child/comment?expand=extensions.inlineProperties,extensions.resolution
- Parameters:
contentId
- a string containing the id of the content to retrieve children forexpand
- a comma separated list of properties to expand on the children. We can also specify some extensions such asextensions.inlineProperties
(for getting inline comment-specific properties) orextensions.resolution
for the resolution status of each comment in the resultsparentVersion
- an int representing the version of the content to retrieve children forstart
- (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 indexlocation
- (optional, default: "" means all) the location of the comments. Possible values are: "inline", "footer", "resolved". You can define multiple location params. The results will be the comments matched by any location.depth
- (optional, default: "") the depth of the comments. Possible values are: "" (ROOT only), "all"uriInfo
- (injected) information about the request URI- Returns:
- a JSON Map of the children, 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- Since:
- 5.7
-
-