@PublicApi public class ContentPropertyResource extends Object
A REST resource for manipulating content properties.
Content properties are a key / value store of properties attached to a piece of Content. The key is a string, and the value is a JSON object.
Constructor and Description |
---|
ContentPropertyResource(ContentPropertyService service) |
Modifier and Type | Method and Description |
---|---|
JsonContentProperty |
create(ContentId contentId,
JsonContentProperty newProperty)
Creates a new content property.
|
JsonContentProperty |
create(ContentId contentId,
String key,
JsonContentProperty newProperty)
Creates a new content property.
|
javax.ws.rs.core.Response |
delete(ContentId contentId,
String key)
Deletes a content property.
|
RestList<JsonContentProperty> |
findAll(ContentId contentId,
String expand,
int start,
int limit,
javax.ws.rs.core.UriInfo uriInfo)
Returns a paginated list of content properties.
|
JsonContentProperty |
findByKey(ContentId contentId,
String key,
String expand)
Returns a content property.
|
JsonContentProperty |
update(ContentId contentId,
String key,
JsonContentProperty property)
Updates a content property.
|
public ContentPropertyResource(ContentPropertyService service)
public JsonContentProperty create(ContentId contentId, JsonContentProperty newProperty) throws ServiceException
Creates a new content property.
contentId
- the content to attach the property tonewProperty
- content property to be createdServiceException
public JsonContentProperty create(ContentId contentId, String key, JsonContentProperty newProperty) throws ServiceException
Creates a new content property.
contentId
- the content to attach the property tokey
- the key of the content property. Required.newProperty
- content property to be createdServiceException
public RestList<JsonContentProperty> findAll(ContentId contentId, String expand, int start, int limit, @Context javax.ws.rs.core.UriInfo uriInfo) throws ServiceException
Returns a paginated list of content properties.
Example request URI:
http://example.com/rest/api/content/1234/property?expand=content,version
contentId
- the content to find properties under. Required.expand
- a comma separated list of properties to expand on the content 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 URIServiceException
public JsonContentProperty findByKey(ContentId contentId, String key, String expand) throws ServiceException
Returns a content property.
Example request URI:
http://example.com/rest/api/content/1234/property/example-property-key?expand=content,version
contentId
- the content to find the property under. Required.key
- the key of the content property. Required.expand
- a comma separated list of properties to expand on the content properties. Default value: version
.ServiceException
public JsonContentProperty update(ContentId contentId, String key, JsonContentProperty property) throws IOException, ServiceException
Updates a content property.
The body contains the representation of the content property. Must include the property id, and the new version number.
Attempts to create a new content property if the given version number is 1, just like create(com.atlassian.confluence.api.model.content.id.ContentId, String, com.atlassian.confluence.api.model.content.JsonContentProperty)
.
contentId
- the id of the contentkey
- the key of the propertyproperty
- the content property being updatedServiceException
IOException
public javax.ws.rs.core.Response delete(ContentId contentId, String key) throws ServiceException
Deletes a content property.
contentId
- the id of the contentkey
- the key of the propertyServiceException
Copyright © 2003–2018 Atlassian. All rights reserved.