|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.confluence.rest.resources.ContentResource
public class ContentResource
REST wrapper for the ContentService
.
Constructor Summary | |
---|---|
ContentResource(ContentService contentService,
SpaceService spaceService,
ContentMacroService contentMacroService)
|
Method Summary | |
---|---|
Content |
createContent(Content newContent)
Creates a new piece of Content. |
void |
delete(ContentId contentId)
Deletes a piece of Content. |
Content |
getContent(ContentId contentId,
java.lang.String expand)
Returns a piece of Content. |
PageResponse<Content> |
getContent(java.lang.String type,
java.lang.String spaceKey,
java.lang.String title,
java.lang.String postingDay,
java.lang.String expand,
int start,
int limit,
javax.ws.rs.core.UriInfo uriInfo)
Returns a piece of Content. |
History |
getHistory(ContentId contentId,
java.lang.String expand)
Returns the history of a particular piece of content |
MacroInstance |
getMacroBodyByHash(ContentId contentId,
int versionId,
java.lang.String hash)
Returns the body of a macro (in storage format) with the given hash. |
Content |
update(ContentId contentId,
Content content)
Updates a piece of Content. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContentResource(ContentService contentService, SpaceService spaceService, ContentMacroService contentMacroService)
Method Detail |
---|
@PublicApi public Content getContent(ContentId contentId, java.lang.String expand) throws ServiceException
Returns a piece of Content.
Example request: http://example.com/rest/api/content/1234?expand=space,body.view,version,container
contentId
- the id of the contentexpand
- A comma separated list of properties to expand on the content. Default value: history,space,version
ServiceException
@PublicApi public Content createContent(Content newContent) throws ServiceException
Creates a new piece of Content.
newContent
- content to be created
ServiceException
@PublicApi public PageResponse<Content> getContent(java.lang.String type, java.lang.String spaceKey, java.lang.String title, java.lang.String postingDay, java.lang.String expand, int start, int limit, @Context javax.ws.rs.core.UriInfo uriInfo) throws ServiceException
Returns a piece of Content. EXPERIMENTAL: only implemented for pages and blogposts
Example requests:
http://example.com/rest/api/content?spaceKey=TST&Title=Cheese&expand=space,body.view,version,container
http://example.com/rest/api/content?type=blogpost&spaceKey=TST&title=Bacon&postingDay=2014-02-13&expand=space,body.view,version,container
type
- the content type to return. Default value: page
. Valid values: page, blogpost
.spaceKey
- the space key to find content under. Required.title
- the title of the page to find. Required for page
type.postingDay
- the posting day of the blog post. Required for blogpost
type. Format: yyyy-mm-dd
. Example: 2013-02-13
expand
- a comma separated list of properties to expand on the content. Default value: history,space,version
.
ServiceException
@PublicApi public History getHistory(ContentId contentId, java.lang.String expand) throws ServiceException
Returns the history of a particular piece of content
contentId
- the id of the contentexpand
- the properties on content history to expand
ServiceException
@PublicApi public MacroInstance getMacroBodyByHash(ContentId contentId, int versionId, java.lang.String hash) throws ServiceException
Returns the body of a macro (in storage format) with the given hash. This resource is primarily used by connect applications that require the body of macro to perform their work.
The hash is generated by connect during render time of the local macro holder and is usually only relevant during the scope of one request. For optimisation purposes, this hash will usually live for multiple requests.
contentId
- a string containing the id of the contentversionId
- the version of the content which the hash belongshash
- the hash of the macro body
ServiceException
@PublicApi public Content update(ContentId contentId, Content content) throws ServiceException
Updates a piece of Content.
The body contains the representation of the content.
contentId
- the id of the contentcontent
- the content being updated
ServiceException
@PublicApi public void delete(ContentId contentId) throws ServiceException
Deletes a piece of Content.
contentId
- the id of the content
ServiceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |