Class TemplateResource
- java.lang.Object
 - 
- com.atlassian.confluence.plugins.restapi.experimental.resources.TemplateResource
 
 
- 
@ExperimentalApi public class TemplateResource extends Object
 
- 
- 
Constructor Summary
Constructors Constructor Description TemplateResource(ContentTemplateService contentTemplateService) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentTemplatecreateContentTemplate(ContentTemplate contentTemplate, String expand)Create a contentTemplate, this means creating a new page template or a customised blueprint template.ContentBlueprintInstancecreateInstance(ContentBlueprintInstance contentBlueprintInstance, ContentTemplateId contentTemplateId, String expand)PageResponse<ContentTemplate>getBlueprintTemplates(String spaceKey, int start, int limit, String expand, javax.ws.rs.core.UriInfo uriInfo)Returns all blueprint templates of the space specified.ContentTemplategetContentTemplate(ContentTemplateId id, String expand)Return the template identified by id.PageResponse<ContentTemplate>getContentTemplates(String spaceKey, int start, int limit, String expand, javax.ws.rs.core.UriInfo uriInfo)Returns all content templates of the space specified.javax.ws.rs.core.ResponseremoveTemplate(ContentTemplateId contentTemplateId)Delete an existing customised contentTemplate, for blueprint template this means revert to default template from plugin and remove the customised version of template.ContentTemplateupdateContentTemplate(ContentTemplate contentTemplate, String expand)Update/Edit an existing contentTemplate. 
 - 
 
- 
- 
Constructor Detail
- 
TemplateResource
public TemplateResource(ContentTemplateService contentTemplateService)
 
 - 
 
- 
Method Detail
- 
getBlueprintTemplates
public PageResponse<ContentTemplate> getBlueprintTemplates(String spaceKey, int start, int limit, String expand, @Context javax.ws.rs.core.UriInfo uriInfo)
Returns all blueprint templates of the space specified.
Example request URI:
http://example.com/confluence/rest/experimental/template/blueprint?expand=body&limit=10
- Parameters:
 spaceKey- space key, global if not specified.start- the start point of the paged response to return.limit- the limit of response pageexpand- a comma-separated list of properties to expand in the response. Default to empty string.uriInfo- (injected) information about the request URI- Returns:
 ContentTemplatePageResponse of ContentTemplate
 
- 
getContentTemplates
public PageResponse<ContentTemplate> getContentTemplates(String spaceKey, int start, int limit, String expand, @Context javax.ws.rs.core.UriInfo uriInfo)
Returns all content templates of the space specified.
Example request URI:
http://example.com/confluence/rest/experimental/template/page?expand=body&limit=10
- Parameters:
 spaceKey- space key, global if not specified.start- the start point of the paged response to return.limit- the limit of response pageexpand- a comma-separated list of properties to expand in the response.uriInfo- injected by Jersey- Returns:
 ContentTemplatePageResponse of ContentTemplate
 
- 
getContentTemplate
public ContentTemplate getContentTemplate(ContentTemplateId id, String expand)
Return the template identified by id.- Parameters:
 id-ContentTemplateIdId could contains a long, or uuid or ModuleCompletekeysexpand- a comma-separated list of properties to expand in the response.- Returns:
 ContentTemplateContentTemplate
 
- 
createContentTemplate
public ContentTemplate createContentTemplate(ContentTemplate contentTemplate, String expand)
Create a contentTemplate, this means creating a new page template or a customised blueprint template.- Parameters:
 contentTemplate- ContentTemplate to create.expand- a comma-separated list of properties to expand in the response.- Returns:
 ContentTemplateContentTemplate created.
 
- 
updateContentTemplate
public ContentTemplate updateContentTemplate(ContentTemplate contentTemplate, String expand)
Update/Edit an existing contentTemplate. contentTemplateIdWithId is used to find the template to update. As the original template already saved in database, it already has a long entity id.- Parameters:
 contentTemplate- update the existing contentTemplate with this oneexpand- a comma-separated list of properties to expand in the response.- Returns:
 ContentTemplateContentTemplate updated.
 
- 
removeTemplate
public javax.ws.rs.core.Response removeTemplate(ContentTemplateId contentTemplateId)
Delete an existing customised contentTemplate, for blueprint template this means revert to default template from plugin and remove the customised version of template. Revert a space level template, then global template will become used if there is a customised version.- Parameters:
 contentTemplateId-ContentTemplateId.ContentTemplateIdWithIdThis has to be a long entity id, as template is already existed before you can delete or revoke.- Returns:
 - noContent
 
 
- 
createInstance
public ContentBlueprintInstance createInstance(ContentBlueprintInstance contentBlueprintInstance, ContentTemplateId contentTemplateId, String expand)
 
 - 
 
 -