java.lang.Object
com.atlassian.confluence.plugins.restapi.experimental.resources.TemplateResource

@ExperimentalApi @Consumes("application/json") @Produces("application/json") @Path("/template") public class TemplateResource extends Object
  • Constructor Details

  • Method Details

    • getBlueprintTemplates

      @GET @Path("blueprint") public PageResponse<ContentTemplate> getBlueprintTemplates(@QueryParam("spaceKey") String spaceKey, @QueryParam("start") int start, @QueryParam("limit") @DefaultValue("25") int limit, @QueryParam("expand") @DefaultValue("") 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 page
      expand - a comma-separated list of properties to expand in the response. Default to empty string.
      uriInfo - (injected) information about the request URI
      Returns:
      ContentTemplate PageResponse of ContentTemplate
    • getContentTemplates

      @GET @Path("page") public PageResponse<ContentTemplate> getContentTemplates(@QueryParam("spaceKey") String spaceKey, @QueryParam("start") int start, @QueryParam("limit") @DefaultValue("25") int limit, @QueryParam("expand") @DefaultValue("") 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 page
      expand - a comma-separated list of properties to expand in the response.
      uriInfo - injected by Jersey
      Returns:
      ContentTemplate PageResponse of ContentTemplate
    • getContentTemplate

      @GET @Path("{contentTemplateId}") public ContentTemplate getContentTemplate(@PathParam("contentTemplateId") ContentTemplateId id, @QueryParam("expand") @DefaultValue("body") String expand)
      Return the template identified by id.
      Parameters:
      id - ContentTemplateId Id could contains a long, or uuid or ModuleCompletekeys
      expand - a comma-separated list of properties to expand in the response.
      Returns:
      ContentTemplate ContentTemplate
    • createContentTemplate

      @POST public ContentTemplate createContentTemplate(ContentTemplate contentTemplate, @QueryParam("expand") @DefaultValue("body") 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:
      ContentTemplate ContentTemplate created.
    • updateContentTemplate

      @PUT public ContentTemplate updateContentTemplate(ContentTemplate contentTemplate, @QueryParam("expand") @DefaultValue("body") 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 one
      expand - a comma-separated list of properties to expand in the response.
      Returns:
      ContentTemplate ContentTemplate updated.
    • removeTemplate

      @DELETE @Path("/{contentTemplateId}") public javax.ws.rs.core.Response removeTemplate(@PathParam("contentTemplateId") 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.ContentTemplateIdWithId This has to be a long entity id, as template is already existed before you can delete or revoke.
      Returns:
      noContent
    • createInstance

      @POST @Path("/page/{contentTemplateId}/instance") public ContentBlueprintInstance createInstance(ContentBlueprintInstance contentBlueprintInstance, @PathParam("contentTemplateId") ContentTemplateId contentTemplateId, @QueryParam("expand") @DefaultValue("body") String expand)