com.atlassian.confluence.rest.resources
Class SpaceResource

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

public class SpaceResource
extends java.lang.Object

REST wrapper for the SpaceService.


Constructor Summary
SpaceResource(SpaceService spaceService, NavigationService navigationService)
           
 
Method Summary
 java.util.Map<ContentType,RestList<Content>> contents(java.lang.String spaceKey, java.lang.String depth, java.lang.String expand, int start, int limit)
          Returns the content in this given space
 RestList<Content> contentsWithType(java.lang.String spaceKey, java.lang.String type, java.lang.String depth, java.lang.String expand, int start, int limit, javax.ws.rs.core.UriInfo uriInfo)
          Returns the content in this given space with the given type
 Space createPrivateSpace(Space newSpace)
          Creates a new private Space, viewable only by its creator.
 Space createSpace(Space newSpace)
          Creates a new Space.
 Space space(java.lang.String spaceKey, java.lang.String expand)
          Returns information about a space.
 PageResponse<Space> spaces(java.util.List<java.lang.String> spaceKeys, java.lang.String expand, int start, int limit, javax.ws.rs.core.UriInfo uriInfo)
          Returns information about a number of spaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpaceResource

public SpaceResource(SpaceService spaceService,
                     NavigationService navigationService)
Method Detail

createSpace

@PublicApi
public Space createSpace(Space newSpace)
                  throws ServiceException
Creates a new Space.

The incoming Space does not include an id, but must include a Key and Name, and should include a Description.

Parameters:
newSpace - the space to be created
Returns:
the space created
Throws:
ServiceException

createPrivateSpace

@PublicApi
public Space createPrivateSpace(Space newSpace)
                         throws ServiceException
Creates a new private Space, viewable only by its creator.

The incoming Space does not include an id, but must include a Key and Name, and should include a Description.

Parameters:
newSpace - the space to be created
Returns:
the space created
Throws:
ServiceException

space

@PublicApi
public Space space(java.lang.String spaceKey,
                             java.lang.String expand)

Returns information about a space.

Example request URI(s):

  • http://example.com/rest/api/space/TST?expand=description

Parameters:
spaceKey - a string containing the key of the space
expand - a comma separated list of properties to expand on the space
Returns:
a JSON representation of a space, or a 404 if not found.
Throws:
ServiceException

spaces

@PublicApi
public PageResponse<Space> spaces(java.util.List<java.lang.String> spaceKeys,
                                            java.lang.String expand,
                                            int start,
                                            int limit,
                                            @Context
                                            javax.ws.rs.core.UriInfo uriInfo)
                           throws ServiceException

Returns information about a number of spaces.

Example request URI(s):

  • http://example.com/rest/api/space?spaceKey=TST&spaceKey=ds

Parameters:
spaceKeys - a list of space keys
expand - a comma separated list of properties to expand on the spaces
start - the start point of the collection to return
limit - the limit of the number of spaces to return, this may be restricted by fixed system limits
uriInfo - (injected) information about the request URI
Returns:
a JSON representation of a space, or a 404 if not found.
Throws:
ServiceException

contents

@PublicApi
public java.util.Map<ContentType,RestList<Content>> contents(java.lang.String spaceKey,
                                                                       java.lang.String depth,
                                                                       java.lang.String expand,
                                                                       int start,
                                                                       int limit)
                                                      throws ServiceException

Returns the content in this given space

Example request URI(s):

  • http://example.com/rest/api/space/TEST/content?expand=history

Parameters:
spaceKey - a string containing the key of the space
depth - a string indicating if all content, or just the root content of the space is returned. Default value: all. Valid values: all, root.
expand - a comma separated list of properties to expand on each piece of content retrieved
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
Returns:
a JSON representation of the lists content, or an empty list if no content is found
Throws:
ServiceException

contentsWithType

@PublicApi
public RestList<Content> contentsWithType(java.lang.String spaceKey,
                                                    java.lang.String type,
                                                    java.lang.String depth,
                                                    java.lang.String expand,
                                                    int start,
                                                    int limit,
                                                    @Context
                                                    javax.ws.rs.core.UriInfo uriInfo)
                                   throws ServiceException

Returns the content in this given space with the given type

Example request URI(s):

  • http://example.com/rest/api/space/TEST/content/page?expand=history

Parameters:
spaceKey - a string containing the key of the space
type - the type of content to return with the space. Valid values: page, blogpost.
depth - a string indicating if all content, or just the root content of the space is returned. Default value: all. Valid values: all, root.
expand - a comma separated list of properties to expand on each piece of content retrieved
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 lists content, or an empty list if no content is found
Throws:
ServiceException


Copyright © 2003-2014 Atlassian. All Rights Reserved.