Interface ContentTemplateService
-
public interface ContentTemplateService
This is the interface contains all the methods common between Page and Blueprint template service. So we don't have declare them twice.- Since:
- 5.10
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ContentTemplateService.ParameterTemplateFinder
static interface
ContentTemplateService.TemplateFinder
static interface
ContentTemplateService.Validator
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method 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.default PageResponse<ContentTemplate>
getTemplates(ContentTemplateType contentTemplateType, com.atlassian.fugue.Option<Space> space, PageRequest pageRequest, Expansion... expansions)
Deprecated.since 6.13.0, usegetTemplates(ContentTemplateType, Optional, PageRequest, Expansion...)
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 templateContentTemplateService.Validator
validator(ContentTemplateType contentTemplateType)
Return the Validator for operations.
-
-
-
Method Detail
-
getTemplates
@Deprecated default PageResponse<ContentTemplate> getTemplates(ContentTemplateType contentTemplateType, com.atlassian.fugue.Option<Space> space, PageRequest pageRequest, Expansion... expansions)
Deprecated.since 6.13.0, usegetTemplates(ContentTemplateType, Optional, PageRequest, Expansion...)
Returns templates of the current space, or returns global templates if no space specified.- Parameters:
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.- Returns:
- Paged list of ContentTemplate
-
getTemplates
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.- Parameters:
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.- Returns:
- Paged list of ContentTemplate
- Since:
- 6.13.0
-
getTemplate
ContentTemplate getTemplate(ContentTemplateId contentTemplateId, Expansion... expansions)
Return an individual template.- Parameters:
contentTemplateId
-ContentTemplateId
expansions
- a comma-separated list of properties to expand in the response.- Returns:
ContentTemplate
-
create
ContentTemplate create(ContentTemplate contentTemplate, Expansion... expand)
Create Template.- Parameters:
contentTemplate
- the ContentTemplate to be created.expand
- a comma-separated list of properties to expand in the response.- Returns:
ContentTemplate
-
update
ContentTemplate update(ContentTemplate contentTemplate, Expansion... expansions)
Update an existing template- Parameters:
contentTemplate
- The updated ContentTemplateexpansions
- a comma-separated list of properties to expand in the response.- Returns:
- The updated ContentTemplate
-
delete
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. When revert a blueprint template defined in space, it revert to use its global customised template if global customisation exists.- Parameters:
contentTemplateId
-ContentTemplateId
the id of the content template to remove.
-
validator
ContentTemplateService.Validator validator(ContentTemplateType contentTemplateType)
Return the Validator for operations.- Parameters:
contentTemplateType
-- Returns:
- return a TemplateFinder
-
find
ContentTemplateService.TemplateFinder find(Expansion... expansions)
Creates an Template finder for locating Templates.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();
- Parameters:
expansions
- the expansions to apply to the values returned from a fetch- Returns:
-
createInstance
default ContentBlueprintInstance createInstance(ContentBlueprintInstance blueprintInstance, Expansion... expansions)
Create a page/draft content from a template. Template is specified inside ContentBlueprintInstance For example, to construct a ContentBlueprintInstance to create a draftContentTemplateId 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();
ContentStatus
CURRENT for status of Content.- Parameters:
blueprintInstance
-ContentBlueprintInstance
expansions
-- Returns:
- TODO CRA-1266 change default method to interface after Blueprint service in CC plugin implemented this interface.
-
-