@ExperimentalApi
public interface ContentTemplateService
Modifier and Type | Interface and Description |
---|---|
static interface |
ContentTemplateService.ParameterTemplateFinder |
static interface |
ContentTemplateService.TemplateFinder |
static interface |
ContentTemplateService.Validator |
Modifier and Type | Method and Description |
---|---|
ContentTemplate |
create(ContentTemplate contentTemplate,
Expansion... expand)
Create Template.
|
default ContentBlueprintInstance |
createInstance(ContentBlueprintInstance blueprintInstance,
Expansion... expansions)
Create a page/draft content from a template.
|
void |
delete(ContentTemplateId contentTemplateId)
Delete a template for global or space, for blueprint template it means remove the template and revert to use the default template
from the plugin.
|
ContentTemplateService.TemplateFinder |
find(Expansion... expansions)
Creates an Template finder for locating Templates.
|
ContentTemplate |
getTemplate(ContentTemplateId contentTemplateId,
Expansion... expansions)
Return an individual template.
|
PageResponse<ContentTemplate> |
getTemplates(ContentTemplateType contentTemplateType,
com.atlassian.fugue.Option<Space> space,
PageRequest pageRequest,
Expansion... expansions)
Deprecated.
since 6.13.0, use
getTemplates(ContentTemplateType, Optional, PageRequest, Expansion...) |
default PageResponse<ContentTemplate> |
getTemplates(ContentTemplateType contentTemplateType,
Optional<Space> space,
PageRequest pageRequest,
Expansion... expansions)
Returns templates of the current space, or returns global templates if no space specified.
|
ContentTemplate |
update(ContentTemplate contentTemplate,
Expansion... expansions)
Update an existing template
|
ContentTemplateService.Validator |
validator(ContentTemplateType contentTemplateType)
Return the Validator for operations.
|
@Deprecated PageResponse<ContentTemplate> getTemplates(ContentTemplateType contentTemplateType, com.atlassian.fugue.Option<Space> space, PageRequest pageRequest, Expansion... expansions)
getTemplates(ContentTemplateType, Optional, PageRequest, Expansion...)
contentTemplateType
- ContentTemplateType for the template to look forspace
- space objectpageRequest
- PageRequest to control the pageResponse to return.expansions
- a comma-separated list of properties to expand in the response.default PageResponse<ContentTemplate> getTemplates(ContentTemplateType contentTemplateType, Optional<Space> space, PageRequest pageRequest, Expansion... expansions)
contentTemplateType
- ContentTemplateType for the template to look forspace
- space objectpageRequest
- PageRequest to control the pageResponse to return.expansions
- a comma-separated list of properties to expand in the response.ContentTemplate getTemplate(ContentTemplateId contentTemplateId, Expansion... expansions)
contentTemplateId
- ContentTemplateId
expansions
- a comma-separated list of properties to expand in the response.ContentTemplate
ContentTemplate create(ContentTemplate contentTemplate, Expansion... expand)
contentTemplate
- the ContentTemplate to be created.expand
- a comma-separated list of properties to expand in the response.ContentTemplate
ContentTemplate update(ContentTemplate contentTemplate, Expansion... expansions)
contentTemplate
- The updated ContentTemplateexpansions
- a comma-separated list of properties to expand in the response.void delete(ContentTemplateId contentTemplateId)
contentTemplateId
- ContentTemplateId
the id of the
content template to remove.ContentTemplateService.Validator validator(ContentTemplateType contentTemplateType)
contentTemplateType
- ContentTemplateService.TemplateFinder find(Expansion... expansions)
Currently an Template finder requires a template id, or else it will return list templates, or return the first found.
For example, to locate an template with id:
ContentTemplate template = ContentTemplateService.find()
.withId(templateId)
.fetchOneOrNull();
expansions
- the expansions to apply to the values returned from a fetchdefault ContentBlueprintInstance createInstance(ContentBlueprintInstance blueprintInstance, Expansion... expansions)
ContentTemplateId id = ContentTemplateId.fromLong(longTemplateId);
ContentBlueprintInstance cbi = ContentBlueprintInstance.builder()
.content(Content.builder()
.title("Title for Draft")
.space("Space Key here")
.status(ContentStatus.DRAFT).build())
.contentBlueprintSpec(ContentBlueprintSpec.builder()
.contentTemplateId(id).build())
.build();
When create page, use ContentStatus
CURRENT for status of Content.blueprintInstance
- ContentBlueprintInstance
expansions
- Copyright © 2003–2021 Atlassian. All rights reserved.