Class SpacePropertyResource
- java.lang.Object
-
- com.atlassian.confluence.plugins.restapi.resources.SpacePropertyResource
-
@PublicApi public class SpacePropertyResource extends Object
A REST resource for manipulating space properties.
Space properties are a key / value store of properties attached to a Space. The key is a string, and the value is a JSON object.
- Since:
- 5.9
-
-
Constructor Summary
Constructors Constructor Description SpacePropertyResource(SpacePropertyService service)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonSpaceProperty
create(String spaceKey, JsonSpaceProperty newProperty)
Creates a new space property.JsonSpaceProperty
create(String spaceKey, String propertyKey, JsonSpaceProperty newProperty)
Creates a new space property.javax.ws.rs.core.Response
delete(String spaceKey, String propertyKey)
Deletes a space property.PageResponse<JsonSpaceProperty>
get(String spaceKey, String expand, int start, int limit, javax.ws.rs.core.UriInfo uriInfo)
Returns a paginated list of space properties.JsonSpaceProperty
get(String spaceKey, String propertyKey, String expand)
Returns a space property.JsonSpaceProperty
update(String spaceKey, String propertyKey, JsonSpaceProperty property)
Updates a space property.
-
-
-
Constructor Detail
-
SpacePropertyResource
public SpacePropertyResource(SpacePropertyService service)
-
-
Method Detail
-
create
public JsonSpaceProperty create(String spaceKey, JsonSpaceProperty newProperty) throws ServiceException
Creates a new space property.
- Parameters:
spaceKey
- the space to attach the property tonewProperty
- space property to be created- Returns:
- space property created
- Throws:
ServiceException
-
create
public JsonSpaceProperty create(String spaceKey, String propertyKey, JsonSpaceProperty newProperty) throws ServiceException
Creates a new space property.
- Parameters:
spaceKey
- the space to attach the property topropertyKey
- property key of the property to be creatednewProperty
- space property to be created- Returns:
- space property created
- Throws:
ServiceException
-
get
public PageResponse<JsonSpaceProperty> get(String spaceKey, String expand, int start, int limit, @Context javax.ws.rs.core.UriInfo uriInfo) throws ServiceException
Returns a paginated list of space properties.
Example request URI:
http://example.com/confluence/rest/api/space/TST/property?expand=space,version
- Parameters:
spaceKey
- the space to find properties under. Required.expand
- a comma separated list of properties to expand on the space properties. Default value:version
.start
- the start point of the collection to returnlimit
- the limit of the number of items to return, this may be restricted by fixed system limitsuriInfo
- (injected) information about the request URI- Returns:
- a JSON representation of the space properties, or a 404 NOT FOUND if there is no space with the given key or if the user is not permitted.
- Throws:
ServiceException
-
get
public JsonSpaceProperty get(String spaceKey, String propertyKey, String expand) throws ServiceException
Returns a space property.
Example request URI:
http://example.com/confluence/rest/api/space/TST/property/example-property-key?expand=space,version
- Parameters:
spaceKey
- the space to find the property under. Required.propertyKey
- the key of the space property. Required.expand
- a comma separated list of properties to expand on the space properties. Default value:version
.- Returns:
- a JSON representation of the space property, or a 404 NOT FOUND if there is no space with the given key, or no property with the given key, or if the user is not permitted.
- Throws:
ServiceException
-
update
public JsonSpaceProperty update(String spaceKey, String propertyKey, JsonSpaceProperty property) throws ServiceException
Updates a space property.
The body contains the representation of the space property. Must include new version number. If the given version number is 1, attempts to create a new space property, just like
create(String, com.atlassian.confluence.api.model.content.JsonSpaceProperty)
.- Parameters:
spaceKey
- the space to attach the property topropertyKey
- the key of the propertyproperty
- the space property being updated- Returns:
- a JSON representation of the space property.
- Throws:
ServiceException
- if there is no space with the given spaceKey, or no property with the given key, or if the user is not permitted.
-
delete
public javax.ws.rs.core.Response delete(String spaceKey, String propertyKey) throws ServiceException
Deletes a space property.
- Parameters:
spaceKey
- the key of the spacepropertyKey
- the key of the property- Throws:
ServiceException
-
-